Skip to content

Commit

Permalink
Update genesis block to include round in aggregated signature (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asa Oines committed Nov 16, 2019
1 parent 05c3f96 commit 860d9ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_transfers.sh checkout master
./ci_test_transfers.sh checkout asaj/bls-sign-round
end-to-end-geth-blockchain-parameters-test:
<<: *e2e-defaults
Expand All @@ -543,7 +543,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_blockchain_parameters.sh checkout master
./ci_test_blockchain_parameters.sh checkout asaj/bls-sign-round
end-to-end-geth-governance-test:
<<: *e2e-defaults
Expand All @@ -563,7 +563,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_governance.sh checkout master
./ci_test_governance.sh checkout asaj/bls-sign-round
end-to-end-geth-sync-test:
<<: *e2e-defaults
Expand All @@ -582,7 +582,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_sync.sh checkout master
./ci_test_sync.sh checkout asaj/bls-sign-round
end-to-end-geth-validator-order-test:
<<: *e2e-defaults
Expand All @@ -600,7 +600,7 @@ jobs:
command: |
set -e
cd packages/celotool
./ci_test_validator_order.sh checkout master
./ci_test_validator_order.sh checkout asaj/bls-sign-round
web:
working_directory: ~/app
Expand Down
25 changes: 20 additions & 5 deletions packages/celotool/src/lib/generate_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,37 @@ export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => {
const generateIstanbulExtraData = (validators: Validator[]) => {
const istanbulVanity = 32
const blsSignatureVanity = 192

return (
'0x' +
repeat('0', istanbulVanity * 2) +
rlp
// @ts-ignore
.encode([
// Added validators
validators.map((validator) => Buffer.from(validator.address, 'hex')),
validators.map((validator) => Buffer.from(validator.blsPublicKey, 'hex')),
// Removed validators
new Buffer(0),
// Seal
Buffer.from(repeat('0', blsSignatureVanity * 2), 'hex'),
[
// AggregatedSeal.Bitmap
new Buffer(0),
// AggregatedSeal.Signature
Buffer.from(repeat('0', blsSignatureVanity * 2), 'hex'),
// AggregatedSeal.Round
new Buffer(0),
],
[
// ParentAggregatedSeal.Bitmap
new Buffer(0),
// ParentAggregatedSeal.Signature
Buffer.from(repeat('0', blsSignatureVanity * 2), 'hex'),
// ParentAggregatedSeal.Round
new Buffer(0),
],
// EpochData
new Buffer(0),
Buffer.from(repeat('0', blsSignatureVanity * 2), 'hex'),
new Buffer(0),
new Buffer(0),
Buffer.from(repeat('0', blsSignatureVanity * 2), 'hex'),
])
.toString('hex')
)
Expand Down

0 comments on commit 860d9ec

Please sign in to comment.