Skip to content

Commit b93f2f5

Browse files
authored
Merge pull request #5539 from stacks-network/fix/block-validation-version
fix: when validating a block, clone the blocks version
2 parents 8c99a12 + 4f5f6f6 commit b93f2f5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
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/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)