diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 2940f8d55d3d..f77bb26a27ca 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -552,9 +552,10 @@ export class AztecNodeService implements AztecNode { this.log.info(`Simulating tx ${await tx.getTxHash()}`); const blockNumber = (await this.blockSource.getBlockNumber()) + 1; - // TODO(benesjan): populate these values from config. - const coinbase = EthAddress.ZERO; - const feeRecipient = AztecAddress.ZERO; + // If sequencer is not initialized, we just set these values to zero for simulation. + const coinbase = this.sequencer?.coinbase || EthAddress.ZERO; + const feeRecipient = this.sequencer?.feeRecipient || AztecAddress.ZERO; + const newGlobalVariables = await this.globalVariableBuilder.buildGlobalVariables( new Fr(blockNumber), coinbase, diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.ts b/yarn-project/sequencer-client/src/client/sequencer-client.ts index 90a3003f5b79..242221f3f5e2 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.ts @@ -86,4 +86,12 @@ export class SequencerClient { public restart() { this.sequencer.restart(); } + + get coinbase() { + return this.sequencer.coinbase; + } + + get feeRecipient() { + return this.sequencer.feeRecipient; + } } diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 7bde40fc098f..da7df333d2d3 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -32,8 +32,8 @@ export class Sequencer { private maxTxsPerBlock = 32; private minTxsPerBLock = 1; // TODO: zero values should not be allowed for the following 2 values in PROD - private coinbase = EthAddress.ZERO; - private feeRecipient = AztecAddress.ZERO; + private _coinbase = EthAddress.ZERO; + private _feeRecipient = AztecAddress.ZERO; private lastPublishedBlock = 0; private state = SequencerState.STOPPED; @@ -68,10 +68,10 @@ export class Sequencer { this.minTxsPerBLock = config.minTxsPerBlock; } if (config.coinbase) { - this.coinbase = config.coinbase; + this._coinbase = config.coinbase; } if (config.feeRecipient) { - this.feeRecipient = config.feeRecipient; + this._feeRecipient = config.feeRecipient; } } @@ -166,8 +166,8 @@ export class Sequencer { const newGlobalVariables = await this.globalsBuilder.buildGlobalVariables( new Fr(newBlockNumber), - this.coinbase, - this.feeRecipient, + this._coinbase, + this._feeRecipient, ); // Filter out invalid txs @@ -421,6 +421,14 @@ export class Sequencer { } return false; } + + get coinbase(): EthAddress { + return this._coinbase; + } + + get feeRecipient(): AztecAddress { + return this._feeRecipient; + } } /**