bug(stages): ExecutionStage incremented TranstionId to often (#952)

This commit is contained in:
rakita
2023-01-21 11:31:14 +01:00
committed by GitHub
parent f2ed6e2bbe
commit e3271dafbe
2 changed files with 11 additions and 11 deletions

18
Cargo.lock generated
View File

@@ -446,12 +446,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "build_const"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7"
[[package]]
name = "bumpalo"
version = "3.11.1"
@@ -834,13 +828,19 @@ dependencies = [
[[package]]
name = "crc"
version = "1.8.1"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3"
dependencies = [
"build_const",
"crc-catalog",
]
[[package]]
name = "crc-catalog"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484"
[[package]]
name = "criterion"
version = "0.4.0"

View File

@@ -251,7 +251,6 @@ impl<DB: Database> Stage<DB> for ExecutionStage {
)?;
}
}
current_transition_id += 1;
}
// insert bytecode
for (hash, bytecode) in result.new_bytecodes.into_iter() {
@@ -264,6 +263,7 @@ impl<DB: Database> Stage<DB> for ExecutionStage {
// NOTE: bytecode bytes are not inserted in change set and can be found in
// separate table
}
current_transition_id += 1;
}
// If there is block reward we will add account changeset to db
@@ -482,7 +482,7 @@ mod tests {
let state_db = create_test_db::<WriteMap>(EnvKind::RW);
let mut tx = Transaction::new(state_db.as_ref()).unwrap();
let input = ExecInput {
previous_stage: None,
previous_stage: Some((PREV_STAGE_ID, 1)),
/// The progress of this stage the last time it was executed.
stage_progress: None,
};