Skip to content

Commit

Permalink
Merge branch 'develop' into fix/book-deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru authored Apr 6, 2021
2 parents 36f7c12 + 7160d48 commit dceca5f
Show file tree
Hide file tree
Showing 7 changed files with 937 additions and 124 deletions.
1 change: 1 addition & 0 deletions .github/actions/bitcoin-int-tests/Dockerfile.atlas-test
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ RUN ln -s /bitcoin-0.20.0/bin/bitcoind /bin/
ENV BITCOIND_TEST 1
WORKDIR /src/testnet/stacks-node
RUN cargo test -- --test-threads 1 --ignored tests::neon_integrations::atlas_integration_test
RUN cargo test -- --test-threads 1 --ignored tests::neon_integrations::atlas_stress_integration_test
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chainstate/stacks/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ impl StacksChainState {
.map_err(|e| e.into())
})
})
.expect("FATAL: `ust-liquid-supply` overflowed");
.expect("FATAL: `ustx-liquid-supply` overflowed");

clarity_tx.commit_to_block(&FIRST_BURNCHAIN_CONSENSUS_HASH, &FIRST_STACKS_BLOCK_HASH);
}
Expand Down
4 changes: 4 additions & 0 deletions src/chainstate/stacks/db/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ impl StacksChainState {
(Value::err_none(), AssetMap::new(), vec![])
}
ClarityRuntimeTxError::AbortedByCallback(value, assets, events) => {
info!("Contract-call aborted by post-condition";
"contract_name" => %contract_id,
"function_name" => %contract_call.function_name,
"function_args" => %VecDisplay(&contract_call.function_args));
let receipt = StacksTransactionReceipt::from_condition_aborted_contract_call(
tx.clone(),
events,
Expand Down
4 changes: 4 additions & 0 deletions testnet/stacks-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ warp = "0.2"
tokio = "0.2.21"
reqwest = { version = "0.10", features = ["blocking", "json", "rustls"] }

[dev-dependencies.rusqlite]
version = "=0.24.2"
features = ["blob", "serde_json", "i128_blob", "bundled", "trace"]

[[bin]]
name = "stacks-node"
path = "src/main.rs"
Expand Down
26 changes: 24 additions & 2 deletions testnet/stacks-node/src/syncctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,20 @@ impl PoxSyncWatchdog {
last_processed_height: u64,
burnchain_height: u64,
) -> bool {
last_processed_height + (burnchain.stable_confirmations as u64) < burnchain_height
let ibd =
last_processed_height + (burnchain.stable_confirmations as u64) < burnchain_height;
if ibd {
debug!(
"PoX watchdog: {} + {} < {}, so iniitial block download",
last_processed_height, burnchain.stable_confirmations, burnchain_height
);
} else {
debug!(
"PoX watchdog: {} + {} >= {}, so steady-state",
last_processed_height, burnchain.stable_confirmations, burnchain_height
);
}
ibd
}

/// Calculate the first derivative of a list of points
Expand Down Expand Up @@ -471,6 +484,11 @@ impl PoxSyncWatchdog {
}

if self.unconditionally_download {
debug!(
"PoX watchdog set to unconditionally download (ibd={})",
ibbd
);
self.relayer_comms.set_ibd(ibbd);
return Ok(ibbd);
}

Expand Down Expand Up @@ -502,10 +520,14 @@ impl PoxSyncWatchdog {
"PoX watchdog in last reward cycle -- sync after {} seconds",
self.steady_state_burnchain_sync_interval
);
self.relayer_comms.set_ibd(ibbd);

self.relayer_comms
.interruptable_sleep(self.steady_state_burnchain_sync_interval)?;
} else {
debug!("PoX watchdog in last reward cycle -- sync immediately");
self.relayer_comms.set_ibd(ibbd);
}
self.relayer_comms.set_ibd(ibbd);
return Ok(ibbd);
}

Expand Down
Loading

0 comments on commit dceca5f

Please sign in to comment.