Skip to content
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

optimism: use op-alloy TxDeposit #10667

Merged
merged 14 commits into from
Sep 5, 2024
88 changes: 52 additions & 36 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,10 @@ alloy-transport-ipc = { version = "0.3.1", default-features = false }
alloy-transport-ws = { version = "0.3.1", default-features = false }

# op
op-alloy-rpc-types = "0.2.5"
op-alloy-rpc-types-engine = "0.2"
op-alloy-network = "0.2"
op-alloy-rpc-types = "0.2.8"
op-alloy-rpc-types-engine = "0.2.8"
op-alloy-network = "0.2.8"
op-alloy-consensus = "0.2.8"

# misc
aquamarine = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ mod tests {
to: TxKind::Create,
mint: None,
value: U256::ZERO,
gas_limit: 0u64,
gas_limit: 0,
is_system_transaction: false,
input: Default::default(),
});
Expand Down
3 changes: 3 additions & 0 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ alloy-eips = { workspace = true, features = ["serde"] }

# optimism
op-alloy-rpc-types = { workspace = true, optional = true }
op-alloy-consensus = { workspace = true, features = ["arbitrary"], optional = true }

# crypto
secp256k1 = { workspace = true, features = [
Expand Down Expand Up @@ -105,7 +106,9 @@ optimism = [
"reth-chainspec/optimism",
"reth-ethereum-forks/optimism",
"revm-primitives/optimism",
"reth-codecs?/optimism",
"dep:reth-optimism-chainspec",
"dep:op-alloy-consensus",
]
alloy-compat = ["reth-primitives-traits/alloy-compat", "dep:alloy-rpc-types", "dep:alloy-serde", "dep:op-alloy-rpc-types"]
test-utils = ["reth-primitives-traits/test-utils"]
Expand Down
5 changes: 1 addition & 4 deletions crates/primitives/src/alloy_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ impl TryFrom<WithOtherFields<alloy_rpc_types::Transaction>> for Transaction {
to: TxKind::from(tx.to),
mint: fields.mint.filter(|n| *n != 0),
value: tx.value,
gas_limit: tx
.gas
.try_into()
.map_err(|_| ConversionError::Eip2718Error(RlpError::Overflow.into()))?,
gas_limit: tx.gas,
is_system_transaction: fields.is_system_tx.unwrap_or(false),
input: tx.input,
}))
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/transaction/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl FillTxEnv for TransactionSigned {
#[cfg(feature = "optimism")]
Transaction::Deposit(tx) => {
tx_env.access_list.clear();
tx_env.gas_limit = tx.gas_limit;
tx_env.gas_limit = tx.gas_limit as u64;
tx_env.gas_price = U256::ZERO;
tx_env.gas_priority_fee = None;
tx_env.transact_to = tx.to;
Expand Down
Loading
Loading