-
Notifications
You must be signed in to change notification settings - Fork 573
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Component
rpc
Describe the feature you would like
this would currently decode the txs and compute the the root
alloy/crates/rpc-types-engine/src/payload.rs
Lines 1238 to 1241 in 72038c5
| pub fn try_into_block_with_sidecar<T: Decodable2718>( | |
| self, | |
| sidecar: &ExecutionPayloadSidecar, | |
| ) -> Result<Block<T>, PayloadError> { |
via:
alloy/crates/rpc-types-engine/src/payload.rs
Lines 340 to 344 in 72038c5
| // Calculate the transactions root using encoded bytes | |
| let transactions_root = alloy_consensus::proofs::ordered_trie_root_with_encoder( | |
| &self.transactions, | |
| |item, buf| buf.put_slice(item), | |
| ); |
in reth payload validation we can avoid or rather optimize the root calc separately,
so it'd be nice to have an extra fn that also accepts the tx root hash directly, like
try_into_block_with_meta
or smth.
and ideally this unifies the existing fn:
alloy/crates/rpc-types-engine/src/payload.rs
Lines 335 to 344 in 72038c5
| pub fn into_block_raw(self) -> Result<Block<Bytes>, PayloadError> { | |
| if self.extra_data.len() > MAXIMUM_EXTRA_DATA_SIZE { | |
| return Err(PayloadError::ExtraData(self.extra_data)); | |
| } | |
| // Calculate the transactions root using encoded bytes | |
| let transactions_root = alloy_consensus::proofs::ordered_trie_root_with_encoder( | |
| &self.transactions, | |
| |item, buf| buf.put_slice(item), | |
| ); |
with an extra fn that accepts an Optional txroot hash arg
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Done