-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move clique constants to dedicated file
- Loading branch information
Showing
3 changed files
with
29 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BN } from 'ethereumjs-util' | ||
|
||
// Fixed number of extra-data prefix bytes reserved for signer vanity | ||
export const CLIQUE_EXTRA_VANITY = 32 | ||
// Fixed number of extra-data suffix bytes reserved for signer seal | ||
export const CLIQUE_EXTRA_SEAL = 65 | ||
|
||
// Block difficulty for in-turn signatures | ||
export const CLIQUE_DIFF_INTURN = new BN(2) | ||
// Block difficulty for in-turn signatures | ||
export const CLIQUE_DIFF_NOTURN = new BN(1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { Address, BN } from 'ethereumjs-util' | ||
|
||
export type CliqueSignerState = [BN, Address[]] // [blockNumber, signers] | ||
// Clique Signer State: [blockNumber, signers] | ||
export type CliqueSignerState = [BN, Address[]] | ||
export type CliqueLatestSignerStates = CliqueSignerState[] | ||
|
||
export type CliqueVote = [BN, [Address, Address, Buffer]] // [blockNumber, [signer, beneficiary, cliqueNonce]] | ||
// Clique Vote: [blockNumber, [signer, beneficiary, cliqueNonce]] | ||
export type CliqueVote = [BN, [Address, Address, Buffer]] | ||
export type CliqueLatestVotes = CliqueVote[] | ||
|
||
export type CliqueBlockSigner = [BN, Address] // [blockNumber, signer] | ||
// Clique Block Signer: [blockNumber, signer] | ||
export type CliqueBlockSigner = [BN, Address] | ||
export type CliqueLatestBlockSigners = CliqueBlockSigner[] | ||
|
||
// Magic nonce number to vote on adding a new signer | ||
export const CLIQUE_NONCE_AUTH = Buffer.from('ffffffffffffffff', 'hex') | ||
// Magic nonce number to vote on removing a signer. | ||
export const CLIQUE_NONCE_DROP = Buffer.alloc(8) |