Skip to content

Commit 2f87f19

Browse files
committed
Merge branch 'develop' of https://github.com/stacks-network/stacks-core into fix/clippy-ci-stacks-lib-bind-instead-of-map
2 parents 6cf460f + ad92204 commit 2f87f19

File tree

30 files changed

+160
-60
lines changed

30 files changed

+160
-60
lines changed

CHANGELOG.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1616
- 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)
1717
- Nodes will assume that all PoX anchor blocks exist by default, and stall initial block download indefinitely to await their arrival (#5502)
1818

19-
## [3.1.0.0.1]
20-
21-
### Added
22-
23-
- A miner will now generate a tenure-extend when at least 70% of the signers have confirmed that they are willing to allow one, via the new timestamp included in block responses. This allows the miner to refresh its budget in between Bitcoin blocks. ([#5476](https://github.com/stacks-network/stacks-core/discussions/5476))
24-
25-
### Changed
26-
27-
## [3.1.0.0.0]
19+
## [3.1.0.0.2]
2820

2921
### Added
3022

@@ -33,6 +25,8 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
3325
- `/v2/clarity/marf/:marf_key_hash`
3426
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
3527
- When a proposed block is validated by a node, the block can be validated even when the block version is different than the node's default ([#5539](https://github.com/stacks-network/stacks-core/pull/5539))
28+
- A miner will now generate a tenure-extend when at least 70% of the signers have confirmed that they are willing to allow one, via the new timestamp included in block responses. This allows the miner to refresh its budget in between Bitcoin blocks. ([#5476](https://github.com/stacks-network/stacks-core/discussions/5476))
29+
- Set the epoch to 3.1 in the Clarity DB upon activation.
3630

3731
### Changed
3832

sample/conf/testnet-follower-conf.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ start_height = 6
7777

7878
[[burnchain.epochs]]
7979
epoch_name = "3.0"
80-
start_height = 56_457
80+
start_height = 1900
8181

8282
[[burnchain.epochs]]
8383
epoch_name = "3.1"
84-
start_height = 77_770
84+
start_height = 2000

sample/conf/testnet-miner-conf.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ start_height = 6
7373

7474
[[burnchain.epochs]]
7575
epoch_name = "3.0"
76-
start_height = 56_457
76+
start_height = 1900
7777

7878
[[burnchain.epochs]]
7979
epoch_name = "3.1"
80-
start_height = 77_770
80+
start_height = 2000

sample/conf/testnet-signer.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,8 @@ start_height = 6
7575

7676
[[burnchain.epochs]]
7777
epoch_name = "3.0"
78-
start_height = 56_457
78+
start_height = 1900
79+
80+
[[burnchain.epochs]]
81+
epoch_name = "3.1"
82+
start_height = 2000

stacks-signer/CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,26 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1515
- Improvements to the stale signer cleanup logic: deletes the prior signer if it has no remaining unprocessed blocks in its database
1616
- Signers now listen to new block events from the stacks node to determine whether a block has been successfully appended to the chain tip
1717

18-
## [3.1.0.0.1.0]
18+
# [3.1.0.0.2.1]
1919

20-
### Added
20+
## Added
21+
22+
## Changed
23+
24+
- Prevent old reward cycle signers from processing block validation response messages that do not apply to blocks from their cycle.
25+
26+
## [3.1.0.0.2.0]
27+
28+
## Added
29+
30+
- **SIP-029 consensus rules, activating in epoch 3.1 at block 875,000** (see [SIP-029](https://github.com/will-corcoran/sips/blob/feat/sip-029-halving-alignment/sips/sip-029/sip-029-halving-alignment.md) for details)
2131

2232
### Changed
2333

2434
- Added tenure extend timestamp to signer block responses
2535
- Added tenure_idle_timeout_secs configuration option for determining when a time-based tenure extend will be accepted
2636

37+
2738
## [3.1.0.0.0.0]
2839

2940
### Added

stacks-signer/src/v0/signer.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@ impl Signer {
659659
// For mutability reasons, we need to take the block_info out of the map and add it back after processing
660660
let mut block_info = match self.signer_db.block_lookup(&signer_signature_hash) {
661661
Ok(Some(block_info)) => {
662+
if block_info.reward_cycle != self.reward_cycle {
663+
// We are not signing for this reward cycle. Ignore the block.
664+
debug!(
665+
"{self}: Received a block validation response for a different reward cycle. Ignore it.";
666+
"requested_reward_cycle" => block_info.reward_cycle,
667+
);
668+
return None;
669+
}
662670
if block_info.is_locally_finalized() {
663671
debug!("{self}: Received block validation for a block that is already marked as {}. Ignoring...", block_info.state);
664672
return None;
@@ -744,6 +752,14 @@ impl Signer {
744752
}
745753
let mut block_info = match self.signer_db.block_lookup(&signer_signature_hash) {
746754
Ok(Some(block_info)) => {
755+
if block_info.reward_cycle != self.reward_cycle {
756+
// We are not signing for this reward cycle. Ignore the block.
757+
debug!(
758+
"{self}: Received a block validation response for a different reward cycle. Ignore it.";
759+
"requested_reward_cycle" => block_info.reward_cycle,
760+
);
761+
return None;
762+
}
747763
if block_info.is_locally_finalized() {
748764
debug!("{self}: Received block validation for a block that is already marked as {}. Ignoring...", block_info.state);
749765
return None;

stackslib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = [ "stacks", "stx", "bitcoin", "crypto", "blockstack", "decentralized"
1212
readme = "README.md"
1313
resolver = "2"
1414
edition = "2021"
15-
rust-version = "1.61"
15+
rust-version = "1.80"
1616

1717
[lib]
1818
name = "blockstack_lib"

stackslib/src/chainstate/burn/operations/delegate_stx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl StacksMessageCodec for DelegateStxOp {
237237
} else {
238238
fd.write_all(&0_u8.to_be_bytes())
239239
.map_err(|e| codec_error::WriteError(e))?;
240-
fd.write_all(&0_u8.to_be_bytes())
240+
fd.write_all(&0_u32.to_be_bytes())
241241
.map_err(|e| codec_error::WriteError(e))?;
242242
}
243243

stackslib/src/chainstate/nakamoto/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3943,7 +3943,11 @@ impl NakamotoChainState {
39433943

39443944
// is this stacks block the first of a new epoch?
39453945
let (applied_epoch_transition, mut tx_receipts) =
3946-
StacksChainState::process_epoch_transition(&mut clarity_tx, burn_header_height)?;
3946+
StacksChainState::process_epoch_transition(
3947+
&mut clarity_tx,
3948+
sortition_dbconn.as_burn_state_db(),
3949+
burn_header_height,
3950+
)?;
39473951

39483952
debug!(
39493953
"Setup block: Processed epoch transition";

stackslib/src/chainstate/nakamoto/test_signers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl TestSigners {
264264

265265
let aggregate_public_key: Vec<u8> =
266266
rand::thread_rng().sample_iter(Standard).take(33).collect();
267-
self.aggregate_public_key = aggregate_public_key.clone();
267+
self.aggregate_public_key.clone_from(&aggregate_public_key);
268268
aggregate_public_key
269269
}
270270
}

0 commit comments

Comments
 (0)