Skip to content

Commit

Permalink
refactor: refactor advancer WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vfusco committed Oct 9, 2024
1 parent 025b772 commit 15e77da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion internal/node/advancer/advancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
24 changes: 7 additions & 17 deletions internal/repository/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/rollupsmachine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 15e77da

Please sign in to comment.