diff --git a/yarn-project/aztec/src/cli/cmds/start_node.ts b/yarn-project/aztec/src/cli/cmds/start_node.ts index e46e50bc1934..2f5ffdad15e4 100644 --- a/yarn-project/aztec/src/cli/cmds/start_node.ts +++ b/yarn-project/aztec/src/cli/cmds/start_node.ts @@ -1,8 +1,8 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing'; import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node'; -import { Fr } from '@aztec/aztec.js'; +import { EthAddress, Fr } from '@aztec/aztec.js'; import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils'; -import { NULL_KEY } from '@aztec/ethereum'; +import { NULL_KEY, getAddressFromPrivateKey } from '@aztec/ethereum'; import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import type { LogFn } from '@aztec/foundation/log'; import { AztecNodeAdminApiSchema, AztecNodeApiSchema, type PXE } from '@aztec/stdlib/interfaces/client'; @@ -140,6 +140,7 @@ export async function startNode( } } nodeConfig.publisherPrivateKey = sequencerConfig.publisherPrivateKey; + nodeConfig.coinbase ??= EthAddress.fromString(getAddressFromPrivateKey(nodeConfig.publisherPrivateKey)); } if (nodeConfig.p2pEnabled) { diff --git a/yarn-project/sequencer-client/src/sequencer/metrics.ts b/yarn-project/sequencer-client/src/sequencer/metrics.ts index eeb2e8925a42..fd118879cd09 100644 --- a/yarn-project/sequencer-client/src/sequencer/metrics.ts +++ b/yarn-project/sequencer-client/src/sequencer/metrics.ts @@ -136,6 +136,10 @@ export class SequencerMetrics { }); } + public setCoinbase(coinbase: EthAddress) { + this.coinbase = coinbase; + } + public start() { this.meter.addBatchObservableCallback(this.observe, [this.rewards]); } diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 2eceee424483..2162ec33cb5a 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -102,7 +102,7 @@ export class Sequencer { this.metrics = new SequencerMetrics( telemetry, () => this.state, - this._coinbase, + this.config.coinbase ?? this.publisher.getSenderAddress(), this.publisher.getRollupContract(), 'Sequencer', ); @@ -154,6 +154,7 @@ export class Sequencer { } if (config.coinbase) { this._coinbase = config.coinbase; + this.metrics.setCoinbase(this._coinbase); } if (config.feeRecipient) { this._feeRecipient = config.feeRecipient;