-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement accurate sigop / sighashbytes counting block consensus rules
Replace the inaccurate / somewhat ineffective consensus rule for number of signature operations per block with new consensus rules that accurately count the number of ECDSA signature operations needed to validate a block, and the number of bytes of data needed to compute signature hashes (to mitigate the attack described in CVE-2013-2292). BIP number for this to be determined. Constants were chosen such that any 'non-attack' transaction valid under the old rules is also valid under the new rules, but maximum possible block validation times are well-bounded, but tied to block size increases. Summary of old rules / new rules: Old rules: 20,000 inaccurately-counted-sigops for a 1MB block New: 80,000 accurately-counted sigops for an 8MB block A scan of the last 100,000 blocks for high-sigop blocks gets a maximum of 7,350 sigops in block 364,773 (in a single, huge, ~1MB transaction). For reference, Pieter Wuille's libsecp256k1 validation code validates about 10,000 signatures per second on a single 2.7GHZ CPU core. Old rules: no limit for number of bytes hashed to generate signature hashes New rule: 1.3gigabytes hashed per 8MB block to generate signature hashes Block 364,422 contains a single ~1MB transaction that requires 1.2GB of data hashed to generate signature hashes.
- Loading branch information
1 parent
6963ce5
commit cc1a7b5
Showing
4 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters