Skip to content

Commit 480bac4

Browse files
committed
fix(node/web): state machine time drifting from actual time
1 parent 80593e2 commit 480bac4

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
rustup default nightly
117117
rustup component add rustfmt rust-src
118118
rustup target add wasm32-unknown-unknown
119-
cargo install -f wasm-bindgen-cli --version 0.2.93
119+
cargo install -f wasm-bindgen-cli --version 0.2.95
120120
121121
- name: Setup Rust Cache
122122
uses: Swatinem/rust-cache@v2

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ poly-commitment = {git = "https://github.com/openmina/proof-systems", rev = "2fd
4848
libp2p = { git = "https://github.com/openmina/rust-libp2p", rev = "5c44c7d9", default-features = false }
4949
vrf = { path = "vrf" }
5050
openmina-node-account = { path = "node/account" }
51-
redux = { git = "https://github.com/openmina/redux-rs.git", rev = "75d4d1d9", features = ["serde"] }
51+
redux = { git = "https://github.com/openmina/redux-rs.git", rev = "bf0726e5", features = ["serde"] }
5252
serde = "1.0.190"
5353
serde_json = "1.0.107"
5454
serde_with = { version = "3.7.0", features = ["hex"] }

frontend/src/app/core/services/web-node.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export class WebNodeService {
4444
tap((webnode: any) => {
4545
console.log('----------------WEBNODE----------------');
4646
console.log(webnode);
47+
(window as any)["webnode"] = webnode;
4748
this.webnode$.next(webnode);
4849
}),
4950
switchMap(() => this.webnode$.asObservable()),

node/src/snark_pool/snark_pool_actions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub enum SnarkPoolAction {
3838
},
3939
#[action_event(level = trace)]
4040
P2pSendAll,
41+
#[action_event(level = trace)]
4142
P2pSend {
4243
peer_id: PeerId,
4344
},

node/web/src/node/builder.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ impl NodeBuilder {
207207
anyhow::anyhow!("transaction verifier index not set on the node builder!")
208208
})?;
209209

210-
let initial_time = self
211-
.custom_initial_time
212-
.unwrap_or_else(redux::Timestamp::global_now);
213-
214210
let transition_frontier = TransitionFrontierConfig::new(self.genesis_config);
215211

216212
let protocol_constants = transition_frontier.genesis.protocol_constants()?;
@@ -235,9 +231,7 @@ impl NodeBuilder {
235231
enabled_channels: ChannelId::iter_all().collect(),
236232
peer_discovery: !self.p2p_no_discovery,
237233
meshsub: P2pMeshsubConfig {
238-
initial_time: initial_time
239-
.checked_sub(redux::Timestamp::ZERO)
240-
.unwrap_or_default(),
234+
initial_time: Duration::ZERO,
241235
..Default::default()
242236
},
243237
timeouts: P2pTimeouts::default(),
@@ -268,6 +262,10 @@ impl NodeBuilder {
268262
}
269263

270264
let service = service.build()?;
265+
266+
let initial_time = self
267+
.custom_initial_time
268+
.unwrap_or_else(redux::Timestamp::global_now);
271269
let state = node::State::new(node_config, &consensus_consts, initial_time);
272270

273271
Ok(Node::new(self.rng_seed, state, service, None))

0 commit comments

Comments
 (0)