-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: expand forkChoiceUpdatedV3 with basic block building #540
Conversation
} | ||
|
||
impl BuildPayloadArgs { | ||
/// Computes an 8-byte identifier by hashing the components of the payload arguments. |
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.
this is what the spec says? not against it, just curious
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 think I took it from geth. The spec says 8 Bytes - identifier of the payload build process
crates/blockchain/payload.rs
Outdated
gas_limit, | ||
gas_used: 0, | ||
timestamp: args.timestamp, | ||
// TODO: should use miner config's extra_data |
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.
nit, the concept of miner doesn't exist anymore in post merge networks. it's either proposer or builder
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.
Switched to builder
crates/storage/engines/api.rs
Outdated
fn set_canonical_block(&self, number: BlockNumber, hash: BlockHash) -> Result<(), StoreError>; | ||
|
||
fn add_local_block(&self, payload_id: u64, block: Block) -> Result<(), StoreError>; |
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.
hmm, I would rename to payload
, since block might be a bit confusing. WDYT?
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 figured block should be included in the name as the type stored is a Block
, but I agree
…g pipeline (#571) Depends on #540 **Motivation** Being able to run the full basic block building pipeline (forkChoiceUpdated -> getPayload -> newPayload) CURRENT_STATUS: I could successfully run some tests that ran the above sequence, we still need to add transactions sent by sendRawTransaction endpoint to the payload in order to fully build blocks <!-- Why does this pull request exist? What are its goals? --> **Description** * Add rpc endpoint `engine_getPayloadV3` * Compute new state root (after applying beacon_root contract & withdrawals) when building a new payload (`engine_forkChoiceUpdated`) * Set new block as canonical in `engine_newPayloadV3` (TEMP FIX for not being able to fetch non canonical blocks) Missing work (for a later PR) * Fetch transactions from the mempool and add them to the block * Populate BlobsBundle <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but is part of #344
…ss#540) **Motivation** Add basic block building to forkChoiceUpdatedV3 <!-- Why does this pull request exist? What are its goals? --> **Description** * Expand engine_forkChoiceUpdated: - Add validations - Fix fork state update conditions - Add basic block building With these changes hive engine tests no longer fail after calling engine_forkChoiceUpdatedV3. We still need to implement engine_getPayload to progress further NOTE: Some fixes over this code have been included in lambdaclass#571 (Computing the state root for newly built payloads instead of using the parent state root) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes None, is part of lambdaclass#344
…g pipeline (lambdaclass#571) Depends on lambdaclass#540 **Motivation** Being able to run the full basic block building pipeline (forkChoiceUpdated -> getPayload -> newPayload) CURRENT_STATUS: I could successfully run some tests that ran the above sequence, we still need to add transactions sent by sendRawTransaction endpoint to the payload in order to fully build blocks <!-- Why does this pull request exist? What are its goals? --> **Description** * Add rpc endpoint `engine_getPayloadV3` * Compute new state root (after applying beacon_root contract & withdrawals) when building a new payload (`engine_forkChoiceUpdated`) * Set new block as canonical in `engine_newPayloadV3` (TEMP FIX for not being able to fetch non canonical blocks) Missing work (for a later PR) * Fetch transactions from the mempool and add them to the block * Populate BlobsBundle <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes None, but is part of lambdaclass#344
…ss#540) **Motivation** Add basic block building to forkChoiceUpdatedV3 <!-- Why does this pull request exist? What are its goals? --> **Description** * Expand engine_forkChoiceUpdated: - Add validations - Fix fork state update conditions - Add basic block building With these changes hive engine tests no longer fail after calling engine_forkChoiceUpdatedV3. We still need to implement engine_getPayload to progress further NOTE: Some fixes over this code have been included in lambdaclass#571 (Computing the state root for newly built payloads instead of using the parent state root) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes None, is part of lambdaclass#344
…g pipeline (lambdaclass#571) Depends on lambdaclass#540 **Motivation** Being able to run the full basic block building pipeline (forkChoiceUpdated -> getPayload -> newPayload) CURRENT_STATUS: I could successfully run some tests that ran the above sequence, we still need to add transactions sent by sendRawTransaction endpoint to the payload in order to fully build blocks <!-- Why does this pull request exist? What are its goals? --> **Description** * Add rpc endpoint `engine_getPayloadV3` * Compute new state root (after applying beacon_root contract & withdrawals) when building a new payload (`engine_forkChoiceUpdated`) * Set new block as canonical in `engine_newPayloadV3` (TEMP FIX for not being able to fetch non canonical blocks) Missing work (for a later PR) * Fetch transactions from the mempool and add them to the block * Populate BlobsBundle <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes None, but is part of lambdaclass#344
**Motivation** Add basic block building to forkChoiceUpdatedV3 <!-- Why does this pull request exist? What are its goals? --> **Description** * Expand engine_forkChoiceUpdated: - Add validations - Fix fork state update conditions - Add basic block building With these changes hive engine tests no longer fail after calling engine_forkChoiceUpdatedV3. We still need to implement engine_getPayload to progress further NOTE: Some fixes over this code have been included in #571 (Computing the state root for newly built payloads instead of using the parent state root) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, is part of #344
…g pipeline (#571) Depends on #540 **Motivation** Being able to run the full basic block building pipeline (forkChoiceUpdated -> getPayload -> newPayload) CURRENT_STATUS: I could successfully run some tests that ran the above sequence, we still need to add transactions sent by sendRawTransaction endpoint to the payload in order to fully build blocks <!-- Why does this pull request exist? What are its goals? --> **Description** * Add rpc endpoint `engine_getPayloadV3` * Compute new state root (after applying beacon_root contract & withdrawals) when building a new payload (`engine_forkChoiceUpdated`) * Set new block as canonical in `engine_newPayloadV3` (TEMP FIX for not being able to fetch non canonical blocks) Missing work (for a later PR) * Fetch transactions from the mempool and add them to the block * Populate BlobsBundle <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but is part of #344
Motivation
Add basic block building to forkChoiceUpdatedV3
Description
With these changes hive engine tests no longer fail after calling engine_forkChoiceUpdatedV3. We still need to implement engine_getPayload to progress further
NOTE: Some fixes over this code have been included in #571 (Computing the state root for newly built payloads instead of using the parent state root)
Closes None, is part of #344