fix: do not rlp encode extradata (#7256)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Justin Traglia
2024-03-20 13:26:13 -05:00
committed by GitHub
parent 28b983403e
commit 52668c6de4
7 changed files with 7 additions and 9 deletions

1
Cargo.lock generated
View File

@ -6114,7 +6114,6 @@ dependencies = [
name = "reth-node-core" name = "reth-node-core"
version = "0.2.0-beta.3" version = "0.2.0-beta.3"
dependencies = [ dependencies = [
"alloy-rlp",
"assert_matches", "assert_matches",
"clap", "clap",
"const-str", "const-str",

View File

@ -75,7 +75,6 @@ hyper.workspace = true
tracing.workspace = true tracing.workspace = true
# crypto # crypto
alloy-rlp.workspace = true
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] } secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
# async # async

View File

@ -89,7 +89,7 @@ impl TypedValueParser for ExtradataValueParser {
return Err(clap::Error::raw( return Err(clap::Error::raw(
clap::error::ErrorKind::InvalidValue, clap::error::ErrorKind::InvalidValue,
format!( format!(
"Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}bytes limit" "Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}-byte limit"
), ),
)) ))
} }

View File

@ -86,9 +86,9 @@ pub trait PayloadBuilderConfig {
/// Block extra data set by the payload builder. /// Block extra data set by the payload builder.
fn extradata(&self) -> Cow<'_, str>; fn extradata(&self) -> Cow<'_, str>;
/// Returns the rlp-encoded extradata bytes. /// Returns the extradata as bytes.
fn extradata_rlp_bytes(&self) -> Bytes { fn extradata_bytes(&self) -> Bytes {
alloy_rlp::encode(self.extradata().as_bytes()).into() self.extradata().as_bytes().to_vec().into()
} }
/// The interval at which the job should build a new payload after the last. /// The interval at which the job should build a new payload after the last.

View File

@ -158,7 +158,7 @@ where
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes()) .extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit()); .max_gas_limit(conf.max_gas_limit());
let payload_generator = BasicPayloadJobGenerator::with_builder( let payload_generator = BasicPayloadJobGenerator::with_builder(

View File

@ -241,7 +241,7 @@ where
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes()) .extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit()); .max_gas_limit(conf.max_gas_limit());
let payload_generator = BasicPayloadJobGenerator::with_builder( let payload_generator = BasicPayloadJobGenerator::with_builder(

View File

@ -47,7 +47,7 @@ where
.interval(conf.interval()) .interval(conf.interval())
.deadline(conf.deadline()) .deadline(conf.deadline())
.max_payload_tasks(conf.max_payload_tasks()) .max_payload_tasks(conf.max_payload_tasks())
.extradata(conf.extradata_rlp_bytes()) .extradata(conf.extradata_bytes())
.max_gas_limit(conf.max_gas_limit()); .max_gas_limit(conf.max_gas_limit());
let payload_generator = EmptyBlockPayloadJobGenerator::with_builder( let payload_generator = EmptyBlockPayloadJobGenerator::with_builder(