@@ -32,7 +32,12 @@ import {
3232import { ProtocolContractAddress } from '@aztec/protocol-contracts' ;
3333import { type ProverNode , type ProverNodeDeps , createProverNode } from '@aztec/prover-node' ;
3434import { createKeyStoreForProver } from '@aztec/prover-node/config' ;
35- import { GlobalVariableBuilder , SequencerClient , type SequencerPublisher } from '@aztec/sequencer-client' ;
35+ import {
36+ FeeProviderImpl ,
37+ GlobalVariableBuilder ,
38+ SequencerClient ,
39+ type SequencerPublisher ,
40+ } from '@aztec/sequencer-client' ;
3641import { PublicProcessorFactory } from '@aztec/simulator/server' ;
3742import {
3843 AttestationsBlockWatcher ,
@@ -86,6 +91,7 @@ import type { NullifierLeafPreimage, PublicDataTreeLeaf, PublicDataTreeLeafPreim
8691import { MerkleTreeId , NullifierMembershipWitness , PublicDataWitness } from '@aztec/stdlib/trees' ;
8792import {
8893 type BlockHeader ,
94+ type FeeProvider ,
8995 type GlobalVariableBuilder as GlobalVariableBuilderInterface ,
9096 type IndexedTxEffect ,
9197 PublicSimulationOutput ,
@@ -151,6 +157,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
151157 protected readonly l1ChainId : number ,
152158 protected readonly version : number ,
153159 protected readonly globalVariableBuilder : GlobalVariableBuilderInterface ,
160+ protected readonly feeProvider : FeeProvider ,
154161 protected readonly epochCache : EpochCacheInterface ,
155162 protected readonly packageVersion : string ,
156163 private peerProofVerifier : ClientProtocolCircuitVerifier ,
@@ -478,13 +485,16 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
478485 } )
479486 . catch ( err => log . error ( 'Failed to start p2p services after archiver sync' , err ) ) ;
480487
481- const globalVariableBuilder = new GlobalVariableBuilder ( dateProvider , publicClient , {
488+ const globalVariableBuilderConfig = {
482489 l1Contracts : config . l1Contracts ,
483490 ethereumSlotDuration : config . ethereumSlotDuration ,
484491 rollupVersion : BigInt ( config . rollupVersion ) ,
485492 l1GenesisTime,
486493 slotDuration : Number ( slotDuration ) ,
487- } ) ;
494+ } ;
495+
496+ const globalVariableBuilder = new GlobalVariableBuilder ( dateProvider , publicClient , globalVariableBuilderConfig ) ;
497+ const feeProvider = new FeeProviderImpl ( dateProvider , publicClient , globalVariableBuilderConfig ) ;
488498
489499 // Validator enabled, create/start relevant service
490500 let sequencer : SequencerClient | undefined ;
@@ -612,6 +622,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
612622 ethereumChain . chainInfo . id ,
613623 config . rollupVersion ,
614624 globalVariableBuilder ,
625+ feeProvider ,
615626 epochCache ,
616627 packageVersion ,
617628 peerProofVerifier ,
@@ -765,12 +776,12 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
765776 }
766777
767778 public async getCurrentMinFees ( ) : Promise < GasFees > {
768- return await this . globalVariableBuilder . getCurrentMinFees ( ) ;
779+ return await this . feeProvider . getCurrentMinFees ( ) ;
769780 }
770781
771782 /** Returns predicted min fees for the current slot and next N slots. */
772783 public async getPredictedMinFees ( manaUsage ?: ManaUsageEstimate ) : Promise < GasFees [ ] > {
773- return await this . globalVariableBuilder . getPredictedMinFees ( manaUsage ) ;
784+ return await this . feeProvider . getPredictedMinFees ( manaUsage ) ;
774785 }
775786
776787 public async getMaxPriorityFees ( ) : Promise < GasFees > {
0 commit comments