Skip to content

Commit fddb5c5

Browse files
committed
Merge branch 'scroll' into chore-merge-upstream-1b08843bc
2 parents 63d156a + f4e17a7 commit fddb5c5

File tree

4 files changed

+16
-33
lines changed

4 files changed

+16
-33
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,14 @@ jobs:
274274
- uses: actions/checkout@v4
275275
- uses: dtolnay/rust-toolchain@master
276276
with:
277-
toolchain: nightly-2025-07-30
277+
toolchain: nightly-2025-08-18
278278
- uses: Swatinem/rust-cache@v2
279279
with:
280280
cache-on-failure: true
281-
- run: cargo install --locked --git https://github.com/openvm-org/openvm.git --tag v1.4.0-rc.2 cargo-openvm
281+
- run: cargo install --locked --git https://github.com/openvm-org/openvm.git --tag v1.4.0 cargo-openvm
282282
- name: verify openvm compatibility
283283
env:
284-
OPENVM_RUST_TOOLCHAIN: nightly-2025-07-30
284+
OPENVM_RUST_TOOLCHAIN: nightly-2025-08-18
285285
run: cargo openvm build --manifest-path crates/scroll/openvm-compat/Cargo.toml
286286

287287
lint-success:

crates/net/network/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ tracing.workspace = true
6767
rustc-hash.workspace = true
6868
thiserror.workspace = true
6969
parking_lot.workspace = true
70-
rand.workspace = true
7170
rand_08.workspace = true
7271
secp256k1 = { workspace = true, features = ["global-context", "std", "recovery"] }
7372
derive_more.workspace = true
@@ -95,6 +94,7 @@ alloy-genesis.workspace = true
9594
# misc
9695
url.workspace = true
9796
secp256k1 = { workspace = true, features = ["rand"] }
97+
rand.workspace = true
9898

9999
## Benchmarks
100100
criterion = { workspace = true, features = ["async_tokio", "html_reports"] }
@@ -113,7 +113,6 @@ serde = [
113113
"alloy-primitives/serde",
114114
"discv5/serde",
115115
"parking_lot/serde",
116-
"rand/serde",
117116
"smallvec/serde",
118117
"url/serde",
119118
"reth-primitives-traits/serde",
@@ -123,6 +122,7 @@ serde = [
123122
"reth-ethereum-primitives/serde",
124123
"reth-network-api/serde",
125124
"rand_08/serde",
125+
"rand/serde",
126126
"reth-storage-api/serde",
127127
]
128128
test-utils = [

crates/net/network/src/state.rs

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::{
1212
};
1313
use alloy_consensus::BlockHeader;
1414
use alloy_primitives::B256;
15-
use rand::seq::SliceRandom;
1615
use reth_eth_wire::{
1716
BlockHashNumber, Capabilities, DisconnectReason, EthNetworkPrimitives, NetworkPrimitives,
1817
NewBlockHashes, NewBlockPayload, UnifiedStatus,
@@ -192,21 +191,13 @@ impl<N: NetworkPrimitives> NetworkState<N> {
192191
///
193192
/// This is supposed to be invoked after the block was validated.
194193
///
195-
/// > It then sends the block to a small fraction of connected peers (usually the square root of
196-
/// > the total number of peers) using the `NewBlock` message.
194+
/// Note: Sends a `NewBlock` message to all of the connected peers. This is okay because this
195+
/// method is only used until we deprecate l2geth clients which don't support scroll-wire.
197196
///
198197
/// See also <https://github.com/ethereum/devp2p/blob/master/caps/eth.md>
199198
pub(crate) fn announce_new_block(&mut self, msg: NewBlockMessage<N::NewBlockPayload>) {
200-
// send a `NewBlock` message to a fraction of the connected peers (square root of the total
201-
// number of peers)
202-
let num_propagate = (self.active_peers.len() as f64).sqrt() as u64 + 1;
203-
204199
let number = msg.block.block().header().number();
205-
let mut count = 0;
206-
207-
// Shuffle to propagate to a random sample of peers on every block announcement
208-
let mut peers: Vec<_> = self.active_peers.iter_mut().collect();
209-
peers.shuffle(&mut rand::rng());
200+
let peers: Vec<_> = self.active_peers.iter_mut().collect();
210201

211202
for (peer_id, peer) in peers {
212203
if peer.blocks.contains(&msg.hash) {
@@ -215,24 +206,16 @@ impl<N: NetworkPrimitives> NetworkState<N> {
215206
}
216207

217208
// Queue a `NewBlock` message for the peer
218-
if count < num_propagate {
219-
self.queued_messages
220-
.push_back(StateAction::NewBlock { peer_id: *peer_id, block: msg.clone() });
221-
222-
// update peer block info
223-
if self.state_fetcher.update_peer_block(peer_id, msg.hash, number) {
224-
peer.best_hash = msg.hash;
225-
}
209+
self.queued_messages
210+
.push_back(StateAction::NewBlock { peer_id: *peer_id, block: msg.clone() });
226211

227-
// mark the block as seen by the peer
228-
peer.blocks.insert(msg.hash);
229-
230-
count += 1;
212+
// update peer block info
213+
if self.state_fetcher.update_peer_block(peer_id, msg.hash, number) {
214+
peer.best_hash = msg.hash;
231215
}
232216

233-
if count >= num_propagate {
234-
break
235-
}
217+
// mark the block as seen by the peer
218+
peer.blocks.insert(msg.hash);
236219
}
237220
}
238221

crates/scroll/openvm-compat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2024"
66
[workspace]
77

88
[dependencies]
9-
openvm = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.2.0", default-features = false }
9+
openvm = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
1010

1111
reth-chainspec = { path = "../../chainspec", default-features = false }
1212
reth-evm = { path = "../../evm/evm", default-features = false }

0 commit comments

Comments
 (0)