Skip to content

Commit

Permalink
fix(protocol): new way to calculate meta.difficulty (TKO-11) (#15568)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jan 26, 2024
1 parent b0ca0df commit 8c4b48e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ library LibProposing {
// of multiple Taiko blocks being proposed within a single
// Ethereum block, we must introduce a salt to this random
// number as the L2 mixHash.
unchecked {
meta.difficulty = meta.blobHash ^ bytes32(block.prevrandao * b.numBlocks * block.number);
}
meta.difficulty = keccak256(abi.encodePacked(block.prevrandao, b.numBlocks, block.number));

// Use the difficulty as a random number
meta.minTier = ITierProvider(resolver.resolve("tier_provider", false)).getMinTier(
Expand Down

0 comments on commit 8c4b48e

Please sign in to comment.