Skip to content

Commit

Permalink
Update with new istanbul lookback window size flag (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asa Oines committed Nov 21, 2019
1 parent 07d5f6e commit 0b6458b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ e2e-defaults: &e2e-defaults
docker:
- image: celohq/circleci
environment:
CELO_BLOCKCHAIN_BRANCH_TO_TEST: victor/gateway-fee
CELO_BLOCKCHAIN_BRANCH_TO_TEST: gakonst/uptime

general:
artifacts:
Expand Down
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ NETWORK_ID=1101
CONSENSUS_TYPE="istanbul"
BLOCK_TIME=1
EPOCH=1000
LOOKBACK=12
ISTANBUL_REQUEST_TIMEOUT_MS=3000

# "og" -> our original 4 validators, "${n}" -> for deriving n validators from the MNEMONIC
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/cmds/geth/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const handler = async (argv: RunArgv) => {
verbosity.toString(),
'--consoleoutput=stdout', // Send all logs to stdout
'--consoleformat=term',
'--istanbul.lookbackwindow=2',
]

if (nodekeyhex !== null && nodekeyhex.length > 0) {
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/e2e-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function writeGenesis(validators: Validator[], path: string, configOverrides: an
validators,
blockTime: 0,
epoch: 10,
lookback: 2,
requestTimeout: 3000,
chainId: NetworkId,
...configOverrides,
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/lib/env-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum envVar {
CLUSTER_DOMAIN_NAME = 'CLUSTER_DOMAIN_NAME',
ENV_TYPE = 'ENV_TYPE',
EPOCH = 'EPOCH',
LOOKBACK = 'LOOKBACK',
ETHSTATS_DOCKER_IMAGE_REPOSITORY = 'ETHSTATS_DOCKER_IMAGE_REPOSITORY',
ETHSTATS_DOCKER_IMAGE_TAG = 'ETHSTATS_DOCKER_IMAGE_TAG',
ETHSTATS_WEBSOCKETSECRET = 'ETHSTATS_WEBSOCKETSECRET',
Expand Down
6 changes: 6 additions & 0 deletions packages/celotool/src/lib/generate_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => {
10
)
const epoch = parseInt(fetchEnvOrFallback(envVar.EPOCH, '30000'), 10)
// allow 12 blocks in prod for the uptime metric
const lookbackwindow = parseInt(fetchEnvOrFallback(envVar.LOOKBACK, '12'), 10)
const chainId = parseInt(fetchEnv(envVar.NETWORK_ID), 10)

// Assing DEFAULT ammount of gold to 2 faucet accounts
Expand All @@ -153,6 +155,7 @@ export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => {
blockTime,
initialAccounts: faucetAddresses.concat(oracleAddress),
epoch,
lookbackwindow,
chainId,
requestTimeout,
enablePetersburg,
Expand Down Expand Up @@ -204,6 +207,7 @@ export const generateGenesis = ({
initialAccounts: otherAccounts = [],
blockTime,
epoch,
lookbackwindow,
chainId,
requestTimeout,
enablePetersburg = true,
Expand All @@ -213,6 +217,7 @@ export const generateGenesis = ({
initialAccounts?: string[]
blockTime: number
epoch: number
lookbackwindow: number
chainId: number
requestTimeout: number
enablePetersburg?: boolean
Expand Down Expand Up @@ -241,6 +246,7 @@ export const generateGenesis = ({
period: blockTime,
requesttimeout: requestTimeout,
epoch,
lookbackwindow,
}
}

Expand Down

0 comments on commit 0b6458b

Please sign in to comment.