Skip to content

Commit 4271872

Browse files
authored
feat: feynman ts sepolia (#284)
1 parent aad1706 commit 4271872

10 files changed

Lines changed: 37 additions & 44 deletions

File tree

crates/engine/tree/src/tree/mod.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,18 +1207,18 @@ where
12071207
debug!(target: "engine::tree", "received backfill sync finished event");
12081208
self.backfill_sync_state = BackfillSyncState::Idle;
12091209

1210-
// backfill height is the block number that the backfill finished at
1211-
let mut backfill_height = ctrl.block_number();
1212-
12131210
// Pipeline unwound, memorize the invalid block and wait for CL for next sync target.
1214-
if let ControlFlow::Unwind { bad_block, target } = &ctrl {
1211+
let backfill_height = if let ControlFlow::Unwind { bad_block, target } = &ctrl {
12151212
warn!(target: "engine::tree", invalid_block=?bad_block, "Bad block detected in unwind");
12161213
// update the `invalid_headers` cache with the new invalid header
12171214
self.state.invalid_headers.insert(**bad_block);
12181215

12191216
// if this was an unwind then the target is the new height
1220-
backfill_height = Some(*target);
1221-
}
1217+
Some(*target)
1218+
} else {
1219+
// backfill height is the block number that the backfill finished at
1220+
ctrl.block_number()
1221+
};
12221222

12231223
// backfill height is the block number that the backfill finished at
12241224
let Some(backfill_height) = backfill_height else { return Ok(()) };
@@ -1780,20 +1780,18 @@ where
17801780
) -> Option<B256> {
17811781
let sync_target_state = self.state.forkchoice_state_tracker.sync_target_state();
17821782

1783-
// check if the distance exceeds the threshold for backfill sync
1784-
let mut exceeds_backfill_threshold =
1785-
self.exceeds_backfill_run_threshold(canonical_tip_num, target_block_number);
1786-
17871783
// check if the downloaded block is the tracked finalized block
1788-
if let Some(buffered_finalized) = sync_target_state
1784+
let mut exceeds_backfill_threshold = if let Some(buffered_finalized) = sync_target_state
17891785
.as_ref()
17901786
.and_then(|state| self.state.buffer.block(&state.finalized_block_hash))
17911787
{
17921788
// if we have buffered the finalized block, we should check how far
17931789
// we're off
1794-
exceeds_backfill_threshold =
1795-
self.exceeds_backfill_run_threshold(canonical_tip_num, buffered_finalized.number());
1796-
}
1790+
self.exceeds_backfill_run_threshold(canonical_tip_num, buffered_finalized.number())
1791+
} else {
1792+
// check if the distance exceeds the threshold for backfill sync
1793+
self.exceeds_backfill_run_threshold(canonical_tip_num, target_block_number)
1794+
};
17971795

17981796
// If this is invoked after we downloaded a block we can check if this block is the
17991797
// finalized block

crates/net/network/src/manager.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,20 +842,20 @@ impl<N: NetworkPrimitives> NetworkManager<N> {
842842
"Session disconnected"
843843
);
844844

845-
let mut reason = None;
846-
if let Some(ref err) = error {
845+
let reason = if let Some(ref err) = error {
847846
// If the connection was closed due to an error, we report
848847
// the peer
849848
self.swarm.state_mut().peers_mut().on_active_session_dropped(
850849
&remote_addr,
851850
&peer_id,
852851
err,
853852
);
854-
reason = err.as_disconnected();
853+
err.as_disconnected()
855854
} else {
856855
// Gracefully disconnected
857856
self.swarm.state_mut().peers_mut().on_active_session_gracefully_closed(peer_id);
858-
}
857+
None
858+
};
859859
self.metrics.closed_sessions.increment(1);
860860
self.update_active_connection_metrics();
861861

crates/rpc/rpc-builder/src/auth.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@ impl AuthServerConfig {
6868
.map_err(|err| RpcError::server_error(err, ServerKind::Auth(socket_addr)))?;
6969

7070
let handle = server.start(module.inner.clone());
71-
let mut ipc_handle: Option<jsonrpsee::server::ServerHandle> = None;
7271

73-
if let Some(ipc_server_config) = ipc_server_config {
72+
let ipc_handle = if let Some(ipc_server_config) = ipc_server_config {
7473
let ipc_endpoint_str = ipc_endpoint
7574
.clone()
7675
.unwrap_or_else(|| constants::DEFAULT_ENGINE_API_IPC_ENDPOINT.to_string());
7776
let ipc_server = ipc_server_config.build(ipc_endpoint_str);
7877
let res = ipc_server.start(module.inner).await?;
79-
ipc_handle = Some(res);
80-
}
78+
Some(res)
79+
} else {
80+
None
81+
};
8182

8283
Ok(AuthServerHandle { handle: Some(handle), local_addr, secret, ipc_endpoint, ipc_handle })
8384
}

