Skip to content

Commit 0f65ea4

Browse files
authored
Merge branch 'develop' into fix/backoff-err-5092
2 parents 128735e + 4dc2902 commit 0f65ea4

File tree

36 files changed

+2155
-1380
lines changed

36 files changed

+2155
-1380
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ jobs:
105105
- tests::signer::v0::locally_rejected_blocks_overriden_by_global_acceptance
106106
- tests::signer::v0::reorg_locally_accepted_blocks_across_tenures_succeeds
107107
- tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occurs
108+
- tests::signer::v0::multiple_miners_with_nakamoto_blocks
109+
- tests::signer::v0::partial_tenure_fork
110+
- tests::signer::v0::mine_2_nakamoto_reward_cycles
111+
- tests::signer::v0::signer_set_rollover
108112
- tests::nakamoto_integrations::stack_stx_burn_op_integration_test
109113
- tests::nakamoto_integrations::check_block_heights
110114
- tests::nakamoto_integrations::clarity_burn_state
@@ -117,10 +121,6 @@ jobs:
117121
- tests::nakamoto_integrations::follower_bootup_across_multiple_cycles
118122
- tests::nakamoto_integrations::utxo_check_on_startup_panic
119123
- tests::nakamoto_integrations::utxo_check_on_startup_recover
120-
- tests::signer::v0::multiple_miners_with_nakamoto_blocks
121-
- tests::signer::v0::partial_tenure_fork
122-
- tests::signer::v0::mine_2_nakamoto_reward_cycles
123-
- tests::signer::v0::signer_set_rollover
124124
# Do not run this one until we figure out why it fails in CI
125125
# - tests::neon_integrations::bitcoin_reorg_flap
126126
# - tests::neon_integrations::bitcoin_reorg_flap_with_follower

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,29 @@ jobs:
186186
- check-release
187187
uses: ./.github/workflows/bitcoin-tests.yml
188188

