From 15e77da45ea5a94427e23abe73a2428d22b0b325 Mon Sep 17 00:00:00 2001 From: Victor Fusco <1221933+vfusco@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:09:59 -0300 Subject: [PATCH] refactor: refactor advancer WIP --- internal/node/advancer/advancer.go | 2 +- internal/repository/machine.go | 24 +++++++----------------- pkg/rollupsmachine/machine.go | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/internal/node/advancer/advancer.go b/internal/node/advancer/advancer.go index 4967aa42f..dab611bf1 100644 --- a/internal/node/advancer/advancer.go +++ b/internal/node/advancer/advancer.go @@ -48,7 +48,7 @@ func (advancer *Advancer) Poller(pollingInterval time.Duration) (*poller.Poller, // Step steps the Advancer for one processing cycle. // It gets unprocessed inputs from the repository, // runs them through the cartesi machine, -// and updates the repository with the ouputs. +// and updates the repository with the outputs. func (advancer *Advancer) Step(ctx context.Context) error { apps := advancer.machines.Apps() diff --git a/internal/repository/machine.go b/internal/repository/machine.go index 16a38e35b..5bf2b26b5 100644 --- a/internal/repository/machine.go +++ b/internal/repository/machine.go @@ -26,25 +26,15 @@ func (repo *MachineRepository) GetMachineConfigurations( ctx context.Context, ) ([]*machines.MachineConfig, error) { // TODO: Fetch from db and Rework tables. ref. backup/feature/advancer-repository - var myInt6 uint64 = 6 res := []*machines.MachineConfig{{ - AppAddress: common.BytesToAddress([]byte("\xbe\xad")), - SnapshotPath: "path/to/template/uri/2", + AppAddress: common.HexToAddress("0xD81aA03CBbA5236F6554592B33060706017FAec6"), + SnapshotPath: "applications/echo-dapp", SnapshotInputIndex: nil, - IncCycles: 0, - MaxCycles: 0, - AdvanceTimeout: time.Duration(0), - InspectTimeout: time.Duration(0), - MaxConcurrentInspects: 0, - }, { - AppAddress: common.BytesToAddress([]byte("\xbe\xef")), - SnapshotPath: "path/to/snapshot/2", - SnapshotInputIndex: &myInt6, - IncCycles: 0, - MaxCycles: 0, - AdvanceTimeout: time.Duration(0), - InspectTimeout: time.Duration(0), - MaxConcurrentInspects: 0, + IncCycles: 1234234214124, + MaxCycles: 1234234214124, + AdvanceTimeout: time.Duration(60000), + InspectTimeout: time.Duration(60000), + MaxConcurrentInspects: 10, }} return res, nil } diff --git a/pkg/rollupsmachine/machine.go b/pkg/rollupsmachine/machine.go index 2646bc9fc..21f066a76 100644 --- a/pkg/rollupsmachine/machine.go +++ b/pkg/rollupsmachine/machine.go @@ -172,7 +172,7 @@ func (machine *rollupsMachine) lastRequestWasAccepted(ctx context.Context) (bool } } -// process processes a request, be it an avance-state or an inspect-state request. +// process processes a request, be it an advance-state or an inspect-state request. // It returns the accepted state and any collected responses. // // It expects the machine to be ready to receive requests before execution,