-
Notifications
You must be signed in to change notification settings - Fork 97
fix(l1): added checks to newpayload and forkchoiceupdated #2831
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
Conversation
Lines of code reportTotal lines added: Detailed view
|
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.
Could you comment in the code that the need to fetch the parent's block body is due to executing blocks in batch during full-sync? This will be relevant if we choose to remove it or put it under a feature in the near future
Transaction Re-Org| | ||
Unique Payload ID| | ||
Unknown| | ||
Valid NewPayload->ForkchoiceUpdated" # |Invalid P9 -> flaky |
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.
nice!
return Err(ChainError::ParentNotFound); | ||
// Feda (#2831): We search for the entire block because during full/batch sync | ||
// we can have the header without the body indicating it's still syncing. | ||
let parent = self |
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.
so let me get this straight: the only change is that you are searching for the whole block instead of just the header. Any reason you decided to do this inline instead of with a helper function? I think it was actually more readable before.
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.
Ah, I see that the previous function was confusing and the comments outdated. Maybe the solution is a better name and a better comment instead of inlining and repeating code?
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'll do that. Do I return the old function for the other places in the code where they were used? With a better comment
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.
yeah, and maybe a better naming. But only if you think it makes the code more readable, this is a suggestion
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.
After implementing it I didn't think it was more readable for this section, but the other places it actually was better, so I have reintroduced the function.
**Motivation** This should fix some sync and inconsistent behaviour problems with the hive engine tests. The problem was happening when a sync process had begun, and a block from that sync process entered the server. Some checks for that scenario have been added. Also made some tests in the CI easier to read and edit, while adding a couple of them. **Description** - Made the CI tests have 1 by 1. - Added some fixed CI tests to "Paris Engine tests" and "Engine withdrawal tests" - Added a check to forkchoiceupdatet for the body to be present before forking. - Added a check to execute_payload for the body of the parent to be present before executing. Fixes some tests in #1285
**Motivation** When adding blocks in batches, transactions in blocks may need to read the hash of a previous block in the batch. This poses an issue, as we add all blocks after the full batch has been executed ad we don't have those hashes stored. Previously, this issue was tackled by storing the block headers before executing and storing the full block batch. This also required us to make the fixes on #2831 (as we might have the headers of blocks we have not yet executed during full sync). This stopped being a suitable solution once #3022 was merged, as block hashes are now searched using the block the state is based on's ancestors. As the state is based on the first block in the batch's parents, later blocks are not able to access the hashes of previous blocks in the batch. This PR aims to fix both issues by adding a `block_hash_cache` to the `StoreVmDatabase` were we would add the hashes of all blocks in the batch, and use it when fetching block hashes before looking at the Store. This way we can access block hashes for previously executed blocks in the batch without prematurely adding data from blocks yet to be executed to the state. Allowing us to rollback fixes from #2831 <!-- Why does this pull request exist? What are its goals? --> **Description** * Add `block_hash_cache` to `VmStoreDatabase` * Cache block hashes of the full batch before executing in `Blockchain::add_block_batch` * No longer store block headers before execution during full sync * Rollback fixes from #2831 (no longer needed due to the above change) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
…s#2831) **Motivation** This should fix some sync and inconsistent behaviour problems with the hive engine tests. The problem was happening when a sync process had begun, and a block from that sync process entered the server. Some checks for that scenario have been added. Also made some tests in the CI easier to read and edit, while adding a couple of them. **Description** - Made the CI tests have 1 by 1. - Added some fixed CI tests to "Paris Engine tests" and "Engine withdrawal tests" - Added a check to forkchoiceupdatet for the body to be present before forking. - Added a check to execute_payload for the body of the parent to be present before executing. Fixes some tests in lambdaclass#1285
…3034) **Motivation** When adding blocks in batches, transactions in blocks may need to read the hash of a previous block in the batch. This poses an issue, as we add all blocks after the full batch has been executed ad we don't have those hashes stored. Previously, this issue was tackled by storing the block headers before executing and storing the full block batch. This also required us to make the fixes on lambdaclass#2831 (as we might have the headers of blocks we have not yet executed during full sync). This stopped being a suitable solution once lambdaclass#3022 was merged, as block hashes are now searched using the block the state is based on's ancestors. As the state is based on the first block in the batch's parents, later blocks are not able to access the hashes of previous blocks in the batch. This PR aims to fix both issues by adding a `block_hash_cache` to the `StoreVmDatabase` were we would add the hashes of all blocks in the batch, and use it when fetching block hashes before looking at the Store. This way we can access block hashes for previously executed blocks in the batch without prematurely adding data from blocks yet to be executed to the state. Allowing us to rollback fixes from lambdaclass#2831 <!-- Why does this pull request exist? What are its goals? --> **Description** * Add `block_hash_cache` to `VmStoreDatabase` * Cache block hashes of the full batch before executing in `Blockchain::add_block_batch` * No longer store block headers before execution during full sync * Rollback fixes from lambdaclass#2831 (no longer needed due to the above change) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes #issue_number
Motivation
This should fix some sync and inconsistent behaviour problems with the hive engine tests. The problem was happening when a sync process had begun, and a block from that sync process entered the server. Some checks for that scenario have been added.
Also made some tests in the CI easier to read and edit, while adding a couple of them.
Description
Fixes some tests in #1285