Skip to content

Commit

Permalink
fix(lib/netconf): fix-omega-deploy (#1293)
Browse files Browse the repository at this point in the history
* Bump network version
* Remove well-known portal contract address from the previous network
version
* Add timeout for StartAllEdges (ping pong test app)
* Improve logging

task: none
  • Loading branch information
pavelnikolov authored Jun 26, 2024
1 parent 8835f62 commit d3c9213
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 8 additions & 0 deletions e2e/netman/pingpong/pingpong.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"golang.org/x/sync/errgroup"
)

const startPingPongEdgesTimeout = 15 * time.Minute

// XDapp defines the deployed pingpong contract xdapp.
// The XDapp is graph of ping pong pairs that connects all chains to all chains.
// So given a network of N chains (vertexes), there will be N! pairs (edges).
Expand Down Expand Up @@ -155,6 +157,8 @@ func (d *XDapp) fund(ctx context.Context) error {
// StartAllEdges starts <parallel> ping pongs for all edges, each doing <count> hops.
func (d *XDapp) StartAllEdges(ctx context.Context, latest, parallel, count uint64) error {
log.Info(ctx, "Starting ping pong contracts")
ctx, cancel := context.WithTimeout(ctx, startPingPongEdgesTimeout)
defer cancel()
eg, ctx := errgroup.WithContext(ctx)
for _, edge := range d.edges {
from := d.contracts[edge.From]
Expand All @@ -163,8 +167,10 @@ func (d *XDapp) StartAllEdges(ctx context.Context, latest, parallel, count uint6
log.Debug(ctx, "Starting ping pong contract",
"from", from.Chain.Name,
"to", to.Chain.Name,
"from_chain_id", from.Chain.ChainID,
"parallel", parallel,
"count", count,
"shards", from.Chain.Shards,
)

shards := from.Chain.Shards
Expand All @@ -188,6 +194,7 @@ func (d *XDapp) StartAllEdges(ctx context.Context, latest, parallel, count uint6
return errors.Wrap(err, "start ping pong", "id", id, "from", from.Chain.Name, "to", to.Chain.Name, "conf", conf)
}

log.Debug(ctx, "Wait for tx to be mined", "id", id, "from", from.Chain.Name, "to", to.Chain.Name, "tx", tx.Hash(), "addr", to.Address.Hex())
if _, err := bind.WaitMined(ctx, backend, tx); err != nil {
return errors.Wrap(err, "wait mined", "chain", from.Chain.Name, "tx", tx.Hash())
}
Expand All @@ -197,6 +204,7 @@ func (d *XDapp) StartAllEdges(ctx context.Context, latest, parallel, count uint6
}
}

log.Debug(ctx, "Waiting for all ping pong edges to start", "timeout", startPingPongEdgesTimeout)
if err := eg.Wait(); err != nil {
return errors.Wrap(err, "wait parallel start")
}
Expand Down
13 changes: 4 additions & 9 deletions lib/netconf/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ var runid = uuid.New().String()
//nolint:gochecknoglobals // Static addresses
var (
// Address matches lib/contracts. We do not import to avoid cylic dependencies. Equivalence asserted in tests.
omegaAVS = common.HexToAddress("0xa7b2e7830C51728832D33421670DbBE30299fD92")
mainnetAVS = common.HexToAddress("0xed2f4d90b073128ae6769a9A8D51547B1Df766C8")
omegaPortal = common.HexToAddress("0x023F42795b245924f110dba51C486888836fb54b")
omegaAVS = common.HexToAddress("0xa7b2e7830C51728832D33421670DbBE30299fD92")
mainnetAVS = common.HexToAddress("0xed2f4d90b073128ae6769a9A8D51547B1Df766C8")
)

//nolint:gochecknoglobals // Static mappings.
Expand All @@ -148,15 +147,11 @@ var statics = map[ID]Static{
},
Omega: {
Network: Omega,
Version: "v0.0.2",
Version: "v0.0.3",
AVSContractAddress: omegaAVS,
OmniExecutionChainID: evmchain.IDOmniOmega,
MaxValidators: maxValidators,
Portals: []Deployment{
{ChainID: evmchain.IDHolesky, Address: omegaPortal, DeployHeight: 1799863},
{ChainID: evmchain.IDOpSepolia, Address: omegaPortal, DeployHeight: 13720175},
{ChainID: evmchain.IDArbSepolia, Address: omegaPortal, DeployHeight: 58215316},
},
Portals: []Deployment{},
},
Mainnet: {
Network: Mainnet,
Expand Down

0 comments on commit d3c9213

Please sign in to comment.