Skip to content

Commit

Permalink
Don't use historical view during dry run (#2063)
Browse files Browse the repository at this point in the history
Due to race conditions dry run may fail with `InMemory` store. I
disabled the usage of the historical view for dry run case until the
future. #2062

### Before requesting review
- [x] I have reviewed the code myself
  • Loading branch information
xgreenx authored Aug 8, 2024
1 parent 8621cf8 commit 61d18e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Bug Fixes
- [2059](https://github.com/FuelLabs/fuel-core/pull/2059): Remove unwrap that is breaking backwards compatibility
- [2063](https://github.com/FuelLabs/fuel-core/pull/2063): Don't use historical view during dry run.

## [Version 0.32.0]

Expand Down
14 changes: 12 additions & 2 deletions crates/services/upgradable-executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,12 @@ where
gas_price,
};

let previous_block_height = block.header_to_produce.height().pred();
let previous_block_height = if !dry_run {
block.header_to_produce.height().pred()
} else {
// TODO: https://github.com/FuelLabs/fuel-core/issues/2062
None
};

let instance_without_input =
crate::instance::Instance::new(&self.engine).add_source(source)?;
Expand Down Expand Up @@ -560,7 +565,12 @@ where
where
TxSource: TransactionsSource + Send + Sync + 'static,
{
let previous_block_height = block.header_to_produce.height().pred();
let previous_block_height = if !dry_run {
block.header_to_produce.height().pred()
} else {
// TODO: https://github.com/FuelLabs/fuel-core/issues/2062
None
};
let relayer = self.relayer_view_provider.latest_view()?;

if let Some(previous_block_height) = previous_block_height {
Expand Down

0 comments on commit 61d18e6

Please sign in to comment.