Skip to content

Commit f702204

Browse files
committed
Merge branch 'develop' of https://github.com/stacks-network/stacks-core into fix/clippy-ci-stacks-lib-int-plus-one
2 parents a83067d + a70b3d5 commit f702204

Some content is hidden

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

58 files changed

+363
-224
lines changed

CHANGELOG.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,15 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1010
### Added
1111

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

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

1618
- 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)
1719
- Nodes will assume that all PoX anchor blocks exist by default, and stall initial block download indefinitely to await their arrival (#5502)
1820

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]
21+
## [3.1.0.0.2]
2822

2923
### Added
3024

@@ -33,6 +27,8 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
3327
- `/v2/clarity/marf/:marf_key_hash`
3428
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
3529
- 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))
30+
- 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))
31+
- Set the epoch to 3.1 in the Clarity DB upon activation.
3632

3733
### Changed
3834

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/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::path::PathBuf;
2121
use std::time::Duration;
2222

2323
use blockstack_lib::chainstate::stacks::TransactionVersion;
24+
use blockstack_lib::net::connection::DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS;
2425
use clarity::util::hash::to_hex;
2526
use libsigner::SignerEntries;
2627
use serde::Deserialize;
@@ -39,7 +40,6 @@ const BLOCK_PROPOSAL_VALIDATION_TIMEOUT_MS: u64 = 120_000;
3940
const DEFAULT_FIRST_PROPOSAL_BURN_BLOCK_TIMING_SECS: u64 = 60;
4041
const DEFAULT_TENURE_LAST_BLOCK_PROPOSAL_TIMEOUT_SECS: u64 = 30;
4142
const TENURE_IDLE_TIMEOUT_SECS: u64 = 300;
42-
const DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS: u64 = 600;
4343

4444
#[derive(thiserror::Error, Debug)]
4545
/// An error occurred parsing the provided configuration

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/burnchains/bitcoin/blocks.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ impl BitcoinMessageHandler for BitcoinBlockDownloader {
150150
None => panic!("No block header set"),
151151
Some(ref ipc_header) => {
152152
let block_hash = ipc_header.block_header.header.bitcoin_hash().clone();
153-
indexer
154-
.send_getdata(&vec![block_hash])
155-
.and_then(|_r| Ok(true))
153+
indexer.send_getdata(&vec![block_hash]).map(|_r| true)
156154
}
157155
}
158156
}

stackslib/src/burnchains/bitcoin/indexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl BitcoinIndexer {
458458
}
459459
spv_client
460460
.run(self)
461-
.and_then(|_r| Ok(spv_client.end_block_height.unwrap()))
461+
.map(|_r| spv_client.end_block_height.unwrap())
462462
}
463463

464464
#[cfg(test)]

0 commit comments

Comments
 (0)