Skip to content

Commit

Permalink
refactor(mempool): Add merge bit to tx-kernel-id
Browse files Browse the repository at this point in the history
The `TransactionKernelId` only promises to be constant under the
execution of single proof's update-branch. Since the update-branch
cannot change the merge_bit in a transaction kernel, the
TransactionKernelId should include the value of the merge_bit.

This, along with the introduction of `TransactionKernelId` closes #203.
  • Loading branch information
Sword-Smith committed Jan 14, 2025
1 parent 9c1c443 commit 8907bf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/state/transaction_kernel_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ impl TransactionKernel {

let coinbase_hash = Tip5::hash(&self.coinbase);

let merge_bit_hash = Tip5::hash(&self.merge_bit);

// Build a Merkle tree from all five digests, and treat the root as the
// digest
let mut digests = vec![
Expand All @@ -78,6 +80,7 @@ impl TransactionKernel {
public_announcements_hash,
fee_hash,
coinbase_hash,
merge_bit_hash,
];

// pad until length is a power of two
Expand Down

0 comments on commit 8907bf4

Please sign in to comment.