Skip to content

Commit

Permalink
Refactor: unembedded Engines
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Nov 2, 2023
1 parent 69b9d88 commit a0bde5c
Show file tree
Hide file tree
Showing 67 changed files with 315 additions and 315 deletions.
6 changes: 3 additions & 3 deletions components/dashboard/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ func currentNodeStatus() *nodestatus {
LastPauseGC: m.PauseNs[(m.NumGC+255)%256],
}
// get TangleTime
cl := deps.Protocol.MainEngine.Get().Clock
syncStatus := deps.Protocol.MainEngine.Get().SyncManager.SyncStatus()
cl := deps.Protocol.Engines.Main.Get().Clock
syncStatus := deps.Protocol.Engines.Main.Get().SyncManager.SyncStatus()

status.TangleTime = tangleTime{
Synced: syncStatus.NodeSynced,
Bootstrapped: deps.Protocol.MainEngine.Get().SyncManager.IsBootstrapped(),
Bootstrapped: deps.Protocol.Engines.Main.Get().SyncManager.IsBootstrapped(),
AcceptedBlockSlot: int64(syncStatus.LastAcceptedBlockSlot),
ConfirmedBlockSlot: int64(syncStatus.LastConfirmedBlockSlot),
CommittedSlot: int64(syncStatus.LatestCommitment.Slot()),
Expand Down
20 changes: 10 additions & 10 deletions components/dashboard/explorer_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ func setupExplorerRoutes(routeGroup *echo.Group) {
}

func findBlock(blockID iotago.BlockID) (explorerBlk *ExplorerBlock, err error) {
block, exists := deps.Protocol.MainEngine.Get().Block(blockID)
block, exists := deps.Protocol.Engines.Main.Get().Block(blockID)
if !exists {
return nil, ierrors.Errorf("block not found: %s", blockID.ToHex())
}

cachedBlock, _ := deps.Protocol.MainEngine.Get().BlockCache.Block(blockID)
cachedBlock, _ := deps.Protocol.Engines.Main.Get().BlockCache.Block(blockID)

blockMetadata, err := deps.Protocol.MainEngine.Get().Retainer.BlockMetadata(blockID)
blockMetadata, err := deps.Protocol.Engines.Main.Get().Retainer.BlockMetadata(blockID)
if err != nil {
return nil, ierrors.Wrapf(err, "block metadata %s", blockID.ToHex())
}
Expand Down Expand Up @@ -201,12 +201,12 @@ func getTransaction(c echo.Context) error {
outputID := iotago.OutputID{}
copy(outputID[:], txID[:])

output, err := deps.Protocol.MainEngine.Get().Ledger.Output(outputID)
output, err := deps.Protocol.Engines.Main.Get().Ledger.Output(outputID)
if err != nil {
return err
}

block, exists := deps.Protocol.MainEngine.Get().Block(output.BlockID())
block, exists := deps.Protocol.Engines.Main.Get().Block(output.BlockID())
if !exists {
return ierrors.Errorf("block not found: %s", output.BlockID().ToHex())
}
Expand All @@ -228,12 +228,12 @@ func getTransactionMetadata(c echo.Context) error {
// Get the first output of that transaction (using index 0)
outputID := iotago.OutputID{}
copy(outputID[:], txID[:])
txMetadata, exists := deps.Protocol.MainEngine.Get().Ledger.MemPool().TransactionMetadata(txID)
txMetadata, exists := deps.Protocol.Engines.Main.Get().Ledger.MemPool().TransactionMetadata(txID)
if !exists {
return ierrors.Errorf("tx metadata not found: %s", txID.ToHex())
}

conflicts, _ := deps.Protocol.MainEngine.Get().Ledger.ConflictDAG().ConflictingConflicts(txID)
conflicts, _ := deps.Protocol.Engines.Main.Get().Ledger.ConflictDAG().ConflictingConflicts(txID)

return httpserver.JSONResponse(c, http.StatusOK, NewTransactionMetadata(txMetadata, conflicts))
}
Expand All @@ -244,7 +244,7 @@ func getOutput(c echo.Context) error {
return err
}

output, err := deps.Protocol.MainEngine.Get().Ledger.Output(outputID)
output, err := deps.Protocol.Engines.Main.Get().Ledger.Output(outputID)
if err != nil {
return err
}
Expand All @@ -258,12 +258,12 @@ func getSlotDetailsByID(c echo.Context) error {
return err
}

commitment, err := deps.Protocol.MainEngine.Get().Storage.Commitments().Load(commitmentID.Slot())
commitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(commitmentID.Slot())
if err != nil {
return err
}

diffs, err := deps.Protocol.MainEngine.Get().Ledger.SlotDiffs(commitmentID.Slot())
diffs, err := deps.Protocol.Engines.Main.Get().Ledger.SlotDiffs(commitmentID.Slot())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/tip.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func setupTipsRoutes(routeGroup *echo.Group) {
}

func tips() *TipsResponse {
allTips := append(deps.Protocol.MainEngine.Get().TipManager.StrongTips(), deps.Protocol.MainEngine.Get().TipManager.WeakTips()...)
allTips := append(deps.Protocol.Engines.Main.Get().TipManager.StrongTips(), deps.Protocol.Engines.Main.Get().TipManager.WeakTips()...)
t := make([]string, len(allTips))

for i, tip := range allTips {
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/visualizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func sendVertex(blk *blocks.Block, confirmed bool) {
IsTx: isTx,
IsTxAccepted: func() bool {
if isTx {
txMetadata, exists := deps.Protocol.MainEngine.Get().Ledger.MemPool().TransactionMetadata(lo.PanicOnErr(signedTransaction.Transaction.ID()))
txMetadata, exists := deps.Protocol.Engines.Main.Get().Ledger.MemPool().TransactionMetadata(lo.PanicOnErr(signedTransaction.Transaction.ID()))
if exists {
return txMetadata.IsAccepted()
}
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func runWebSocketStreams(component *app.Component) {
broadcastWsBlock(&wsblk{MsgTypeNodeStatus, currentNodeStatus()})
broadcastWsBlock(&wsblk{MsgTypeNeighborMetric, neighborMetrics()})
broadcastWsBlock(&wsblk{MsgTypeTipsMetric, &tipsInfo{
TotalTips: len(deps.Protocol.MainEngine.Get().TipManager.StrongTips()) + len(deps.Protocol.MainEngine.Get().TipManager.WeakTips()),
TotalTips: len(deps.Protocol.Engines.Main.Get().TipManager.StrongTips()) + len(deps.Protocol.Engines.Main.Get().TipManager.WeakTips()),
}})
case *componentsmetric:
broadcastWsBlock(&wsblk{MsgTypeComponentCounterMetric, x})
Expand Down
6 changes: 3 additions & 3 deletions components/dashboard_metrics/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func nodeInfoExtended() *NodeInfoExtended {

func databaseSizesMetrics() (*DatabaseSizesMetric, error) {
return &DatabaseSizesMetric{
Prunable: deps.Protocol.MainEngine.Get().Storage.PrunableDatabaseSize(),
Permanent: deps.Protocol.MainEngine.Get().Storage.PermanentDatabaseSize(),
Total: deps.Protocol.MainEngine.Get().Storage.Size(),
Prunable: deps.Protocol.Engines.Main.Get().Storage.PrunableDatabaseSize(),
Permanent: deps.Protocol.Engines.Main.Get().Storage.PermanentDatabaseSize(),
Total: deps.Protocol.Engines.Main.Get().Storage.Size(),
Time: time.Now().Unix(),
}, nil
}
2 changes: 1 addition & 1 deletion components/debugapi/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func getSlotBlockIDs(index iotago.SlotIndex) (*BlockChangesResponse, error) {
blocksForSlot, err := deps.Protocol.MainEngine.Get().Storage.Blocks(index)
blocksForSlot, err := deps.Protocol.Engines.Main.Get().Storage.Blocks(index)
if err != nil {
return nil, ierrors.Wrapf(err, "failed to get block storage bucket for slot %d", index)
}
Expand Down
2 changes: 1 addition & 1 deletion components/debugapi/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func configure() error {
return err
}

if block, exists := deps.Protocol.MainEngine.Get().BlockCache.Block(blockID); exists && block.ProtocolBlock() != nil {
if block, exists := deps.Protocol.Engines.Main.Get().BlockCache.Block(blockID); exists && block.ProtocolBlock() != nil {
response := BlockMetadataResponseFromBlock(block)

return httpserver.JSONResponse(c, http.StatusOK, response)
Expand Down
4 changes: 2 additions & 2 deletions components/debugapi/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

//nolint:unparam // we have no error case right now
func validatorsSummary() (*ValidatorsSummaryResponse, error) {
seatManager := deps.Protocol.MainEngine.Get().SybilProtection.SeatManager()
latestSlotIndex := deps.Protocol.MainEngine.Get().Storage.Settings().LatestCommitment().Slot()
seatManager := deps.Protocol.Engines.Main.Get().SybilProtection.SeatManager()
latestSlotIndex := deps.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment().Slot()
latestCommittee := seatManager.Committee(latestSlotIndex)
validatorSeats := []*Validator{}
latestCommittee.Accounts().ForEach(func(id iotago.AccountID, pool *account.Pool) bool {
Expand Down
2 changes: 1 addition & 1 deletion components/debugapi/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func init() {

func storeTransactionsPerSlot(scd *notarization.SlotCommittedDetails) error {
slot := scd.Commitment.Slot()
stateDiff, err := deps.Protocol.MainEngine.Get().Ledger.MemPool().StateDiff(slot)
stateDiff, err := deps.Protocol.Engines.Main.Get().Ledger.MemPool().StateDiff(slot)
if err != nil {
return ierrors.Wrapf(err, "failed to retrieve state diff for slot %d", slot)
}
Expand Down
4 changes: 2 additions & 2 deletions components/inx/server_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

func (s *Server) ReadBlock(_ context.Context, blockID *inx.BlockId) (*inx.RawBlock, error) {
blkID := blockID.Unwrap()
block, exists := deps.Protocol.MainEngine.Get().Block(blkID) // block +1
block, exists := deps.Protocol.Engines.Main.Get().Block(blkID) // block +1
if !exists {
return nil, status.Errorf(codes.NotFound, "block %s not found", blkID.ToHex())
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func (s *Server) attachBlock(ctx context.Context, block *iotago.ProtocolBlock) (
}

func getINXBlockMetadata(blockID iotago.BlockID) (*inx.BlockMetadata, error) {
blockMetadata, err := deps.Protocol.MainEngine.Get().Retainer.BlockMetadata(blockID)
blockMetadata, err := deps.Protocol.Engines.Main.Get().Retainer.BlockMetadata(blockID)
if err != nil {
return nil, ierrors.Errorf("failed to get BlockMetadata: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion components/inx/server_commitments.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *Server) ReadCommitment(_ context.Context, req *inx.CommitmentRequest) (
commitmentSlot = req.GetCommitmentId().Unwrap().Slot()
}

commitment, err := deps.Protocol.MainEngine.Get().Storage.Commitments().Load(commitmentSlot)
commitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(commitmentSlot)
if err != nil {
if ierrors.Is(err, kvstore.ErrKeyNotFound) {
return nil, status.Errorf(codes.NotFound, "commitment slot %d not found", req.GetCommitmentSlot())
Expand Down
4 changes: 2 additions & 2 deletions components/inx/server_issuance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func (s *Server) RequestTips(_ context.Context, req *inx.TipsRequest) (*inx.TipsResponse, error) {
references := deps.Protocol.MainEngine.Get().TipSelection.SelectTips(int(req.GetCount()))
references := deps.Protocol.Engines.Main.Get().TipSelection.SelectTips(int(req.GetCount()))

return &inx.TipsResponse{
StrongTips: inx.NewBlockIds(references[iotago.StrongParentType]),
Expand All @@ -30,7 +30,7 @@ func (s *Server) ValidatePayload(_ context.Context, payload *inx.RawPayload) (*i

switch typedPayload := blockPayload.(type) {
case *iotago.SignedTransaction:
memPool := deps.Protocol.MainEngine.Get().Ledger.MemPool()
memPool := deps.Protocol.Engines.Main.Get().Ledger.MemPool()

inputReferences, inputsErr := memPool.VM().Inputs(typedPayload.Transaction)
if inputsErr != nil {
Expand Down
6 changes: 3 additions & 3 deletions components/inx/server_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func inxNodeStatus(status *syncmanager.SyncStatus) *inx.NodeStatus {
// HasPruned is false when a node just started from a snapshot and keeps data of the LastPrunedEpoch, thus still need
// to send finalized commitment.
if !status.HasPruned || status.LatestFinalizedSlot > deps.Protocol.CommittedAPI().TimeProvider().EpochEnd(status.LastPrunedEpoch) {
finalizedCommitment, err := deps.Protocol.MainEngine.Get().Storage.Commitments().Load(status.LatestFinalizedSlot)
finalizedCommitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(status.LatestFinalizedSlot)
if err != nil {
return nil
}
Expand All @@ -34,7 +34,7 @@ func inxNodeStatus(status *syncmanager.SyncStatus) *inx.NodeStatus {
}

func (s *Server) ReadNodeStatus(context.Context, *inx.NoParams) (*inx.NodeStatus, error) {
return inxNodeStatus(deps.Protocol.MainEngine.Get().SyncManager.SyncStatus()), nil
return inxNodeStatus(deps.Protocol.Engines.Main.Get().SyncManager.SyncStatus()), nil
}

func (s *Server) ListenToNodeStatus(req *inx.NodeStatusRequest, srv inx.INX_ListenToNodeStatusServer) error {
Expand Down Expand Up @@ -95,7 +95,7 @@ func (s *Server) ListenToNodeStatus(req *inx.NodeStatusRequest, srv inx.INX_List

func (s *Server) ReadNodeConfiguration(context.Context, *inx.NoParams) (*inx.NodeConfiguration, error) {
protoParams := make([]*inx.RawProtocolParameters, 0)
provider := deps.Protocol.MainEngine.Get().Storage.Settings().APIProvider()
provider := deps.Protocol.Engines.Main.Get().Storage.Settings().APIProvider()
for _, version := range provider.ProtocolEpochVersions() {
protocolParams := provider.ProtocolParameters(version.Version)
if protocolParams == nil {
Expand Down
18 changes: 9 additions & 9 deletions components/inx/server_utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func NewLedgerOutput(o *utxoledger.Output) (*inx.LedgerOutput, error) {
latestCommitment := deps.Protocol.MainEngine.Get().SyncManager.LatestCommitment()
latestCommitment := deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment()

l := &inx.LedgerOutput{
OutputId: inx.NewOutputId(o.OutputID()),
Expand All @@ -30,7 +30,7 @@ func NewLedgerOutput(o *utxoledger.Output) (*inx.LedgerOutput, error) {

includedSlot := o.SlotBooked()
if includedSlot <= latestCommitment.Slot() {
includedCommitment, err := deps.Protocol.MainEngine.Get().Storage.Commitments().Load(includedSlot)
includedCommitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(includedSlot)
if err != nil {
return nil, ierrors.Wrapf(err, "failed to load commitment with slot: %d", includedSlot)
}
Expand All @@ -52,10 +52,10 @@ func NewLedgerSpent(s *utxoledger.Spent) (*inx.LedgerSpent, error) {
SlotSpent: uint32(s.SlotSpent()),
}

latestCommitment := deps.Protocol.MainEngine.Get().SyncManager.LatestCommitment()
latestCommitment := deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment()
spentSlot := s.SlotSpent()
if spentSlot <= latestCommitment.Slot() {
spentCommitment, err := deps.Protocol.MainEngine.Get().Storage.Commitments().Load(spentSlot)
spentCommitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(spentSlot)
if err != nil {
return nil, ierrors.Wrapf(err, "failed to load commitment with slot: %d", spentSlot)
}
Expand Down Expand Up @@ -118,7 +118,7 @@ func NewLedgerUpdateBatchOperationConsumed(spent *utxoledger.Spent) (*inx.Ledger
}

func (s *Server) ReadOutput(_ context.Context, id *inx.OutputId) (*inx.OutputResponse, error) {
engine := deps.Protocol.MainEngine.Get()
engine := deps.Protocol.Engines.Main.Get()

latestCommitment := engine.Storage.Settings().LatestCommitment()

Expand Down Expand Up @@ -157,7 +157,7 @@ func (s *Server) ReadOutput(_ context.Context, id *inx.OutputId) (*inx.OutputRes
}

func (s *Server) ReadUnspentOutputs(_ *inx.NoParams, srv inx.INX_ReadUnspentOutputsServer) error {
engine := deps.Protocol.MainEngine.Get()
engine := deps.Protocol.Engines.Main.Get()
latestCommitment := engine.Storage.Settings().LatestCommitment()

var innerErr error
Expand Down Expand Up @@ -230,7 +230,7 @@ func (s *Server) ListenToLedgerUpdates(req *inx.SlotRangeRequest, srv inx.INX_Li

sendStateDiffsRange := func(startSlot iotago.SlotIndex, endSlot iotago.SlotIndex) error {
for currentSlot := startSlot; currentSlot <= endSlot; currentSlot++ {
stateDiff, err := deps.Protocol.MainEngine.Get().Ledger.SlotDiffs(currentSlot)
stateDiff, err := deps.Protocol.Engines.Main.Get().Ledger.SlotDiffs(currentSlot)
if err != nil {
return status.Errorf(codes.NotFound, "ledger update for slot %d not found", currentSlot)
}
Expand All @@ -252,15 +252,15 @@ func (s *Server) ListenToLedgerUpdates(req *inx.SlotRangeRequest, srv inx.INX_Li
return 0, nil
}

latestCommitment := deps.Protocol.MainEngine.Get().SyncManager.LatestCommitment()
latestCommitment := deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment()

if startSlot > latestCommitment.Slot() {
// no need to send previous state diffs
return 0, nil
}

// Stream all available milestone diffs first
prunedEpoch, hasPruned := deps.Protocol.MainEngine.Get().SyncManager.LastPrunedEpoch()
prunedEpoch, hasPruned := deps.Protocol.Engines.Main.Get().SyncManager.LastPrunedEpoch()
if hasPruned && startSlot <= deps.Protocol.CommittedAPI().TimeProvider().EpochEnd(prunedEpoch) {
return 0, status.Errorf(codes.InvalidArgument, "given startSlot %d is older than the current pruningSlot %d", startSlot, deps.Protocol.CommittedAPI().TimeProvider().EpochEnd(prunedEpoch))
}
Expand Down
4 changes: 2 additions & 2 deletions components/metrics/metrics_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var AccountMetrics = collector.NewCollection(accountNamespace,
collector.WithPruningDelay(10*time.Minute),
collector.WithInitFunc(func() {
deps.Protocol.Events.Engine.BlockGadget.BlockAccepted.Hook(func(block *blocks.Block) {
accountData, exists, _ := deps.Protocol.MainEngine.Get().Ledger.Account(block.ProtocolBlock().IssuerID, deps.Protocol.MainEngine.Get().SyncManager.LatestCommitment().Slot())
accountData, exists, _ := deps.Protocol.Engines.Main.Get().Ledger.Account(block.ProtocolBlock().IssuerID, deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Slot())
if exists {
deps.Collector.Update(accountNamespace, credits, float64(accountData.Credits.Value), accountData.ID.String())
}
Expand All @@ -34,7 +34,7 @@ var AccountMetrics = collector.NewCollection(accountNamespace,
collector.WithType(collector.Gauge),
collector.WithHelp("Seats seen as active by the node."),
collector.WithCollectFunc(func() (metricValue float64, labelValues []string) {
return float64(deps.Protocol.MainEngine.Get().SybilProtection.SeatManager().OnlineCommittee().Size()), nil
return float64(deps.Protocol.Engines.Main.Get().SybilProtection.SeatManager().OnlineCommittee().Size()), nil
}),
)),
)
4 changes: 2 additions & 2 deletions components/metrics/metrics_conflicts.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var ConflictMetrics = collector.NewCollection(conflictNamespace,
collector.WithHelp("Time since transaction issuance to the conflict acceptance"),
collector.WithInitFunc(func() {
deps.Protocol.Events.Engine.ConflictDAG.ConflictAccepted.Hook(func(conflictID iotago.TransactionID) {
if txMetadata, exists := deps.Protocol.MainEngine.Get().Ledger.MemPool().TransactionMetadata(conflictID); exists {
if txMetadata, exists := deps.Protocol.Engines.Main.Get().Ledger.MemPool().TransactionMetadata(conflictID); exists {
firstAttachmentID := txMetadata.EarliestIncludedAttachment()
if block, blockExists := deps.Protocol.MainEngine.Get().BlockFromCache(firstAttachmentID); blockExists {
if block, blockExists := deps.Protocol.Engines.Main.Get().BlockFromCache(firstAttachmentID); blockExists {
timeSinceIssuance := time.Since(block.IssuingTime()).Milliseconds()
timeIssuanceSeconds := float64(timeSinceIssuance) / 1000
deps.Collector.Update(conflictNamespace, resolutionTime, timeIssuanceSeconds)
Expand Down
4 changes: 2 additions & 2 deletions components/metrics/metrics_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ var DBMetrics = collector.NewCollection(dbNamespace,
collector.WithType(collector.Gauge),
collector.WithHelp("DB size in bytes for permanent storage."),
collector.WithCollectFunc(func() (metricValue float64, labelValues []string) {
return float64(deps.Protocol.MainEngine.Get().Storage.PermanentDatabaseSize()), nil
return float64(deps.Protocol.Engines.Main.Get().Storage.PermanentDatabaseSize()), nil
}),
)),
collector.WithMetric(collector.NewMetric(sizeBytesPrunable,
collector.WithType(collector.Gauge),
collector.WithHelp("DB size in bytes for prunable storage."),
collector.WithCollectFunc(func() (metricValue float64, labelValues []string) {
return float64(deps.Protocol.MainEngine.Get().Storage.PrunableDatabaseSize()), nil
return float64(deps.Protocol.Engines.Main.Get().Storage.PrunableDatabaseSize()), nil
}),
)),
)
2 changes: 1 addition & 1 deletion components/metrics/metrics_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var InfoMetrics = collector.NewCollection(infoNamespace,
collector.WithType(collector.Gauge),
collector.WithHelp("Node sync status based on ATT."),
collector.WithCollectFunc(func() (metricValue float64, labelValues []string) {
if deps.Protocol.MainEngine.Get().SyncManager.IsNodeSynced() {
if deps.Protocol.Engines.Main.Get().SyncManager.IsNodeSynced() {
return 1, nil
}

Expand Down
Loading

0 comments on commit a0bde5c

Please sign in to comment.