Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
08bc4e5
feat: initial work for dimension specific tenure extends
kantai Oct 15, 2025
aa08b80
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jcnelson Oct 16, 2025
c9b4a81
chore: remove ExtendedDimension and instead add more variants to Tenu…
jcnelson Oct 17, 2025
99daf25
chore: fix compiler errors
jcnelson Oct 17, 2025
a1efb03
Merge remote-tracking branch 'stacks-network/develop' into feat/sip034
jcnelson Oct 17, 2025
4a07752
chore: add SIP034 unit test coverage and fix clippy
jcnelson Oct 17, 2025
106f3c2
chore: add more test coverage and add a defensive check to transactio…
jcnelson Oct 17, 2025
99334c7
chore: make the signer reject SIP-034 tenure extends for the time bei…
jcnelson Oct 18, 2025
2d998a6
fix: add signer integration tests to verify that signers disable SIP-…
jcnelson Oct 20, 2025
314e94e
feat: allow tests to override supports_sip034_tenure_extensions via a…
jcnelson Oct 20, 2025
f6b80f0
fix: ensure that the block proposal evaluation test runs at a differe…
jcnelson Oct 20, 2025
a96dc1b
fix: take a block timestamp as an optional argument, and fall back to…
jcnelson Oct 20, 2025
1ef52d9
feat: helper for generating tenure-changes
jcnelson Oct 20, 2025
27ddc37
chore: API sync -- pass in the block timestamp (if known) when mining…
jcnelson Oct 20, 2025
4ea4de4
Merge branch 'develop' into feat/sip034
jcnelson Oct 21, 2025
dceceb8
Update stackslib/src/chainstate/nakamoto/coordinator/tests.rs
jcnelson Oct 23, 2025
8df3930
Update stackslib/src/chainstate/nakamoto/coordinator/tests.rs
jcnelson Oct 23, 2025
03d3ede
Merge branch 'develop' into feat/sip034
jcnelson Oct 23, 2025
a378ada
chore: address PR feedback, and exhaustively match tenure-change causes
jcnelson Oct 23, 2025
fa399be
fix: failing unit test due to change in invalid-block text
jcnelson Oct 23, 2025
06563e6
Merge branch 'develop' into feat/sip034
jcnelson Oct 23, 2025
3ece6ff
chore: fix build error resulting from merge
jcnelson Oct 23, 2025
ee4ab32
chore: cargo fmt
jcnelson Oct 23, 2025
8ec9bf9
fix: increase mempool walk timeout
jcnelson Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions stacks-common/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,23 @@ impl StacksEpochId {
}
}

pub fn supports_specific_budget_extends(&self) -> bool {
match self {
StacksEpochId::Epoch10
| StacksEpochId::Epoch20
| StacksEpochId::Epoch2_05
| StacksEpochId::Epoch21
| StacksEpochId::Epoch22
| StacksEpochId::Epoch23
| StacksEpochId::Epoch24
| StacksEpochId::Epoch25
| StacksEpochId::Epoch30
| StacksEpochId::Epoch31
| StacksEpochId::Epoch32 => false,
StacksEpochId::Epoch33 => true,
}
}

/// Whether or not this epoch supports the punishment of PoX reward
/// recipients using the bitvec scheme
pub fn allows_pox_punishment(&self) -> bool {
Expand Down
24 changes: 17 additions & 7 deletions stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use stacks::chainstate::burn::operations::{
use stacks::chainstate::coordinator::comm::CoordinatorChannels;
use stacks::chainstate::coordinator::OnChainRewardSetProvider;
use stacks::chainstate::nakamoto::coordinator::{load_nakamoto_reward_set, TEST_COORDINATOR_STALL};
use stacks::chainstate::nakamoto::miner::NakamotoBlockBuilder;
use stacks::chainstate::nakamoto::miner::{MinerTenureInfoCause, NakamotoBlockBuilder};
use stacks::chainstate::nakamoto::shadow::shadow_chainstate_repair;
use stacks::chainstate::nakamoto::test_signers::TestSigners;
use stacks::chainstate::nakamoto::{NakamotoBlock, NakamotoBlockHeader, NakamotoChainState};
Expand Down Expand Up @@ -3228,10 +3228,12 @@ fn block_proposal_api_endpoint() {
let tenure_change = None;
let coinbase = None;

let tenure_cause = tenure_change.and_then(|tx: &StacksTransaction| match &tx.payload {
TransactionPayload::TenureChange(tc) => Some(tc.cause),
_ => None,
});
let tenure_cause = tenure_change
.and_then(|tx: &StacksTransaction| match &tx.payload {
TransactionPayload::TenureChange(tc) => Some(MinerTenureInfoCause::from(tc.cause)),
_ => Some(MinerTenureInfoCause::NoTenureChange),
})
.unwrap_or(MinerTenureInfoCause::NoTenureChange);

// Apply miner signature
let sign = |p: &NakamotoBlockProposal| {
Expand All @@ -3253,6 +3255,7 @@ fn block_proposal_api_endpoint() {
1,
None,
None,
None,
)
.expect("Failed to build Nakamoto block");

Expand Down Expand Up @@ -6837,6 +6840,7 @@ fn signer_chainstate() {
tenure_idle_timeout_buffer: Duration::from_secs(2),
reorg_attempts_activity_timeout: Duration::from_secs(30),
reset_replay_set_after_fork_blocks: DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS,
supports_sip034_tenure_extensions: false,
};
let mut sortitions_view =
SortitionsView::fetch_view(proposal_conf, &signer_client).unwrap();
Expand Down Expand Up @@ -6972,6 +6976,7 @@ fn signer_chainstate() {
tenure_idle_timeout_buffer: Duration::from_secs(2),
reorg_attempts_activity_timeout: Duration::from_secs(30),
reset_replay_set_after_fork_blocks: DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS,
supports_sip034_tenure_extensions: false,
};
let burn_block_height = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn())
.unwrap()
Expand Down Expand Up @@ -7051,6 +7056,7 @@ fn signer_chainstate() {
tenure_idle_timeout_buffer: Duration::from_secs(2),
reorg_attempts_activity_timeout: Duration::from_secs(30),
reset_replay_set_after_fork_blocks: DEFAULT_RESET_REPLAY_SET_AFTER_FORK_BLOCKS,
supports_sip034_tenure_extensions: false,
};
let mut sortitions_view = SortitionsView::fetch_view(proposal_conf, &signer_client).unwrap();
sortitions_view
Expand Down Expand Up @@ -7544,6 +7550,9 @@ fn continue_tenure_extend() {
}
tenure_block_founds.push(parsed);
}
_ => {
panic!("Unexpected tenure-extend cause {:?}", &payload.cause);
}
};
}
}
Expand Down Expand Up @@ -11142,7 +11151,7 @@ fn test_tenure_extend_from_flashblocks() {
let parsed = StacksTransaction::consensus_deserialize(&mut &tx_bytes[..]).unwrap();

if let TransactionPayload::TenureChange(payload) = &parsed.payload {
if payload.cause == TenureChangeCause::Extended {
if payload.cause.is_eq(&TenureChangeCause::Extended) {
has_extend = true;
}
}
Expand Down Expand Up @@ -11662,6 +11671,7 @@ fn large_mempool_base(strategy: MemPoolWalkStrategy, set_fee: impl Fn() -> u64)

let (mut naka_conf, _miner_account) = naka_neon_integration_conf(None);
naka_conf.miner.mempool_walk_strategy = strategy;
naka_conf.miner.nakamoto_attempt_time_ms = 10_000;

let sender_signer_sk = Secp256k1PrivateKey::random();
let sender_signer_addr = tests::to_addr(&sender_signer_sk);
Expand Down Expand Up @@ -12919,7 +12929,7 @@ fn miner_constructs_replay_block() {
let tx_bytes = hex_bytes(&raw_tx[2..]).unwrap();
let parsed = StacksTransaction::consensus_deserialize(&mut &tx_bytes[..]).unwrap();
let tenure_change = parsed.try_as_tenure_change().unwrap();
assert_eq!(tenure_change.cause, TenureChangeCause::BlockFound);
assert!(tenure_change.cause.is_eq(&TenureChangeCause::BlockFound));

info!("Verifying next block contains the expected replay txs...");
let block: StacksBlockEvent =
Expand Down
Loading
Loading