Skip to content

Commit e82ef2d

Browse files
feat(ethexe): bump foundry toolchain, add configurable gas, use only EIP-7594 txs (#5263)
1 parent c138699 commit e82ef2d

File tree

6 files changed

+32
-15
lines changed

6 files changed

+32
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
- name: "Install: Foundry"
284284
uses: foundry-rs/foundry-toolchain@v1
285285
with:
286-
version: v1.5.1
286+
version: nightly-c07d504b4ae67754584f4e05ff0c547a43c50f7b
287287

288288
- name: "Show: Versioning"
289289
run: |

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: "Install: Foundry"
6666
uses: foundry-rs/foundry-toolchain@v1
6767
with:
68-
version: v1.5.1
68+
version: nightly-c07d504b4ae67754584f4e05ff0c547a43c50f7b
6969

7070
- name: "Install: Node.js"
7171
uses: actions/setup-node@v4

ethexe/cli/src/commands/tx.rs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ pub struct TxCommand {
219219
#[arg(long, alias = "eth-router")]
220220
pub ethereum_router: Option<Address>,
221221

222+
/// Ethereum EIP-1559 fee increase percentage (from "medium").
223+
#[arg(long, alias = "eth-eip1559-fee-increase-percentage")]
224+
pub eip1559_fee_increase_percentage: Option<u64>,
225+
226+
/// Ethereum blob gas multiplier.
227+
#[arg(long, alias = "eth-blob-gas-multiplier")]
228+
pub blob_gas_multiplier: Option<u128>,
229+
222230
/// Sender address or public key to use. Must have a corresponding private key in the key store.
223231
#[arg(long)]
224232
pub sender: Option<Address>,
@@ -248,6 +256,19 @@ impl TxCommand {
248256
.take()
249257
.or_else(|| params.ethereum.as_ref().and_then(|p| p.ethereum_router));
250258

259+
self.eip1559_fee_increase_percentage =
260+
self.eip1559_fee_increase_percentage.take().or_else(|| {
261+
params
262+
.ethereum
263+
.as_ref()
264+
.and_then(|p| p.eip1559_fee_increase_percentage)
265+
});
266+
267+
self.blob_gas_multiplier = self
268+
.blob_gas_multiplier
269+
.take()
270+
.or_else(|| params.ethereum.as_ref().and_then(|p| p.blob_gas_multiplier));
271+
251272
self
252273
}
253274

@@ -277,14 +298,15 @@ impl TxCommand {
277298

278299
let sender = self.sender.ok_or_else(|| anyhow!("missing `sender`"))?;
279300

280-
// INCREASED_BLOB_GAS_MULTIPLIER (TODO: from config, default is increased)
281301
let ethereum = Ethereum::new(
282302
&rpc,
283303
router_addr,
284304
signer.clone(),
285305
sender,
286-
NO_EIP1559_FEE_INCREASE_PERCENTAGE,
287-
INCREASED_BLOB_GAS_MULTIPLIER,
306+
self.eip1559_fee_increase_percentage
307+
.unwrap_or(NO_EIP1559_FEE_INCREASE_PERCENTAGE),
308+
self.blob_gas_multiplier
309+
.unwrap_or(INCREASED_BLOB_GAS_MULTIPLIER),
288310
)
289311
.await
290312
.with_context(|| "failed to create Ethereum client")?;

ethexe/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ homepage.workspace = true
88
repository.workspace = true
99

1010
[dependencies]
11-
alloy-primitives.workspace = true
11+
alloy-primitives = { workspace = true, features = ["serde"] }
1212
gear-core.workspace = true
1313
sp-core.workspace = true
1414
gprimitives.workspace = true

ethexe/common/src/injected.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ mod serde_hex {
214214
where
215215
S: serde::Serializer,
216216
{
217-
alloy_primitives::hex::serialize(data.to_vec(), serializer)
217+
alloy_primitives::serde_hex::serialize(data.to_vec(), serializer)
218218
}
219219

220220
pub fn deserialize<'de, D, const N: usize>(
@@ -223,7 +223,7 @@ mod serde_hex {
223223
where
224224
D: serde::Deserializer<'de>,
225225
{
226-
let vec: Vec<u8> = alloy_primitives::hex::deserialize(deserializer)?;
226+
let vec: Vec<u8> = alloy_primitives::serde_hex::deserialize(deserializer)?;
227227
super::LimitedVec::<u8, N>::try_from(vec)
228228
.map_err(|_| serde::de::Error::custom("LimitedVec deserialization overflow"))
229229
}

ethexe/ethereum/src/router/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,11 @@ impl Router {
143143
) -> Result<(TransactionReceipt, CodeId)> {
144144
let code_id = CodeId::generate(code);
145145

146-
let chain_id = self.instance.provider().get_chain_id().await?;
147146
let builder = self
148147
.instance
149148
.requestCodeValidation(code_id.into_bytes().into());
150-
let builder = if chain_id == 31337 {
151-
// TODO: remove when https://github.com/foundry-rs/foundry/pull/12404 is merged
152-
builder.sidecar(SidecarBuilder::<SimpleCoder>::from_slice(code).build()?)
153-
} else {
154-
builder.sidecar_7594(SidecarBuilder::<SimpleCoder>::from_slice(code).build_7594()?)
155-
};
149+
let builder =
150+
builder.sidecar_7594(SidecarBuilder::<SimpleCoder>::from_slice(code).build_7594()?);
156151

157152
let receipt = builder
158153
.send()

0 commit comments

Comments
 (0)