Skip to content

Commit

Permalink
fix: do not rlp encode extradata (paradigmxyz#7256)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
jtraglia and mattsse authored Mar 20, 2024
1 parent 28b9834 commit 52668c6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/node-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ hyper.workspace = true
tracing.workspace = true

# crypto
alloy-rlp.workspace = true
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }

# async
Expand Down
2 changes: 1 addition & 1 deletion crates/node-core/src/args/payload_builder_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl TypedValueParser for ExtradataValueParser {
return Err(clap::Error::raw(
clap::error::ErrorKind::InvalidValue,
format!(
"Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}bytes limit"
"Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}-byte limit"
),
))
}
Expand Down
6 changes: 3 additions & 3 deletions crates/node-core/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ pub trait PayloadBuilderConfig {
/// Block extra data set by the payload builder.
fn extradata(&self) -> Cow<'_, str>;

/// Returns the rlp-encoded extradata bytes.
fn extradata_rlp_bytes(&self) -> Bytes {
alloy_rlp::encode(self.extradata().as_bytes()).into()
/// Returns the extradata as bytes.
fn extradata_bytes(&self) -> Bytes {
self.extradata().as_bytes().to_vec().into()
}

/// The interval at which the job should build a new payload after the last.
Expand Down
2 changes: 1 addition & 1 deletion crates/node-ethereum/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ where
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes())
.extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit());

let payload_generator = BasicPayloadJobGenerator::with_builder(
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ where
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes())
.extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit());

let payload_generator = BasicPayloadJobGenerator::with_builder(
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-payload-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where
.interval(conf.interval())
.deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes())
.extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit());

let payload_generator = EmptyBlockPayloadJobGenerator::with_builder(
Expand Down

0 comments on commit 52668c6

Please sign in to comment.