Skip to content

Commit 746421c

Browse files
authored
Bug, Full node crash with block execution error: Unexpected error from known Move function, 'block_prologue' (#1257)
1 parent c0c948f commit 746421c

File tree

11 files changed

+45
-64
lines changed

11 files changed

+45
-64
lines changed

Cargo.lock

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

docker/compose/movement-full-node/docker-compose.fullnode_setup.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
MAYBE_RUN_LOCAL: "false"
88
RUST_LOG: info,aws_sdk_s3=debug
99
MAPTOS_DA_SEQUENCER_CONNECTION_URL: ${MAPTOS_DA_SEQUENCER_CONNECTION_URL}
10+
MAPTOS_CHAIN_ID: ${MAPTOS_CHAIN_ID}
11+
MAPTOS_PRIVATE_KEY: ${MAPTOS_PRIVATE_KEY}
1012
volumes:
1113
- ${DOT_MOVEMENT_PATH}:/.movement
1214
# mount if exists

networks/movement/da-sequencer-node/Cargo.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

networks/movement/da-sequencer-node/bin/mock-da.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

networks/movement/da-sequencer-node/src/main.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

networks/movement/movement-client/src/bin/e2e/load_alice_bob.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,40 @@ impl BasicScenario {
4949
impl Scenario for BasicScenario {
5050
#[tracing::instrument(skip(self), fields(scenario = self.id))]
5151
async fn prepare(&mut self) -> Result<(), anyhow::Error> {
52+
info!(
53+
"Scenario:{} prepare start. NODE_URL:{} FAUCET_URL:{}",
54+
self.id,
55+
&NODE_URL.to_string(),
56+
&FAUCET_URL.to_string()
57+
);
58+
5259
let rest_client = Client::new(NODE_URL.clone());
5360
let faucet_client = FaucetClient::new(FAUCET_URL.clone(), NODE_URL.clone());
54-
let faucet_client = faucet_client.with_auth_token("notreal".to_string());
61+
//let faucet_client = faucet_client.with_auth_token("notreal".to_string());
5562

5663
if std::env::var_os("TEST_ALICE_BOB_ACCOUNT_READ_FROM_FILE").is_some() {
5764
//bob always 0. Only use to receive transfer.
5865
let (priv_key, address) = get_account_from_list(0)?;
5966
let sequence_number = match rest_client.get_account(address).await {
6067
Ok(response) => response.into_inner().sequence_number,
6168
Err(_) => {
62-
tracing::warn!("File private_key:{priv_key} not created, create it.");
69+
tracing::warn!("Bod account:{address} not created, create it.");
6370
faucet_client.fund(address, 100_000_000_000).await.unwrap();
71+
tracing::warn!("Bod account:{address} funded.");
6472
0
6573
}
6674
};
75+
info!(
76+
"Scenario:{} prepare. Bob Account:{address} sequence_number:{sequence_number}",
77+
self.id,
78+
);
6779
self.bob = Some(LocalAccount::new(address, priv_key, sequence_number));
6880
// Alice account is the scenario id + 1 (because bob is 0)
6981
let (priv_key, address) = get_account_from_list(self.id + 1)?;
7082
let sequence_number = match rest_client.get_account(address).await {
7183
Ok(response) => response.into_inner().sequence_number,
7284
Err(_) => {
73-
tracing::warn!("File private_key:{priv_key} not created, create it.");
85+
tracing::warn!("Alice account:{address} not created, create it.");
7486
faucet_client.fund(address, 100_000_000_000).await.unwrap();
7587
0
7688
}
@@ -127,6 +139,8 @@ impl Scenario for BasicScenario {
127139

128140
let mut sequence_number = alice.sequence_number();
129141

142+
info!("Scenario:{} Start sending transactions.", self.id,);
143+
130144
for index in 0..2 {
131145
// let _ = tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
132146
// Have Alice send Bob some more coins.
@@ -147,7 +161,7 @@ impl Scenario for BasicScenario {
147161

148162
sequence_number += 1;
149163

150-
// info!(scenario = %self.id, tx_hash = ?tx_hash, index = %index, "waiting for Alice -> Bod transfer to complete");
164+
info!(scenario = %self.id, tx_hash = ?tx_hash, index = %index, "waiting for Alice -> Bod transfer to complete");
151165

152166
rest_client
153167
.wait_for_transaction(&tx_hash)
@@ -156,6 +170,7 @@ impl Scenario for BasicScenario {
156170
anyhow::anyhow!("Alice Tx failed:{pending_tx:?} index:{index} because {err}")
157171
})
158172
.unwrap();
173+
info!("Scenario:{} Transaction executed.", self.id,);
159174
}
160175

161176
// Print final balances.

networks/movement/movement-full-node/src/backup/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl RestoreParam {
231231
]);
232232

233233
match push_pipe.pull(Some(syncador::Package::null())).await {
234-
Ok(package) => {
234+
Ok(_) => {
235235
tracing::info!("Files restored");
236236
}
237237
Err(err) => {

networks/movement/movement-full-node/src/node/manager.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Manager {
2020
}
2121

2222
pub async fn try_run(&self) -> Result<(), anyhow::Error> {
23-
let (stop_tx, mut stop_rx) = tokio::sync::watch::channel(());
23+
let (stop_tx, stop_rx) = tokio::sync::watch::channel(());
2424
tokio::spawn({
2525
let mut sigterm =
2626
signal(SignalKind::terminate()).context("can't register to SIGTERM.")?;
@@ -54,14 +54,6 @@ impl Manager {
5454

5555
let join_handle = tokio::spawn(node.run(mempool_commit_tx_receiver, stop_rx));
5656
join_handle.await??;
57-
// // Use tokio::select! to wait for either the handle or a cancellation signal
58-
// tokio::select! {
59-
// _ = stop_rx.changed() =>(),
60-
// // manage Movement node execution return.
61-
// res = join_handle => {
62-
// res??;
63-
// },
64-
// };
6557

6658
Ok(())
6759
}

networks/movement/movement-full-node/src/node/tasks/execute_settle.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,20 @@ where
245245
block_timestamp,
246246
block_retry_count,
247247
block_retry_increment_microseconds,
248-
)?;
248+
);
249+
250+
// Block must be added to da_db after execution otherwise if an error occurs,
251+
// the block will be reexecuted. Generating the error:
252+
// `Unexpected error from known Move function, 'block_prologue'. Error: ABORTED
253+
da_db
254+
.set_synced_height(da_block.height)
255+
.and_then(|_| da_db.add_executed_block(da_block.block_id.clone()))?;
256+
// Forward execution error after.
257+
let exec_result = exec_result?;
249258

250259
// decrement the number of transactions in flight on the executor
251260
executor.decrement_transactions_in_flight(transactions_count as u64);
252261

253-
da_db.set_synced_height(da_block.height)?;
254-
255-
// set the block as executed
256-
da_db.add_executed_block(da_block.block_id.clone())?;
257-
258262
Ok((Some(exec_result), executor))
259263
}
260264
})

networks/movement/setup/src/local.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ impl Local {
6464
config.execution_config.maptos_config.chain.maptos_db_path.replace(db_path);
6565

6666
// Set as main node that send state.
67-
config.execution_config.maptos_config.da_sequencer.propagate_execution_state = true;
67+
let local = std::env::var_os("MAYBE_RUN_LOCAL").unwrap_or("false".into());
68+
if local == "false" {
69+
config.execution_config.maptos_config.da_sequencer.propagate_execution_state = false;
70+
} else {
71+
config.execution_config.maptos_config.da_sequencer.propagate_execution_state = true;
72+
}
6873

6974
// write the maptos signer address to the default signer address whitelist
7075
let default_signer_address_whitelist_path =
@@ -84,7 +89,12 @@ impl Local {
8489
mut config: movement_config::Config,
8590
) -> Result<movement_config::Config, anyhow::Error> {
8691
// Allow Da sync from Height zero
87-
config.da_db.allow_sync_from_zero = true;
92+
let local = std::env::var_os("MAYBE_RUN_LOCAL").unwrap_or("false".into());
93+
if local == "false" {
94+
config.da_db.allow_sync_from_zero = false;
95+
} else {
96+
config.da_db.allow_sync_from_zero = true;
97+
}
8898
// update the db path
8999
let db_path = dot_movement.get_path().join(config.da_db.da_db_path.clone());
90100
config.da_db.da_db_path = db_path

0 commit comments

Comments
 (0)