Wait one block confirmation in tests#1438
Open
fullkomnun wants to merge 3 commits intoEYBlockchain:masterfrom
Open
Wait one block confirmation in tests#1438fullkomnun wants to merge 3 commits intoEYBlockchain:masterfrom
fullkomnun wants to merge 3 commits intoEYBlockchain:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
CONFIRMATIONSfrom 'config' is set to the default value of '12' or according to the matching env var if defined. It is referenced incommon-files/utils/event-queue.mjswhich is used by 'nightfall-optimist' and 'nightfall-client' to wait for a configured number of block confimrations before a L1 event is propagated and processed allowing for L1 re-org.During tests you usually want to either use a lower number of confirmations (such as 1) or when tests rely on this behaviour using a higher number of confimrations (like when testing L1 re-org) but leveraging Ganache like that:
test/utils.mjssome test file
.github/workflows/on-pull-request-master.ymlmost e2e test are setup withCONFIRMATIONS: 1, however value of env vars are not automatically propagated to containers and therefore the default value of '12' applies. Fixed that by editingdocker-compose.*.ymlfiles.test/utils.mjsalso waits for a number of block confirmations in 'submitTransaction' and in 'waitForEvent'. Curently it is hardcoded and set to '12', fixed it to grab the confirmations number from 'config'/cli) used by tests and 'proposer' / 'challenger' currently setsweb3.eth.transactionConfirmationBlocksto the hardcoded value of '12'. Fixed that to useprocess.env.CONFIRMATIONS || 12instead ('config' is not currently used by Nf3 / CLI so I did not use node 'config').Does this close any currently open issues?
Not that I'm aware of
What commands can I run to test the change?
Run all tests as usuall both locally and in CI (focus on these e2e tests that have
CONFIRMATIONS: 1which is all e2e tests except for 'client-authentication-test', 'test-apps')Any other comments?