Skip to content

Commit

Permalink
mirror: don't require an archival dir for the traffic generator (near…
Browse files Browse the repository at this point in the history
…#12559)

The reason this was done originally was to make sure we apply all chunks
so that in `on_target_block()` we can look through all the outcomes and
keep track of how many of our txs made it on chain, and so that we can
figure out what unstake actions need to be sent to undo stakes that came
from staking pool contract calls. The first one is just best effort
anyway, and the second one won't even be that relevant in the case where
the traffic generator is offline for several epochs and state syncs,
since by that time it will be too late to unstake them. So just remove
this check and don't make the traffic generator an archival node
  • Loading branch information
marcelo-gonzalez authored Dec 6, 2024
1 parent 80d8e2c commit feb8393
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions pytest/tests/mocknet/helpers/neard_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@ def neard_init(self, rpc_port, protocol_port, validator_id):
config['consensus']['min_block_production_delay']['nanos'] = 300000000
config['consensus']['max_block_production_delay']['secs'] = 3
config['consensus']['max_block_production_delay']['nanos'] = 0
if self.is_traffic_generator():
config['archive'] = True
with open(self.tmp_near_home_path('config.json'), 'w') as f:
json.dump(config, f, indent=2)

Expand Down
7 changes: 0 additions & 7 deletions tools/mirror/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,6 @@ impl<T: ChainAccess> TxMirror<T> {
let target_config =
nearcore::config::load_config(target_home, GenesisValidationMode::UnsafeFast)
.with_context(|| format!("Error loading target config from {:?}", target_home))?;
if !target_config.client_config.archive {
// this is probably not going to come up, but we want to avoid a situation where
// we go offline for a long time and then come back online, and we state sync to
// the head of the target chain without looking for our outcomes that made it on
// chain right before we went offline
anyhow::bail!("config file in {} has archive: false, but archive must be set to true for the target chain", target_home.display());
}
let db = match mirror_db_path {
Some(mirror_db_path) => open_db(mirror_db_path),
None => {
Expand Down

0 comments on commit feb8393

Please sign in to comment.