Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Modularize workflow #48

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ packages:
config:
mockname: EthereumClientMock
filename: etherman_client.generated.go
github.com/0xPolygon/agglayer/silencer:
config:
interfaces:
ISilencer:
config:
mockname: SilencerMock
filename: silencer.generated.go
github.com/0xPolygon/agglayer/types:
config:
interfaces:
Expand All @@ -30,7 +37,7 @@ packages:
config:
mockname: ZkEVMClientMock
filename: zk_evm_client.generated.go
IZkEVMClientClientCreator:
IZkEVMClientPool:
config:
mockname: ZkEVMClientClientCreatorMock
filename: zk_evm_client_creator.generated.go
mockname: ZkEVMClientCacheMock
filename: zk_evm_client_cache.generated.go
12 changes: 12 additions & 0 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package aggregator

type Aggregator struct {
}

func New() *Aggregator {
return &Aggregator{}
}

func (a *Aggregator) Aggregate() {

}
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
"github.com/0xPolygon/agglayer/interop"
"github.com/0xPolygon/agglayer/network"
"github.com/0xPolygon/agglayer/rpc"
"github.com/0xPolygon/agglayer/silencer"
"github.com/0xPolygon/agglayer/types"
"github.com/0xPolygon/agglayer/workflow"
)

const appName = "cdk-agglayer"
Expand Down Expand Up @@ -134,14 +137,16 @@ func start(cliCtx *cli.Context) error {
&ethMan,
etm,
)
silencer := silencer.New(c, addr, &ethMan, &types.ZkEVMClientCache{})
workflow := workflow.New(silencer)

// Register services
server := jRPC.NewServer(
c.RPC,
[]jRPC.Service{
{
Name: rpc.INTEROP,
Service: rpc.NewInteropEndpoints(ctx, executor, storage),
Service: rpc.NewInteropEndpoints(ctx, executor, workflow, storage),
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (e *Etherman) BuildTrustedVerifyBatchesTxData(
return nil, err
}

const pendStateNum uint64 = 0 // TODO hardcoded for now until we implement the pending state feature
const pendStateNum = uint64(0) // TODO hardcoded for now until we implement the pending state feature
abi, err := polygonrollupmanager.PolygonrollupmanagerMetaData.GetAbi()
if err != nil {
log.Errorf("error geting ABI: %v, Proof: %s", err)
Expand Down
18 changes: 12 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.21
require (
github.com/0xPolygon/cdk-data-availability v0.0.3
github.com/0xPolygonHermez/zkevm-node v0.5.0-RC4
github.com/cometbft/cometbft v0.38.3
github.com/ethereum/go-ethereum v1.13.8
github.com/gobuffalo/packr/v2 v2.8.3
github.com/jackc/pgconn v1.14.1
Expand Down Expand Up @@ -38,7 +39,8 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cosmos/gogoproto v1.4.11 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
Expand All @@ -64,8 +66,9 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand Down Expand Up @@ -96,8 +99,10 @@ require (
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
Expand All @@ -108,6 +113,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
Expand All @@ -133,13 +139,13 @@ require (
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.15.0 // indirect
Expand Down
Loading
Loading