From 860d9ec6648e90e146d5e8736bed3a4fe39185ad Mon Sep 17 00:00:00 2001 From: Asa Oines Date: Fri, 15 Nov 2019 16:38:05 -0800 Subject: [PATCH] Update genesis block to include round in aggregated signature (#1736) --- .circleci/config.yml | 10 ++++----- packages/celotool/src/lib/generate_utils.ts | 25 ++++++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d9e0987e1d..d0170e30e55 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/packages/celotool/src/lib/generate_utils.ts b/packages/celotool/src/lib/generate_utils.ts index 7acecab6357..c9dbc6d5130 100644 --- a/packages/celotool/src/lib/generate_utils.ts +++ b/packages/celotool/src/lib/generate_utils.ts @@ -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') )