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

waitForReceipt returns before state is committed #1691

Closed
LHerskind opened this issue Aug 21, 2023 · 1 comment
Closed

waitForReceipt returns before state is committed #1691

LHerskind opened this issue Aug 21, 2023 · 1 comment
Labels
T-bug Type: Bug. Something is broken.

Comments

@LHerskind
Copy link
Contributor

Testing complex programs with views against expected state can be a pain since the unconstrained views are executed against a db that is possibly in progress of committing data. To work around it I added a wait of 5s in my test after every transaction, but that feels horrible. As a user I would expect that when the tx is "mined" and I have the receipt I should be able to execute something on top of that state.
In the snippet, the 4 values read is a slot, and the two first elements are updated in the same txs. The first value is literally dependent on the second changing, but when i read, you will see that the first value gets read before the update but the second after.

#1554

image

The waitForReceipt is checking that blocks have been received, but seem to not check that the state was updated before it is giving back the receipt. This is unexpected for the user, who as mentioned above, want to execute stuff on top of it.

protected async waitForReceipt(opts?: WaitOpts): Promise<TxReceipt> {

The function is depending on, which should probably make sure that the state is updated as the name alludes.

public async isGlobalStateSynchronised() {

@LHerskind LHerskind added the T-bug Type: Bug. Something is broken. label Aug 21, 2023
@LHerskind
Copy link
Contributor Author

Duplicate of #1687.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: Bug. Something is broken.
Projects
Archived in project
Development

No branches or pull requests

1 participant