-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: ensure no blob transactions in payloads pre-cancun #4779
Conversation
Codecov Report
... and 8 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
lgtm
Ok(block) => block, | ||
Err(error) => { | ||
// TODO: need to fix this to use the correct type |
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.
correct type of what?
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.
Outdated 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.
how is this not a noop given version/fork validation performed in disregard this qEngineApi::validate_payload_timestamp
method?
// make sure there are no blob transactions in the payload if it is pre-cancun | ||
// we perform this check before validating the block hash because INVALID_PARAMS | ||
// must be returned over an INVALID response. | ||
if !self.chain_spec().is_cancun_activated_at_timestamp(block.timestamp) && | ||
block.has_blob_transactions() | ||
{ | ||
return Err(BeaconOnNewPayloadError::PreCancunBlockWithBlobTransactions) | ||
} | ||
|
||
validate_block_hash(block_hash, block) |
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.
imo this should be handled on payload validation step inside EngineApi
handlers
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.
It's possible, but a bit more hacky to do this because the actual transaction decoding happens later, i.e. it happens in try_into_block
. Forgot to link #4670, see:
they are still stored as Bytes in the ExecutionPayload
6129476
to
0e48f72
Compare
This ensures there are no blob transactions pre-cancun, adding a new error variant that maps to
INVALID_PARAMS_CODE
.Makes the
/cancun/eip4844_blobs/blob_txs/blob_type_tx_pre_fork/001-fork=ShanghaiToCancunAtTime15k-one_blob_tx
test pass.Not really happy on the new return type of
ensure_well_formed_payload
- am considering adding a separate error type that makes this easier.Fixes #4670