Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: never mind background voting loop #76

Merged
merged 6 commits into from
Apr 18, 2024
Merged

chore: never mind background voting loop #76

merged 6 commits into from
Apr 18, 2024

Conversation

dckc
Copy link
Member

@dckc dckc commented Apr 18, 2024

The voting loop is redundant and it occasionally results in:

rpc error: code = Unknown desc = account sequence mismatch

as in Agoric/agoric-sdk#9250
https://github.com/Agoric/agoric-sdk/actions/runs/8727691415/job/23957208797

@@ -20,3 +20,15 @@ agd tx gov submit-proposal swingset-core-eval "$PERMIT" "$SCRIPT" \
set +x # not so noisy for this part
. /usr/src/upgrade-test-scripts/env_setup.sh
voteLatestProposalAndWait

sleep 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this sleep working around (I have PTSD anytime I see a delay in tests that is not looking for a trigger)

Copy link
Member Author

@dckc dckc Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

voteLatestProposalAndWait finishes when the core-eval proposal passes. This gives it time to execute before we check to see if it worked (i.e. check to see if the contract instance is visible via vstorage). IOU a comment.

The check was introduced a while ago without this delay, so I think it's not actually essential.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to wait 2 blocks instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some question about error handling.

jq -c '.value | fromjson | .values[-1] | fromjson | .body[1:] | fromjson | .[]'
}

# check that the contract was actually started
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard for me to track this down right now, but will a failure of this check result in the yarn start:contract to fail? I don't see any exit here if that were the case, but I also don't know of the error code would bubble all the way back.

Copy link
Member Author

@dckc dckc Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the error code does bubble all the way back.

If I chage it to grep offerUpXXX:

$ yarn start:docker && yarn start:contract
yarn run v1.22.21
$ cd contract && docker compose up -d
[+] Running 1/2
 ⠹ Network dapp-offer-up_default  Created                                                                                                                 0.3s 
 ✔ Container dapp-offer-up-agd-1  Started                                                                                                                 0.2s 
Done in 0.35s.
yarn run v1.22.21
$ cd contract && yarn start
$ yarn docker:make clean start-contract
$ docker compose exec agd make -C /workspace/contract clean start-contract
...
Waiting for proposal to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
waiting for block...
2
block produced
block produced
done
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5077    0  5077    0     0  4958k      0 --:--:-- --:--:-- --:--:-- 4958k
make: *** [Makefile:101: start-contract] Error 1
make: Leaving directory '/workspace/contract'
error Command failed with exit code 2.

$ echo $?
2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, if grep doesn't find a match, it's a pipe fail. No need to explicitly exit.

@@ -20,3 +20,16 @@ agd tx gov submit-proposal swingset-core-eval "$PERMIT" "$SCRIPT" \
set +x # not so noisy for this part
. /usr/src/upgrade-test-scripts/env_setup.sh
voteLatestProposalAndWait
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're we already trying to approve on this side before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly.

jq -c '.value | fromjson | .values[-1] | fromjson | .body[1:] | fromjson | .[]'
}

# check that the contract was actually started
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, if grep doesn't find a match, it's a pipe fail. No need to explicitly exit.

@dckc dckc merged commit f72117b into main Apr 18, 2024
2 checks passed
@dckc dckc deleted the dc-fix-race-sig branch April 18, 2024 14:55
@toliaqat
Copy link
Contributor

toliaqat commented Apr 18, 2024

The voting loop is redundant

@dckc how is the voting happening now to approve the proposal?

@dckc
Copy link
Member Author

dckc commented Apr 18, 2024

The voting loop is redundant

@dckc how is the voting happening now to approve the proposal?

with voteLatestProposalAndWait in propose-start-contract.sh, as noted above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants