Skip to content

Commit e0a4342

Browse files
authored
Merge branch 'develop' into fix/clippy-ci-stacks-lib-int-plus-one
2 parents f702204 + 13de1f9 commit e0a4342

File tree

153 files changed

+4259
-2701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+4259
-2701
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
# - tests::neon_integrations::size_overflow_unconfirmed_microblocks_integration_test
5555
# - tests::neon_integrations::size_overflow_unconfirmed_stream_microblocks_integration_test
5656
# - tests::neon_integrations::runtime_overflow_unconfirmed_microblocks_integration_test
57+
# - tests::epoch_25::microblocks_disabled
5758
# Disable this flaky test. Microblocks are no longer supported anyways.
5859
# - tests::neon_integrations::microblock_large_tx_integration_test_FLAKY
5960
- tests::neon_integrations::miner_submit_twice
@@ -80,7 +81,6 @@ jobs:
8081
- tests::neon_integrations::bitcoin_reorg_flap
8182
- tests::neon_integrations::bitcoin_reorg_flap_with_follower
8283
- tests::neon_integrations::start_stop_bitcoind
83-
- tests::epoch_25::microblocks_disabled
8484
- tests::should_succeed_handling_malformed_and_valid_txs
8585
- tests::nakamoto_integrations::simple_neon_integration
8686
- tests::nakamoto_integrations::flash_blocks_on_epoch_3
@@ -132,10 +132,17 @@ jobs:
132132
- tests::signer::v0::block_commit_delay
133133
- tests::signer::v0::continue_after_fast_block_no_sortition
134134
- tests::signer::v0::block_validation_response_timeout
135+
- tests::signer::v0::block_validation_pending_table
136+
- tests::signer::v0::new_tenure_while_validating_previous_scenario
135137
- tests::signer::v0::tenure_extend_after_bad_commit
136138
- tests::signer::v0::block_proposal_max_age_rejections
137139
- tests::signer::v0::global_acceptance_depends_on_block_announcement
138140
- tests::signer::v0::no_reorg_due_to_successive_block_validation_ok
141+
- tests::signer::v0::incoming_signers_ignore_block_proposals
142+
- tests::signer::v0::outgoing_signers_ignore_block_proposals
143+
- tests::signer::v0::injected_signatures_are_ignored_across_boundaries
144+
- tests::signer::v0::block_proposal_timeout
145+
- tests::signer::v0::rejected_blocks_count_towards_miner_validity
139146
- tests::nakamoto_integrations::burn_ops_integration_test
140147
- tests::nakamoto_integrations::check_block_heights
141148
- tests::nakamoto_integrations::clarity_burn_state

.github/workflows/ci.yml

Lines changed: 35 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,10 @@ jobs:
112112
## - commit to either (development, master) branch
113113
create-cache:
114114
if: |
115-
needs.check-release.outputs.is_release == 'true' || (
116-
github.event_name == 'workflow_dispatch' ||
117-
github.event_name == 'pull_request' ||
118-
github.event_name == 'merge_group' ||
119-
(
120-
contains('
121-
refs/heads/master
122-
refs/heads/develop
123-
refs/heads/next
124-
', github.event.pull_request.head.ref) &&
125-
github.event_name == 'push'
126-
)
127-
)
115+
needs.check-release.outputs.is_release == 'true' ||
116+
github.event_name == 'workflow_dispatch' ||
117+
github.event_name == 'pull_request' ||
118+
github.event_name == 'merge_group'
128119
name: Create Test Cache
129120
needs:
130121
- rustfmt
@@ -144,64 +135,55 @@ jobs:
144135
## - commit to either (development, next, master) branch
145136
stacks-core-tests:
146137
if: |
147-
needs.check-release.outputs.is_release == 'true' || (
148-
github.event_name == 'workflow_dispatch' ||
149-
github.event_name == 'pull_request' ||
150-
github.event_name == 'merge_group' ||
151-
(
152-
contains('
153-
refs/heads/master
154-
refs/heads/develop
155-
refs/heads/next
156-
', github.event.pull_request.head.ref) &&
157-
github.event_name == 'push'
158-
)
159-
)
138+
github.event_name == 'workflow_dispatch' ||
139+
github.event_name == 'pull_request' ||
140+
github.event_name == 'merge_group'
160141
name: Stacks Core Tests
161142
needs:
162143
- rustfmt
163144
- create-cache
164145
- check-release
165146
uses: ./.github/workflows/stacks-core-tests.yml
166147

148+
## Checks to run on built binaries
149+
##
150+
## Runs when:
151+
## - it is a release run
152+
## or:
153+
## - it is not a release run
154+
## and any of:
155+
## - this workflow is called manually
156+
## - PR is opened
157+
## - PR added to merge queue
158+
## - commit to either (development, next, master) branch
159+
stacks-core-build-tests:
160+
if: |
161+
github.event_name == 'workflow_dispatch' ||
162+
github.event_name == 'pull_request' ||
163+
github.event_name == 'merge_group'
164+
name: Stacks Core Build Tests
165+
needs:
166+
- rustfmt
167+
- check-release
168+
uses: ./.github/workflows/core-build-tests.yml
169+
167170
bitcoin-tests:
168171
if: |
169-
needs.check-release.outputs.is_release == 'true' || (
170-
github.event_name == 'workflow_dispatch' ||
171-
github.event_name == 'pull_request' ||
172-
github.event_name == 'merge_group' ||
173-
(
174-
contains('
175-
refs/heads/master
176-
refs/heads/develop
177-
refs/heads/next
178-
', github.event.pull_request.head.ref) &&
179-
github.event_name == 'push'
180-
)
181-
)
172+
github.event_name == 'workflow_dispatch' ||
173+
github.event_name == 'pull_request' ||
174+
github.event_name == 'merge_group'
182175
name: Bitcoin Tests
183176
needs:
184177
- rustfmt
185178
- create-cache
186179
- check-release
187180
uses: ./.github/workflows/bitcoin-tests.yml
188181

189-
190182
p2p-tests:
191183
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-
)
184+
github.event_name == 'workflow_dispatch' ||
185+
github.event_name == 'pull_request' ||
186+
github.event_name == 'merge_group'
205187
name: P2P Tests
206188
needs:
207189
- rustfmt
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Core build tests
2+
3+
# Only run when:
4+
# - PRs are (re)opened against develop branch
5+
on:
6+
workflow_call:
7+
8+
jobs:
9+
check-consts:
10+
name: Check the constants from stacks-inspect
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout the latest code
14+
id: git_checkout
15+
uses: actions/checkout@v3
16+
- name: Define Rust Toolchain
17+
id: define_rust_toolchain
18+
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
19+
- name: Setup Rust Toolchain
20+
id: setup_rust_toolchain
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
with:
23+
toolchain: ${{ env.RUST_TOOLCHAIN }}
24+
- name: Build the binaries
25+
id: build
26+
run: |
27+
cargo build
28+
- name: Dump constants JSON
29+
id: consts-dump
30+
run: cargo run --bin stacks-inspect -- dump-consts | tee out.json
31+
- name: Set expected constants JSON
32+
id: expects-json
33+
run: diff out.json ./sample/expected_consts.json

.github/workflows/docs-pr.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8-
## [Unreleased]
8+
## [3.1.0.0.3]
99

1010
### Added
1111

1212
- Add `tenure_timeout_secs` to the miner for determining when a time-based tenure extend should be attempted.
1313
- Added configuration option `block_proposal_max_age_secs` under `[connection_options]` to prevent processing stale block proposals
1414

1515
### Changed
16-
- The RPC endpoint `/v3/block_proposal` no longer will evaluate block proposals more than `block_proposal_max_age_secs` old
1716

17+
- The RPC endpoint `/v3/block_proposal` no longer will evaluate block proposals more than `block_proposal_max_age_secs` old
1818
- When a transaction is dropped due to replace-by-fee, the `/drop_mempool_tx` event observer payload now includes `new_txid`, which is the transaction that replaced this dropped transaction. When a transaction is dropped for other reasons, `new_txid` is `null`. [#5381](https://github.com/stacks-network/stacks-core/pull/5381)
1919
- Nodes will assume that all PoX anchor blocks exist by default, and stall initial block download indefinitely to await their arrival (#5502)
2020

21+
### Fixed
22+
23+
- Signers no longer accept messages for blocks from different reward cycles (#5662)
24+
2125
## [3.1.0.0.2]
2226

2327
### Added

clarity/src/vm/representations.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ guarded_string!(
8484
);
8585

8686
impl StacksMessageCodec for ClarityName {
87+
#[allow(clippy::needless_as_bytes)] // as_bytes isn't necessary, but verbosity is preferable in the codec impls
8788
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), codec_error> {
8889
// ClarityName can't be longer than vm::representations::MAX_STRING_LEN, which itself is
8990
// a u8, so we should be good here.
@@ -124,6 +125,7 @@ impl StacksMessageCodec for ClarityName {
124125
}
125126

126127
impl StacksMessageCodec for ContractName {
128+
#[allow(clippy::needless_as_bytes)] // as_bytes isn't necessary, but verbosity is preferable in the codec impls
127129
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), codec_error> {
128130
if self.as_bytes().len() < CONTRACT_MIN_NAME_LENGTH
129131
|| self.as_bytes().len() > CONTRACT_MAX_NAME_LENGTH

libsigner/src/v0/messages.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ pub struct PeerInfo {
283283
}
284284

285285
impl StacksMessageCodec for PeerInfo {
286+
#[allow(clippy::needless_as_bytes)] // as_bytes isn't necessary, but verbosity is preferable in the codec impls
286287
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), CodecError> {
287288
write_next(fd, &self.burn_block_height)?;
288289
write_next(fd, self.stacks_tip_consensus_hash.as_bytes())?;
@@ -687,6 +688,14 @@ impl BlockResponse {
687688
}
688689
}
689690

691+
/// The signer signature hash for the block response
692+
pub fn signer_signature_hash(&self) -> Sha512Trunc256Sum {
693+
match self {
694+
BlockResponse::Accepted(accepted) => accepted.signer_signature_hash,
695+
BlockResponse::Rejected(rejection) => rejection.signer_signature_hash,
696+
}
697+
}
698+
690699
/// Get the block accept data from the block response
691700
pub fn as_block_accepted(&self) -> Option<&BlockAccepted> {
692701
match self {

pox-locking/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ mutants = "0.0.3"
2828

2929
[features]
3030
slog_json = ["stacks_common/slog_json", "clarity/slog_json"]
31+
testing = []

pox-locking/src/events.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ use clarity::vm::costs::LimitedCostTracker;
2020
use clarity::vm::errors::Error as ClarityError;
2121
use clarity::vm::types::{PrincipalData, QualifiedContractIdentifier, ResponseData, TupleData};
2222
use clarity::vm::Value;
23-
#[cfg(test)]
23+
#[cfg(any(test, feature = "testing"))]
2424
use slog::slog_debug;
2525
use slog::slog_error;
26-
#[cfg(test)]
26+
#[cfg(any(test, feature = "testing"))]
2727
use stacks_common::debug;
2828
use stacks_common::types::StacksEpochId;
2929
use stacks_common::{error, test_debug};

pox-locking/src/events_24.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ use clarity::vm::contexts::GlobalContext;
1919
use clarity::vm::errors::Error as ClarityError;
2020
use clarity::vm::types::{PrincipalData, QualifiedContractIdentifier, TupleData};
2121
use clarity::vm::Value;
22-
#[cfg(test)]
22+
#[cfg(any(test, feature = "testing"))]
2323
use slog::slog_debug;
2424
use slog::slog_error;
25-
#[cfg(test)]
25+
#[cfg(any(test, feature = "testing"))]
2626
use stacks_common::debug;
2727
use stacks_common::{error, test_debug};
2828

0 commit comments

Comments
 (0)