Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/celotool/src/e2e-tests/governance_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ describe('governance tests', () => {
wsport: 8559,
rpcport: 9559,
privateKey: rotation0PrivateKey.slice(2),
minerValidator: privateKeyToAddress(rotation0PrivateKey.slice(2)),
},
{
name: 'validator2KeyRotation1',
Expand All @@ -933,6 +934,7 @@ describe('governance tests', () => {
wsport: 8561,
rpcport: 9561,
privateKey: rotation1PrivateKey.slice(2),
minerValidator: privateKeyToAddress(rotation1PrivateKey.slice(2)),
},
]

Expand Down
2 changes: 2 additions & 0 deletions packages/celotool/src/e2e-tests/replica_tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BlockHeader } from '@celo/connect'
import { DefaultRpcCaller, RpcCaller } from '@celo/connect/lib/utils/rpc-caller'
import { privateKeyToAddress } from '@celo/utils/lib/address'
import { bitIsSet, parseBlockExtraData } from '@celo/utils/lib/istanbul'
import { assert } from 'chai'
import Web3 from 'web3'
Expand Down Expand Up @@ -138,6 +139,7 @@ describe('replica swap tests', () => {
port: 30315,
rpcport: 8555,
privateKey: gethConfig.instances[0].privateKey,
minerValidator: privateKeyToAddress(gethConfig.instances[0].privateKey!),
proxy: 'validator0-proxy0',
isProxied: true,
proxyport: 30304,
Expand Down
3 changes: 2 additions & 1 deletion packages/celotool/src/e2e-tests/transfer_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ describe('Transfer tests', function(this: any) {
rpcport: 8547,
// We need to set an etherbase here so that the full node will accept transactions from
// light clients.
etherbase: FeeRecipientAddress,
minerValidator: FeeRecipientAddress,
txFeeRecipient: FeeRecipientAddress,
}

const restartWithCleanNodes = async () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/celotool/src/e2e-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ export function getContext(gethConfig: GethRunConfig, verbose: boolean = verbose
instance.privateKey = instance.privateKey || proxyPrivateKeys[proxyIndex]
proxyIndex++
}

if (!instance.minerValidator && (instance.validating || instance.isProxied)) {
instance.minerValidator = privateKeyToAddress(instance.privateKey!)
}
}

// The proxies will need to know their proxied validator's address
Expand Down
23 changes: 17 additions & 6 deletions packages/celotool/src/lib/geth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,12 @@ export async function startGeth(

const privateKey = instance.privateKey || ''
const lightserv = instance.lightserv || false
const etherbase = instance.etherbase || ''
const minerValidator = instance.minerValidator
if (instance.validating && !minerValidator) {
throw new Error('miner.validator address from the instance is required')
}
// TODO(ponti): add flag after Donut fork
// const txFeeRecipient = instance.txFeeRecipient || minerValidator
const verbosity = gethConfig.verbosity ? gethConfig.verbosity : '3'
let blocktime: number = 1

Expand Down Expand Up @@ -916,9 +921,19 @@ export async function startGeth(
'--allow-insecure-unlock', // geth1.9 to use http w/unlocking
'--gcmode=archive', // Needed to retrieve historical state
'--istanbul.blockperiod',
blocktime.toString(),
blocktime.toString()
]

if (minerValidator) {
gethArgs.push(
'--etherbase', // TODO(ponti): change to '--miner.validator' after deprecating the 'etherbase' flag
minerValidator
)
// TODO(ponti): add flag after Donut fork
// '--tx-fee-recipient',
// txFeeRecipient
}

if (rpcport) {
gethArgs.push(
'--rpc',
Expand All @@ -939,10 +954,6 @@ export async function startGeth(
)
}

if (etherbase) {
gethArgs.push('--etherbase', etherbase)
}

if (lightserv) {
gethArgs.push('--light.serve=90')
gethArgs.push('--light.maxpeers=10')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BigNumber from 'bignumber.js'
import BigNumber from 'bignumber.js';

export interface GethInstanceConfig {
name: string
Expand All @@ -12,7 +12,8 @@ export interface GethInstanceConfig {
wsport?: number
lightserv?: boolean
privateKey?: string
etherbase?: string
minerValidator?: string
txFeeRecipient?: string
proxies?: Array<string[2]>
pid?: number
isProxied?: boolean
Expand Down