Skip to content

Commit

Permalink
fix config time and update checkpoint (#949)
Browse files Browse the repository at this point in the history
* fix config time

* update checkpoint

* remove print
  • Loading branch information
shaorongqiang authored Apr 27, 2023
1 parent 322787b commit 3ccb850
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/abciapp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ hex = "0.4.2"
ctrlc = { version = "3.0", features = ["termination"] }
protobuf = "2.16"
toml = "0.5.8"

regex = "1"
clap = "2.33.3"

actix-cors = "0.5.4"
Expand Down
36 changes: 36 additions & 0 deletions src/components/abciapp/src/bins/findorad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use {
sys::signal::{kill, Signal},
unistd::{truncate, Pid},
},
regex::Regex,
ruc::*,
std::{
convert::TryFrom,
Expand Down Expand Up @@ -114,6 +115,41 @@ fn node_command() -> Result<()> {
return Ok(());
}

{
let src_cfg = [
"timeout_propose = \"\\d{1,2}s\"",
"timeout_propose_delta = \"\\d+ms\"",
"timeout_prevote = \"\\d{1,2}s\"",
"timeout_prevote_delta = \"\\d+ms\"",
"timeout_precommit = \"\\d{1,2}s\"",
"timeout_precommit_delta = \"\\d+ms\"",
"timeout_commit = \"\\d{1,2}s\"",
];

let target_cfg = [
"timeout_propose = \"3s\"",
"timeout_propose_delta = \"500ms\"",
"timeout_prevote = \"1s\"",
"timeout_prevote_delta = \"500ms\"",
"timeout_precommit = \"1s\"",
"timeout_precommit_delta = \"500ms\"",
"timeout_commit = \"15s\"",
];
let path = format!("{}/config/config.toml", CFG.tendermint_home);
fs::read_to_string(&path)
.and_then(|config| {
let cfg = src_cfg.iter().zip(target_cfg.iter()).fold(
config,
|acc, (src, target)| {
let re = Regex::new(src).unwrap();
acc.replace(re.find(&acc).unwrap().as_str(), target)
},
);
fs::write(path, cfg)
})
.unwrap();
}

let mut tendermint = Command::new(format!("/tmp/tendermint_{}", *SUFFIX));

tendermint
Expand Down
14 changes: 7 additions & 7 deletions src/components/config/src/abci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,16 @@ lazy_static! {
evm_substate_v2_height: 3351349,
disable_delegate_frc20: 3401450,
fix_exec_code: 3401450,
check_signatures_num: 4033522,
fix_deliver_tx_revert_nonce_height: 4033522,
utxo_asset_prefix_height: 4033522,
prismxx_inital_height: 4033522,
check_signatures_num: 4004430,
fix_deliver_tx_revert_nonce_height: 4004430,
utxo_asset_prefix_height: 4004430,
prismxx_inital_height: 4004430,
prism_bridge_address: "0x4672372fDB139B7295Fc59b55b43EC5fF2761A0b".to_owned(),
remove_fake_staking_hash: 4033522,
fix_check_replay: 4033522,
remove_fake_staking_hash: 4004430,
fix_check_replay: 4004430,
fns_registry: "0x57e8782c2f77B99823EeA48aCE3Eb7635F0B35F9".to_owned(),
lowlevel_data_min: 3971239,
lowlevel_data_max: 4033522,
lowlevel_data_max: 4004430,
};
}

Expand Down

0 comments on commit 3ccb850

Please sign in to comment.