-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Wait for transaction receipt if instant seal is enabled #9914
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
Wait for transaction receipt if instant seal is enabled #9914
Conversation
Add a new revive-dev-node RPC API to check whether the node has instant seal enabled. The query is performed once during client initialization.
…haimatchersassertionerror-assertion-error-receipt-should-not-be-null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick review, will look in more details when I get back
…haimatchersassertionerror-assertion-error-receipt-should-not-be-null
…be mined into a block.
2d61ff6 to
004f8c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would update the code to do the following:
- first as mentioned in comment, the broadcaster should be internal to the client.
- to have no perf impact on production setup we can also set it to optional and only set it to some if the automine is enabled
…or-assertion-error-receipt-should-not-be-null
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
- Treat broadcast::RecvError::Lagged appropriately in wait_for_transaction_to_be_mined. - Remove unused ClientError variant. - Fix clippy warnings.
I think it's good enough to wait for the next block, no need to check if the actual transaction has been mined, this should be enough for test framework that assume that the next block is mined when eth_sendRawTransaction returns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some change in the last commit,
as explained in the commit, it's good enough to just wait for the next block to be mined, this simplify the code for this feature.
Take a look see if I haven't done anything stupid
I think the latest solution offers fewer guarantees compared to the initial one, but it is indeed simpler. We need to decide whether this will be good enough for the testing framework. In the initial solution, a successful result from wait_for_tx method guaranteed that the transaction was included in a block, while the latest solution only ensures that a new block was mined, which may not contain the transaction. Sequence of events that leads to a "false positive":
|
|
We are just talking about a few additional lines of code in a single function that is only executed during testing. I'd argue in this case we take the more complex solution in order to gain the benefits. |
|
I would argue that this is good enough but majority wins so pushed a new commit, @marian-radu please review |
|
LGTM! |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
…or-assertion-error-receipt-should-not-be-null
Pull Request is not mergeable
Fixes paritytech/contract-issues#165 The main changes in this PR are: 1. Add a new API to revive-dev-node to check whether the node has instant seal enabled. 2. Add a new debug API to eth-rpc to check whether the node has instant seal enabled. (optional) 3. Query and cache the node’s instant seal status during eth-rpc initialization. 4. If instant seal is enabled, wait for the transaction receipt to be available --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pgherveou <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
Fixes paritytech/contract-issues#165
The main changes in this PR are: