Skip to content

Commit 18a3f2f

Browse files
authored
Merge branch 'develop' into feat/sip029-testnet-block
2 parents 5a69d10 + 025af8e commit 18a3f2f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1212
- New RPC endpoints
1313
- `/v2/clarity/marf/:marf_key_hash`
1414
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
15+
- 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))
1516

1617
### Changed
1718

stackslib/src/chainstate/nakamoto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub use self::staging_blocks::{
131131
NakamotoStagingBlocksConn, NakamotoStagingBlocksConnRef, NakamotoStagingBlocksTx,
132132
};
133133

134-
pub const NAKAMOTO_BLOCK_VERSION: u8 = 1;
134+
pub const NAKAMOTO_BLOCK_VERSION: u8 = 0;
135135

136136
define_named_enum!(HeaderTypeNames {
137137
Nakamoto("nakamoto"),

stackslib/src/net/api/postblock_proposal.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ impl NakamotoBlockProposal {
538538
}
539539

540540
let mut block = builder.mine_nakamoto_block(&mut tenure_tx);
541+
// Override the block version with the one from the proposal. This must be
542+
// done before computing the block hash, because the block hash includes the
543+
// version in its computation.
544+
block.header.version = self.block.header.version;
541545
let size = builder.get_bytes_so_far();
542546
let cost = builder.tenure_finish(tenure_tx)?;
543547

0 commit comments

Comments
 (0)