crates/rpc/rpc-eth-api/src/helpers/state.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,15 @@ pub trait LoadState:
277277
{
278278
self.spawn_blocking_io(move |this| {
279279
// first fetch the on chain nonce of the account
280-
let on_chain_account_nonce = this
280+
let mut next_nonce = this
281281
.latest_state()?
282282
.account_nonce(&address)
283283
.map_err(Self::Error::from_eth_err)?
284284
.unwrap_or_default();
285285

286-
let mut next_nonce = on_chain_account_nonce;
287286
// Retrieve the highest consecutive transaction for the sender from the transaction pool
288-
if let Some(highest_tx) = this
289-
.pool()
290-
.get_highest_consecutive_transaction_by_sender(address, on_chain_account_nonce)
287+
if let Some(highest_tx) =
288+
this.pool().get_highest_consecutive_transaction_by_sender(address, next_nonce)
291289
{
292290
// Return the nonce of the highest consecutive transaction + 1
293291
next_nonce = highest_tx.nonce().checked_add(1).ok_or_else(|| {

crates/scroll/alloy/hardforks/src/hardfork.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ impl ScrollHardfork {
5151
(Self::DarwinV2, ForkCondition::Timestamp(1724832000)),
5252
(Self::Euclid, ForkCondition::Timestamp(1741680000)),
5353
(Self::EuclidV2, ForkCondition::Timestamp(1741852800)),
54-
// TODO: update
55-
(Self::Feynman, ForkCondition::Timestamp(u64::MAX)),
54+
(Self::Feynman, ForkCondition::Timestamp(1753167600)),
5655
]
5756
}
5857
}

crates/scroll/chainspec/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ mod tests {
598598
),
599599
(
600600
Head { number: 4740239, timestamp: 1741852800, ..Default::default() },
601-
ForkId { hash: ForkHash([0x51, 0x7e, 0x0f, 0x1c]), next: 18446744073709551615 },
601+
ForkId { hash: ForkHash([0x51, 0x7e, 0x0f, 0x1c]), next: 1753167600 },
602602
),
603603
(
604-
Head { number: 4740239, timestamp: 18446744073709551615, ..Default::default() },
605-
ForkId { hash: ForkHash([0xc8, 0x43, 0x01, 0x5b]), next: 0 },
604+
Head { number: 4740239, timestamp: 1753167600, ..Default::default() },
605+
ForkId { hash: ForkHash([0x19, 0xbb, 0x92, 0xc6]), next: 0 },
606606
),
607607
],
608608
);

crates/scroll/hardforks/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ pub static SCROLL_SEPOLIA_HARDFORKS: LazyLock<ChainHardforks> = LazyLock::new(||
6464
(ScrollHardfork::DarwinV2.boxed(), ForkCondition::Timestamp(1724832000)),
6565
(ScrollHardfork::Euclid.boxed(), ForkCondition::Timestamp(1741680000)),
6666
(ScrollHardfork::EuclidV2.boxed(), ForkCondition::Timestamp(1741852800)),
67-
// TODO: update
68-
(ScrollHardfork::Feynman.boxed(), ForkCondition::Timestamp(u64::MAX)),
67+
(ScrollHardfork::Feynman.boxed(), ForkCondition::Timestamp(1753167600)),
6968
])
7069
});
7170

crates/storage/db-models/src/accounts.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ impl reth_codecs::Compact for AccountBeforeTx {
2727
// for now put full bytes and later compress it.
2828
buf.put_slice(self.address.as_slice());
2929

30-
let mut acc_len = 0;
31-
if let Some(account) = self.info {
32-
acc_len = account.to_compact(buf);
33-
}
30+
let acc_len = if let Some(account) = self.info { account.to_compact(buf) } else { 0 };
3431
acc_len + 20
3532
}
3633

crates/transaction-pool/src/pool/txpool.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,11 +1354,9 @@ impl<T: PoolTransaction> AllTransactions<T> {
13541354
}
13551355
};
13561356
}
1357-
// tracks the balance if the sender was changed in the block
1358-
let mut changed_balance = None;
1359-
1357+
// track the balance if the sender was changed in the block
13601358
// check if this is a changed account
1361-
if let Some(info) = changed_accounts.get(&id.sender) {
1359+
let changed_balance = if let Some(info) = changed_accounts.get(&id.sender) {
13621360
// discard all transactions with a nonce lower than the current state nonce
13631361
if id.nonce < info.state_nonce {
13641362
updates.push(PoolUpdate {
@@ -1384,8 +1382,10 @@ impl<T: PoolTransaction> AllTransactions<T> {
13841382
}
13851383
}
13861384

1387-
changed_balance = Some(&info.balance);
1388-
}
1385+
Some(&info.balance)
1386+
} else {
1387+
None
1388+
};
13891389

13901390
// If there's a nonce gap, we can shortcircuit, because there's nothing to update yet.
13911391
if tx.state.has_nonce_gap() {

crates/trie/common/benches/prefix_set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ mod implementations {
292292
}
293293

294294
#[derive(Default)]
295+
#[allow(dead_code)]
295296
pub struct VecBinarySearchWithLastFoundPrefixSet {
296297
keys: Vec<Nibbles>,
297298
last_found_idx: usize,

0 commit comments

Comments
 (0)