diff --git a/CHANGELOG.md b/CHANGELOG.md index f383cb596c..76bc175722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE - New RPC endpoints - `/v2/clarity/marf/:marf_key_hash` - `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key` +- 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)) ### Changed diff --git a/stackslib/src/net/api/postblock_proposal.rs b/stackslib/src/net/api/postblock_proposal.rs index 27a930d634..2f35f29a18 100644 --- a/stackslib/src/net/api/postblock_proposal.rs +++ b/stackslib/src/net/api/postblock_proposal.rs @@ -538,6 +538,10 @@ impl NakamotoBlockProposal { } let mut block = builder.mine_nakamoto_block(&mut tenure_tx); + // Override the block version with the one from the proposal. This must be + // done before computing the block hash, because the block hash includes the + // version in its computation. + block.header.version = self.block.header.version; let size = builder.get_bytes_so_far(); let cost = builder.tenure_finish(tenure_tx)?;