189+
190+
p2p-tests:
191+
if: |
192+
needs.check-release.outputs.is_release == 'true' || (
193+
github.event_name == 'workflow_dispatch' ||
194+
github.event_name == 'pull_request' ||
195+
github.event_name == 'merge_group' ||
196+
(
197+
contains('
198+
refs/heads/master
199+
refs/heads/develop
200+
refs/heads/next
201+
', github.event.pull_request.head.ref) &&
202+
github.event_name == 'push'
203+
)
204+
)
205+
name: P2P Tests
206+
needs:
207+
- rustfmt
208+
- create-cache
209+
- check-release
210+
uses: ./.github/workflows/p2p-tests.yml
211+
189212
## Test to run on a tagged release
190213
##
191214
## Runs when:

.github/workflows/p2p-tests.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
## Github workflow to run p2p tests
2+
3+
name: Tests::P2P
4+
5+
on:
6+
workflow_call:
7+
8+
## env vars are transferred to composite action steps
9+
env:
10+
BITCOIND_TEST: 0
11+
RUST_BACKTRACE: full
12+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 15
13+
TEST_TIMEOUT: 30
14+
15+
concurrency:
16+
group: stackslib-tests-${{ github.head_ref || github.ref || github.run_id}}
17+
## Only cancel in progress if this is for a PR
18+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19+
20+
jobs:
21+
# p2p integration tests with code coverage
22+
integration-tests:
23+
name: Integration Tests
24+
runs-on: ubuntu-latest
25+
strategy:
26+
## Continue with the test matrix even if we've had a failure
27+
fail-fast: false
28+
## Run a maximum of 32 concurrent tests from the test matrix
29+
max-parallel: 32
30+
matrix:
31+
test-name:
32+
- net::tests::convergence::test_walk_ring_allow_15
33+
- net::tests::convergence::test_walk_ring_15_plain
34+
- net::tests::convergence::test_walk_ring_15_pingback
35+
- net::tests::convergence::test_walk_ring_15_org_biased
36+
- net::tests::convergence::test_walk_line_allowed_15
37+
- net::tests::convergence::test_walk_line_15_plain
38+
- net::tests::convergence::test_walk_line_15_org_biased
39+
- net::tests::convergence::test_walk_line_15_pingback
40+
- net::tests::convergence::test_walk_star_allowed_15
41+
- net::tests::convergence::test_walk_star_15_plain
42+
- net::tests::convergence::test_walk_star_15_pingback
43+
- net::tests::convergence::test_walk_star_15_org_biased
44+
- net::tests::convergence::test_walk_inbound_line_15
45+
steps:
46+
## Setup test environment
47+
- name: Setup Test Environment
48+
id: setup_tests
49+
uses: stacks-network/actions/stacks-core/testenv@main
50+
with:
51+
btc-version: "25.0"
52+
53+
## Increase open file descriptors limit
54+
- name: Increase Open File Descriptors
55+
run: |
56+
sudo prlimit --nofile=4096:4096
57+
58+
## Run test matrix using restored cache of archive file
59+
## - Test will timeout after env.TEST_TIMEOUT minutes
60+
- name: Run Tests
61+
id: run_tests
62+
timeout-minutes: ${{ fromJSON(env.TEST_TIMEOUT) }}
63+
uses: stacks-network/actions/stacks-core/run-tests@main
64+
with:
65+
test-name: ${{ matrix.test-name }}
66+
threads: 1
67+
68+
## Create and upload code coverage file
69+
- name: Code Coverage
70+
id: codecov
71+
uses: stacks-network/actions/codecov@main
72+
with:
73+
test-name: ${{ matrix.test-name }}
74+
75+
check-tests:
76+
name: Check Tests
77+
runs-on: ubuntu-latest
78+
if: always()
79+
needs:
80+
- integration-tests
81+
steps:
82+
- name: Check Tests Status
83+
id: check_tests_status
84+
uses: stacks-network/actions/check-jobs-status@main
85+
with:
86+
jobs: ${{ toJson(needs) }}
87+
summary_print: "true"

.github/workflows/standalone-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- Atlas Tests
2222
- Bitcoin Tests
2323
- Epoch Tests
24+
- P2P Tests
2425
- Slow Tests
2526
- Stacks-Core Tests
2627
- SBTC Tests
@@ -69,6 +70,23 @@ jobs:
6970
- create-cache
7071
uses: ./.github/workflows/bitcoin-tests.yml
7172

73+
## Runs when:
74+
## either or of the following:
75+
## - workflow is 'Release Tests'
76+
## - workflow is 'CI Tests'
77+
## - workflow is 'P2P Tests'
78+
p2p-tests:
79+
if: |
80+
(
81+
inputs.workflow == 'Release Tests' ||
82+
inputs.workflow == 'CI Tests' ||
83+
inputs.workflow == 'P2P Tests'
84+
)
85+
name: P2P Tests
86+
needs:
87+
- create-cache
88+
uses: ./.github/workflows/p2p-tests.yml
89+
7290
#####################################################
7391
## Runs when:
7492
## either or of the following:

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stacks-signer/src/client/stacks_client.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ impl StacksClient {
242242
&self,
243243
tx: &StacksTransaction,
244244
) -> Result<u64, ClientError> {
245+
debug!("stacks_node_client: Getting estimated fee...");
245246
let request = FeeRateEstimateRequestBody {
246247
estimated_len: Some(tx.tx_len()),
247248
transaction_payload: to_hex(&tx.payload.serialize_to_vec()),
@@ -306,6 +307,11 @@ impl StacksClient {
306307

307308
/// Submit the block proposal to the stacks node. The block will be validated and returned via the HTTP endpoint for Block events.
308309
pub fn submit_block_for_validation(&self, block: NakamotoBlock) -> Result<(), ClientError> {
310+
debug!("stacks_node_client: Submitting block for validation...";
311+
"signer_sighash" => %block.header.signer_signature_hash(),
312+
"block_id" => %block.header.block_id(),
313+
"block_height" => %block.header.chain_length,
314+
);
309315
let block_proposal = NakamotoBlockProposal {
310316
block,
311317
chain_id: self.chain_id,
@@ -439,6 +445,10 @@ impl StacksClient {
439445
chosen_parent: &ConsensusHash,
440446
last_sortition: &ConsensusHash,
441447
) -> Result<VecDeque<TenureForkingInfo>, ClientError> {
448+
debug!("stacks_node_client: Getting tenure forking info...";
449+
"chosen_parent" => %chosen_parent,
450+
"last_sortition" => %last_sortition,
451+
);
442452
let path = self.tenure_forking_info_path(chosen_parent, last_sortition);
443453
let timer = crate::monitoring::new_rpc_call_timer(&path, &self.http_origin);
444454
let send_request = || {
@@ -459,6 +469,7 @@ impl StacksClient {
459469

460470
/// Get the sortition information for the latest sortition
461471
pub fn get_latest_sortition(&self) -> Result<SortitionInfo, ClientError> {
472+
debug!("stacks_node_client: Getting latest sortition...");
462473
let path = self.sortition_info_path();
463474
let timer = crate::monitoring::new_rpc_call_timer(&path, &self.http_origin);
464475
let send_request = || {
@@ -478,6 +489,7 @@ impl StacksClient {
478489

479490
/// Get the sortition information for a given sortition
480491
pub fn get_sortition(&self, ch: &ConsensusHash) -> Result<SortitionInfo, ClientError> {
492+
debug!("stacks_node_client: Getting sortition with consensus hash {ch}...");
481493
let path = format!("{}/consensus/{}", self.sortition_info_path(), ch.to_hex());
482494
let timer = crate::monitoring::new_rpc_call_timer(&path, &self.http_origin);
483495
let send_request = || {
@@ -497,7 +509,7 @@ impl StacksClient {
497509

498510
/// Get the current peer info data from the stacks node
499511
pub fn get_peer_info(&self) -> Result<PeerInfo, ClientError> {
500-
debug!("Getting stacks node info...");
512+
debug!("stacks_node_client: Getting peer info...");
501513
let timer =
502514
crate::monitoring::new_rpc_call_timer(&self.core_info_path(), &self.http_origin);
503515
let send_request = || {
@@ -547,6 +559,7 @@ impl StacksClient {
547559
&self,
548560
reward_cycle: u64,
549561
) -> Result<Option<Vec<NakamotoSignerEntry>>, ClientError> {
562+
debug!("stacks_node_client: Getting reward set signers for reward cycle {reward_cycle}...");
550563
let timer = crate::monitoring::new_rpc_call_timer(
551564
&self.reward_set_path(reward_cycle),
552565
&self.http_origin,
@@ -584,7 +597,7 @@ impl StacksClient {
584597

585598
/// Retrieve the current pox data from the stacks node
586599
pub fn get_pox_data(&self) -> Result<RPCPoxInfoData, ClientError> {
587-
debug!("Getting pox data...");
600+
debug!("stacks_node_client: Getting pox data...");
588601
let timer = crate::monitoring::new_rpc_call_timer(&self.pox_path(), &self.http_origin);
589602
let send_request = || {
590603
self.stacks_node_client
@@ -630,7 +643,7 @@ impl StacksClient {
630643
&self,
631644
address: &StacksAddress,
632645
) -> Result<AccountEntryResponse, ClientError> {
633-
debug!("Getting account info...");
646+
debug!("stacks_node_client: Getting account info...");
634647
let timer =
635648
crate::monitoring::new_rpc_call_timer(&self.accounts_path(address), &self.http_origin);
636649
let send_request = || {
@@ -707,6 +720,10 @@ impl StacksClient {
707720
/// Returns `true` if the block was accepted or `false` if the block
708721
/// was rejected.
709722
pub fn post_block(&self, block: &NakamotoBlock) -> Result<bool, ClientError> {
723+
debug!("stacks_node_client: Posting block to the stacks node...";
724+
"block_id" => %block.header.block_id(),
725+
"block_height" => %block.header.chain_length,
726+
);
710727
let path = format!("{}{}?broadcast=1", self.http_origin, postblock_v3::PATH);
711728
let timer = crate::monitoring::new_rpc_call_timer(&path, &self.http_origin);
712729
let send_request = || {
@@ -734,6 +751,9 @@ impl StacksClient {
734751
pub fn submit_transaction(&self, tx: &StacksTransaction) -> Result<Txid, ClientError> {
735752
let txid = tx.txid();
736753
let tx = tx.serialize_to_vec();
754+
debug!("stacks_node_client: Submitting transaction to the stacks node...";
755+
"txid" => %txid,
756+
);
737757
let timer =
738758
crate::monitoring::new_rpc_call_timer(&self.transaction_path(), &self.http_origin);
739759
let send_request = || {
@@ -763,7 +783,7 @@ impl StacksClient {
763783
function_name: &ClarityName,
764784
function_args: &[ClarityValue],
765785
) -> Result<ClarityValue, ClientError> {
766-
debug!("Calling read-only function {function_name} with args {function_args:?}...");
786+
debug!("stacks_node_client: Calling read-only function {function_name} with args {function_args:?}...");
767787
let args = function_args
768788
.iter()
769789
.filter_map(|arg| arg.serialize_to_hex().ok())

stackslib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ stacks-common = { features = ["default", "testing"], path = "../stacks-common" }
101101
rstest = "0.17.0"
102102
rstest_reuse = "0.5.0"
103103
mutants = "0.0.3"
104+
rlimit = "0.10.2"
104105

105106
[features]
106107
default = []

stackslib/src/chainstate/coordinator/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ pub trait BlockEventDispatcher {
179179
pox_constants: &PoxConstants,
180180
reward_set_data: &Option<RewardSetData>,
181181
signer_bitvec: &Option<BitVec<4000>>,
182+
block_timestamp: Option<u64>,
182183
);
183184

184185
/// called whenever a burn block is about to be

stackslib/src/chainstate/coordinator/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ impl BlockEventDispatcher for NullEventDispatcher {
430430
_pox_constants: &PoxConstants,
431431
_reward_set_data: &Option<RewardSetData>,
432432
_signer_bitvec: &Option<BitVec<4000>>,
433+
_block_timestamp: Option<u64>,
433434
) {
434435
assert!(
435436
false,

stackslib/src/chainstate/nakamoto/coordinator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ pub fn load_nakamoto_reward_set<U: RewardSetProvider>(
506506
Err(e) => return Some(Err(e)),
507507
Ok(None) => {
508508
// no header for this snapshot (possibly invalid)
509-
info!("Failed to find block by consensus hash"; "consensus_hash" => %sn.consensus_hash);
509+
debug!("Failed to find Stacks block by consensus hash"; "consensus_hash" => %sn.consensus_hash);
510510
return None
511511
}
512512
}

0 commit comments

Comments
 (0)