From 56cf37a7ecee3de2d8eae0456c4360f3023922e9 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:51:52 -0600 Subject: [PATCH] Node: Update Celo watcher (#4210) * Node: Update Celo watcher * Code review rework --- .github/workflows/build.yml | 2 +- Makefile | 3 +- node/Dockerfile | 2 +- node/Makefile | 14 +- node/hack/parse_eth_tx/parse_eth_tx.go | 15 +- node/hack/query/ccqlistener/Dockerfile | 2 +- node/pkg/node/node_test.go | 2 +- node/pkg/watchers/evm/config.go | 4 +- node/pkg/watchers/evm/connectors/celo.go | 291 --- .../watchers/evm/connectors/celoabi/abi.go | 1900 ----------------- node/pkg/watchers/evm/watcher.go | 29 +- 11 files changed, 23 insertions(+), 2241 deletions(-) delete mode 100644 node/pkg/watchers/evm/connectors/celo.go delete mode 100644 node/pkg/watchers/evm/connectors/celoabi/abi.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a414bf0cd5..40d5624dab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -332,7 +332,7 @@ jobs: go-version: "1.23.3" # The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols. - name: Run golang tests - run: cd node && go test -v -timeout 5m -race -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./... + run: cd node && go test -v -timeout 5m -race ./... # Run Rust lints and tests rust-lint-and-tests: diff --git a/Makefile b/Makefile index a9b8a53b60..5472293fef 100755 --- a/Makefile +++ b/Makefile @@ -38,7 +38,6 @@ node: $(BIN)/guardiand .PHONY: $(BIN)/guardiand $(BIN)/guardiand: CGO_ENABLED=1 $(BIN)/guardiand: dirs generate - @# The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols. - cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION} -extldflags -Wl,--allow-multiple-definition" \ + cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION}" \ -mod=readonly -o ../$(BIN)/guardiand \ github.com/certusone/wormhole/node diff --git a/node/Dockerfile b/node/Dockerfile index c84b4772e5..646a931bda 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -19,7 +19,7 @@ ARG GO_BUILD_ARGS=-race RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ export CGO_ENABLED=1 && \ cd node && \ - go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-extldflags "-Wl,--allow-multiple-definition" -X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /guardiand github.com/certusone/wormhole/node && \ + go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /guardiand github.com/certusone/wormhole/node && \ go get github.com/CosmWasm/wasmvm@v1.1.1 && \ cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.1.1/internal/api/libwasmvm.*.so /usr/lib/ diff --git a/node/Makefile b/node/Makefile index 5fc2c94974..fca11d951d 100644 --- a/node/Makefile +++ b/node/Makefile @@ -1,13 +1,3 @@ -.PHONY test +.PHONY: test test: -# Use this command on amd64 systems - go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./... - -.PHONY test-arm64 -test-arm64: -# Use this command on arm64, otherwise you will encounter linker errors. -# It's not perfect: it will fail due to 'undefined symbols' errors -# for packges using cgo. Still, it will get you farther than running -# the default command. -# To test a single package, use these -ldflags with e.g. ./pkg/governor - go test -ldflags '-extldflags "-Wl,-ld_classic " ' ./... + go test -v ./... diff --git a/node/hack/parse_eth_tx/parse_eth_tx.go b/node/hack/parse_eth_tx/parse_eth_tx.go index 13e91f63a7..5f6fb0d9e1 100644 --- a/node/hack/parse_eth_tx/parse_eth_tx.go +++ b/node/hack/parse_eth_tx/parse_eth_tx.go @@ -1,5 +1,5 @@ // To compile: -// go build --ldflags '-extldflags "-Wl,--allow-multiple-definition"' -o parse_eth_tx +// go build -o parse_eth_tx // Usage: // ./parse_eth_tx -chainID=14 -ethRPC=wss://alfajores-forno.celo-testnet.org/ws -contractAddr=0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56 -tx=0x20a1e7e491dd82b6b33db0820e88a96b58bac28d65770ea73af80e457745aab1 @@ -39,16 +39,9 @@ func main() { var ethIntf connectors.Connector var err error - if chainID == vaa.ChainIDCelo { - ethIntf, err = connectors.NewCeloConnector(ctx, "", *flagEthRPC, contractAddr, zap.L()) - if err != nil { - log.Fatalf("dialing eth client failed: %v", err) - } - } else { - ethIntf, err = connectors.NewEthereumBaseConnector(ctx, "", *flagEthRPC, contractAddr, zap.L()) - if err != nil { - log.Fatalf("dialing eth client failed: %v", err) - } + ethIntf, err = connectors.NewEthereumBaseConnector(ctx, "", *flagEthRPC, contractAddr, zap.L()) + if err != nil { + log.Fatalf("dialing eth client failed: %v", err) } transactionHash := ethCommon.HexToHash(*flagTx) diff --git a/node/hack/query/ccqlistener/Dockerfile b/node/hack/query/ccqlistener/Dockerfile index 0dfb3b36ef..51cb3988b8 100644 --- a/node/hack/query/ccqlistener/Dockerfile +++ b/node/hack/query/ccqlistener/Dockerfile @@ -18,7 +18,7 @@ ARG GO_BUILD_ARGS=-race RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ export CGO_ENABLED=1 && \ cd node/hack/query/ccqlistener && \ - go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-extldflags "-Wl,--allow-multiple-definition" -X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /ccqlistener ccqlistener.go && \ + go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /ccqlistener ccqlistener.go && \ go get github.com/CosmWasm/wasmvm@v1.1.1 && \ cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.1.1/internal/api/libwasmvm.x86_64.so /usr/lib/ diff --git a/node/pkg/node/node_test.go b/node/pkg/node/node_test.go index 05b260b4d2..f7ad4c7171 100644 --- a/node/pkg/node/node_test.go +++ b/node/pkg/node/node_test.go @@ -1146,7 +1146,7 @@ func BenchmarkCrypto(b *testing.B) { // How to run: // -// go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' -bench ^BenchmarkConsensus -benchtime=1x -count 1 -run ^$ > bench.log; tail bench.log +// go test -v -bench ^BenchmarkConsensus -benchtime=1x -count 1 -run ^$ > bench.log; tail bench.log func BenchmarkConsensus(b *testing.B) { require.Equal(b, b.N, 1) //CONSOLE_LOG_LEVEL = zap.DebugLevel diff --git a/node/pkg/watchers/evm/config.go b/node/pkg/watchers/evm/config.go index 9fe8dfa8b7..92a751a47e 100644 --- a/node/pkg/watchers/evm/config.go +++ b/node/pkg/watchers/evm/config.go @@ -53,9 +53,7 @@ func (wc *WatcherConfig) Create( setWriteC = setC } - var devMode bool = (env == common.UnsafeDevNet) - - watcher := NewEthWatcher(wc.Rpc, eth_common.HexToAddress(wc.Contract), string(wc.NetworkID), wc.ChainID, msgC, setWriteC, obsvReqC, queryReqC, queryResponseC, devMode, wc.CcqBackfillCache) + watcher := NewEthWatcher(wc.Rpc, eth_common.HexToAddress(wc.Contract), string(wc.NetworkID), wc.ChainID, msgC, setWriteC, obsvReqC, queryReqC, queryResponseC, env, wc.CcqBackfillCache) watcher.SetL1Finalizer(wc.l1Finalizer) return watcher, watcher.Run, nil } diff --git a/node/pkg/watchers/evm/connectors/celo.go b/node/pkg/watchers/evm/connectors/celo.go deleted file mode 100644 index fcf5c1e96f..0000000000 --- a/node/pkg/watchers/evm/connectors/celo.go +++ /dev/null @@ -1,291 +0,0 @@ -package connectors - -import ( - "context" - "time" - - celoAbi "github.com/certusone/wormhole/node/pkg/watchers/evm/connectors/celoabi" - ethAbi "github.com/certusone/wormhole/node/pkg/watchers/evm/connectors/ethabi" - - celoBind "github.com/celo-org/celo-blockchain/accounts/abi/bind" - celoCommon "github.com/celo-org/celo-blockchain/common" - celoTypes "github.com/celo-org/celo-blockchain/core/types" - celoClient "github.com/celo-org/celo-blockchain/ethclient" - celoRpc "github.com/celo-org/celo-blockchain/rpc" - - ethereum "github.com/ethereum/go-ethereum" - ethCommon "github.com/ethereum/go-ethereum/common" - ethTypes "github.com/ethereum/go-ethereum/core/types" - ethClient "github.com/ethereum/go-ethereum/ethclient" - ethEvent "github.com/ethereum/go-ethereum/event" - ethRpc "github.com/ethereum/go-ethereum/rpc" - - "github.com/certusone/wormhole/node/pkg/common" - "go.uber.org/zap" -) - -// CeloConnector implements EVM network query capabilities for the Celo network. It's almost identical to -// EthereumConnector except it's using the Celo fork and provides shims between their respective types. -type CeloConnector struct { - networkName string - address ethCommon.Address - logger *zap.Logger - client *celoClient.Client - rawClient *celoRpc.Client - filterer *celoAbi.AbiFilterer - caller *celoAbi.AbiCaller -} - -func NewCeloConnector(ctx context.Context, networkName, rawUrl string, address ethCommon.Address, logger *zap.Logger) (*CeloConnector, error) { - rawClient, err := celoRpc.DialContext(ctx, rawUrl) - if err != nil { - return nil, err - } - client := celoClient.NewClient(rawClient) - - filterer, err := celoAbi.NewAbiFilterer(celoCommon.BytesToAddress(address.Bytes()), client) - if err != nil { - panic(err) - } - caller, err := celoAbi.NewAbiCaller(celoCommon.BytesToAddress(address.Bytes()), client) - if err != nil { - panic(err) - } - - return &CeloConnector{ - networkName: networkName, - address: address, - logger: logger, - client: client, - rawClient: rawClient, - filterer: filterer, - caller: caller, - }, nil -} - -func (c *CeloConnector) NetworkName() string { - return c.networkName -} - -func (c *CeloConnector) ContractAddress() ethCommon.Address { - return c.address -} - -func (c *CeloConnector) GetCurrentGuardianSetIndex(ctx context.Context) (uint32, error) { - opts := &celoBind.CallOpts{Context: ctx} - return c.caller.GetCurrentGuardianSetIndex(opts) -} - -func (c *CeloConnector) GetGuardianSet(ctx context.Context, index uint32) (ethAbi.StructsGuardianSet, error) { - opts := &celoBind.CallOpts{Context: ctx} - celoGs, err := c.caller.GetGuardianSet(opts, index) - if err != nil { - return ethAbi.StructsGuardianSet{}, err - } - - ethKeys := make([]ethCommon.Address, len(celoGs.Keys)) - for n, k := range celoGs.Keys { - ethKeys[n] = ethCommon.BytesToAddress(k.Bytes()) - } - - return ethAbi.StructsGuardianSet{ - Keys: ethKeys, - ExpirationTime: celoGs.ExpirationTime, - }, err -} - -func (c *CeloConnector) WatchLogMessagePublished(ctx context.Context, errC chan error, sink chan<- *ethAbi.AbiLogMessagePublished) (ethEvent.Subscription, error) { - timeout, cancel := context.WithTimeout(ctx, 15*time.Second) - defer cancel() - messageC := make(chan *celoAbi.AbiLogMessagePublished, 2) - messageSub, err := c.filterer.WatchLogMessagePublished(&celoBind.WatchOpts{Context: timeout}, messageC, nil) - if err != nil { - return messageSub, err - } - - // The purpose of this is to map events from the Celo log message channel to the Eth log message channel. - common.RunWithScissors(ctx, errC, "celo_connector_watch_log", func(ctx context.Context) error { - for { - select { - // This will return when the subscription is unsubscribed as the error channel gets closed - case <-messageSub.Err(): - return nil - case celoEvent := <-messageC: - sink <- convertCeloEventToEth(celoEvent) - } - } - }) - - return messageSub, err -} - -func (c *CeloConnector) TransactionReceipt(ctx context.Context, txHash ethCommon.Hash) (*ethTypes.Receipt, error) { - celoReceipt, err := c.client.TransactionReceipt(ctx, celoCommon.BytesToHash(txHash.Bytes())) - if err != nil { - return nil, err - } - - return convertCeloReceiptToEth(celoReceipt), err -} - -func (c *CeloConnector) TimeOfBlockByHash(ctx context.Context, hash ethCommon.Hash) (uint64, error) { - block, err := c.client.HeaderByHash(ctx, celoCommon.BytesToHash(hash.Bytes())) - if err != nil { - return 0, err - } - - return block.Time, err -} - -func (c *CeloConnector) ParseLogMessagePublished(ethLog ethTypes.Log) (*ethAbi.AbiLogMessagePublished, error) { - celoEvent, err := c.filterer.ParseLogMessagePublished(*convertCeloLogFromEth(ðLog)) - if err != nil { - return nil, err - } - - return convertCeloEventToEth(celoEvent), err -} - -func (c *CeloConnector) SubscribeForBlocks(ctx context.Context, errC chan error, sink chan<- *NewBlock) (ethereum.Subscription, error) { - headSink := make(chan *celoTypes.Header, 2) - headerSubscription, err := c.client.SubscribeNewHead(ctx, headSink) - if err != nil { - return headerSubscription, err - } - - // The purpose of this is to map events from the Celo event channel to the new block event channel. - common.RunWithScissors(ctx, errC, "celo_connector_subscribe_for_block", func(ctx context.Context) error { - for { - select { - case <-ctx.Done(): - return nil - case ev := <-headSink: - if ev == nil { - c.logger.Error("new header event is nil") - continue - } - if ev.Number == nil { - c.logger.Error("new header block number is nil") - continue - } - hash := ethCommon.BytesToHash(ev.Hash().Bytes()) - sink <- &NewBlock{ - Number: ev.Number, - Hash: hash, - Time: ev.Time, - Finality: Finalized, - } - sink <- &NewBlock{ - Number: ev.Number, - Hash: hash, - Time: ev.Time, - Finality: Safe, - } - sink <- &NewBlock{ - Number: ev.Number, - Hash: hash, - Time: ev.Time, - Finality: Latest, - } - } - } - }) - - return headerSubscription, err -} - -func (c *CeloConnector) RawCallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { - return c.rawClient.CallContext(ctx, result, method, args...) -} - -func (c *CeloConnector) RawBatchCallContext(ctx context.Context, b []ethRpc.BatchElem) error { - celoB := make([]celoRpc.BatchElem, len(b)) - for i, v := range b { - celoB[i] = celoRpc.BatchElem{ - Method: v.Method, - Args: v.Args, - Result: v.Result, - Error: v.Error, - } - } - return c.rawClient.BatchCallContext(ctx, celoB) -} - -func (c *CeloConnector) Client() *ethClient.Client { - panic("unimplemented") -} - -func (c *CeloConnector) SubscribeNewHead(ctx context.Context, ch chan<- *ethTypes.Header) (ethereum.Subscription, error) { - panic("unimplemented") -} - -func convertCeloEventToEth(ev *celoAbi.AbiLogMessagePublished) *ethAbi.AbiLogMessagePublished { - return ðAbi.AbiLogMessagePublished{ - Sender: ethCommon.BytesToAddress(ev.Sender.Bytes()), - Sequence: ev.Sequence, - Nonce: ev.Nonce, - Payload: ev.Payload, - ConsistencyLevel: ev.ConsistencyLevel, - Raw: *convertCeloLogToEth(&ev.Raw), - } -} - -func convertCeloLogToEth(l *celoTypes.Log) *ethTypes.Log { - topics := make([]ethCommon.Hash, len(l.Topics)) - for n, t := range l.Topics { - topics[n] = ethCommon.BytesToHash(t.Bytes()) - } - - return ðTypes.Log{ - Address: ethCommon.BytesToAddress(l.Address.Bytes()), - Topics: topics, - Data: l.Data, - BlockNumber: l.BlockNumber, - TxHash: ethCommon.BytesToHash(l.TxHash.Bytes()), - TxIndex: l.TxIndex, - BlockHash: ethCommon.BytesToHash(l.BlockHash.Bytes()), - Index: l.Index, - Removed: l.Removed, - } -} - -func convertCeloReceiptToEth(celoReceipt *celoTypes.Receipt) *ethTypes.Receipt { - ethLogs := make([]*ethTypes.Log, len(celoReceipt.Logs)) - for n, l := range celoReceipt.Logs { - ethLogs[n] = convertCeloLogToEth(l) - } - - return ðTypes.Receipt{ - Type: celoReceipt.Type, - PostState: celoReceipt.PostState, - Status: celoReceipt.Status, - CumulativeGasUsed: celoReceipt.CumulativeGasUsed, - Bloom: ethTypes.BytesToBloom(celoReceipt.Bloom.Bytes()), - Logs: ethLogs, - TxHash: ethCommon.BytesToHash(celoReceipt.TxHash.Bytes()), - ContractAddress: ethCommon.BytesToAddress(celoReceipt.ContractAddress.Bytes()), - GasUsed: celoReceipt.GasUsed, - BlockHash: ethCommon.BytesToHash(celoReceipt.BlockHash.Bytes()), - BlockNumber: celoReceipt.BlockNumber, - TransactionIndex: celoReceipt.TransactionIndex, - } -} - -func convertCeloLogFromEth(l *ethTypes.Log) *celoTypes.Log { - topics := make([]celoCommon.Hash, len(l.Topics)) - for n, t := range l.Topics { - topics[n] = celoCommon.BytesToHash(t.Bytes()) - } - - return &celoTypes.Log{ - Address: celoCommon.BytesToAddress(l.Address.Bytes()), - Topics: topics, - Data: l.Data, - BlockNumber: l.BlockNumber, - TxHash: celoCommon.BytesToHash(l.TxHash.Bytes()), - TxIndex: l.TxIndex, - BlockHash: celoCommon.BytesToHash(l.BlockHash.Bytes()), - Index: l.Index, - Removed: l.Removed, - } -} diff --git a/node/pkg/watchers/evm/connectors/celoabi/abi.go b/node/pkg/watchers/evm/connectors/celoabi/abi.go deleted file mode 100644 index 7e0a186a35..0000000000 --- a/node/pkg/watchers/evm/connectors/celoabi/abi.go +++ /dev/null @@ -1,1900 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package celoabi - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/celo-org/celo-blockchain" - "github.com/celo-org/celo-blockchain/accounts/abi" - "github.com/celo-org/celo-blockchain/accounts/abi/bind" - "github.com/celo-org/celo-blockchain/common" - "github.com/celo-org/celo-blockchain/core/types" - "github.com/celo-org/celo-blockchain/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// GovernanceStructsContractUpgrade is an auto generated low-level Go binding around an user-defined struct. -type GovernanceStructsContractUpgrade struct { - Module [32]byte - Action uint8 - Chain uint16 - NewContract common.Address -} - -// GovernanceStructsGuardianSetUpgrade is an auto generated low-level Go binding around an user-defined struct. -type GovernanceStructsGuardianSetUpgrade struct { - Module [32]byte - Action uint8 - Chain uint16 - NewGuardianSet StructsGuardianSet - NewGuardianSetIndex uint32 -} - -// GovernanceStructsSetMessageFee is an auto generated low-level Go binding around an user-defined struct. -type GovernanceStructsSetMessageFee struct { - Module [32]byte - Action uint8 - Chain uint16 - MessageFee *big.Int -} - -// GovernanceStructsTransferFees is an auto generated low-level Go binding around an user-defined struct. -type GovernanceStructsTransferFees struct { - Module [32]byte - Action uint8 - Chain uint16 - Amount *big.Int - Recipient [32]byte -} - -// StructsGuardianSet is an auto generated low-level Go binding around an user-defined struct. -type StructsGuardianSet struct { - Keys []common.Address - ExpirationTime uint32 -} - -// StructsSignature is an auto generated low-level Go binding around an user-defined struct. -type StructsSignature struct { - R [32]byte - S [32]byte - V uint8 - GuardianIndex uint8 -} - -// StructsVM is an auto generated low-level Go binding around an user-defined struct. -type StructsVM struct { - Version uint8 - Timestamp uint32 - Nonce uint32 - EmitterChainId uint16 - EmitterAddress [32]byte - Sequence uint64 - ConsistencyLevel uint8 - Payload []byte - GuardianSetIndex uint32 - Signatures []StructsSignature - Hash [32]byte -} - -// AbiMetaData contains all meta data concerning the Abi contract. -var AbiMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldContract\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newContract\",\"type\":\"address\"}],\"name\":\"ContractUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"GuardianSetAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"}],\"name\":\"LogMessagePublished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\",\"payable\":true},{\"inputs\":[],\"name\":\"chainId\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"getCurrentGuardianSetIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"getGuardianSet\",\"outputs\":[{\"components\":[{\"internalType\":\"address[]\",\"name\":\"keys\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"expirationTime\",\"type\":\"uint32\"}],\"internalType\":\"structStructs.GuardianSet\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"getGuardianSetExpiry\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"governanceActionIsConsumed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"governanceChainId\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"governanceContract\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"impl\",\"type\":\"address\"}],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[],\"name\":\"messageFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"emitter\",\"type\":\"address\"}],\"name\":\"nextSequence\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedVM\",\"type\":\"bytes\"}],\"name\":\"parseAndVerifyVM\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"emitterChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"emitterAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"guardianSetIndex\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"guardianIndex\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"internalType\":\"structStructs.VM\",\"name\":\"vm\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedUpgrade\",\"type\":\"bytes\"}],\"name\":\"parseContractUpgrade\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"module\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"chain\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"newContract\",\"type\":\"address\"}],\"internalType\":\"structGovernanceStructs.ContractUpgrade\",\"name\":\"cu\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedUpgrade\",\"type\":\"bytes\"}],\"name\":\"parseGuardianSetUpgrade\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"module\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"chain\",\"type\":\"uint16\"},{\"components\":[{\"internalType\":\"address[]\",\"name\":\"keys\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"expirationTime\",\"type\":\"uint32\"}],\"internalType\":\"structStructs.GuardianSet\",\"name\":\"newGuardianSet\",\"type\":\"tuple\"},{\"internalType\":\"uint32\",\"name\":\"newGuardianSetIndex\",\"type\":\"uint32\"}],\"internalType\":\"structGovernanceStructs.GuardianSetUpgrade\",\"name\":\"gsu\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedSetMessageFee\",\"type\":\"bytes\"}],\"name\":\"parseSetMessageFee\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"module\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"chain\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"messageFee\",\"type\":\"uint256\"}],\"internalType\":\"structGovernanceStructs.SetMessageFee\",\"name\":\"smf\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedTransferFees\",\"type\":\"bytes\"}],\"name\":\"parseTransferFees\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"module\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"action\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"chain\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"}],\"internalType\":\"structGovernanceStructs.TransferFees\",\"name\":\"tf\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedVM\",\"type\":\"bytes\"}],\"name\":\"parseVM\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"emitterChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"emitterAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"guardianSetIndex\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"guardianIndex\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"internalType\":\"structStructs.VM\",\"name\":\"vm\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_vm\",\"type\":\"bytes\"}],\"name\":\"submitContractUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_vm\",\"type\":\"bytes\"}],\"name\":\"submitNewGuardianSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_vm\",\"type\":\"bytes\"}],\"name\":\"submitSetMessageFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_vm\",\"type\":\"bytes\"}],\"name\":\"submitTransferFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"guardianIndex\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address[]\",\"name\":\"keys\",\"type\":\"address[]\"},{\"internalType\":\"uint32\",\"name\":\"expirationTime\",\"type\":\"uint32\"}],\"internalType\":\"structStructs.GuardianSet\",\"name\":\"guardianSet\",\"type\":\"tuple\"}],\"name\":\"verifySignatures\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\",\"constant\":true},{\"inputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"emitterChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes32\",\"name\":\"emitterAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"guardianSetIndex\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"guardianIndex\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"internalType\":\"structStructs.VM\",\"name\":\"vm\",\"type\":\"tuple\"}],\"name\":\"verifyVM\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"valid\",\"type\":\"bool\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\",\"constant\":true},{\"stateMutability\":\"payable\",\"type\":\"receive\",\"payable\":true},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"}],\"name\":\"publishMessage\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"}],\"stateMutability\":\"payable\",\"type\":\"function\",\"payable\":true}]", -} - -// AbiABI is the input ABI used to generate the binding from. -// Deprecated: Use AbiMetaData.ABI instead. -var AbiABI = AbiMetaData.ABI - -// Abi is an auto generated Go binding around an Ethereum contract. -type Abi struct { - AbiCaller // Read-only binding to the contract - AbiTransactor // Write-only binding to the contract - AbiFilterer // Log filterer for contract events -} - -// AbiCaller is an auto generated read-only Go binding around an Ethereum contract. -type AbiCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AbiTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AbiTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AbiFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AbiFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AbiSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AbiSession struct { - Contract *Abi // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AbiCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AbiCallerSession struct { - Contract *AbiCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AbiTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AbiTransactorSession struct { - Contract *AbiTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AbiRaw is an auto generated low-level Go binding around an Ethereum contract. -type AbiRaw struct { - Contract *Abi // Generic contract binding to access the raw methods on -} - -// AbiCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AbiCallerRaw struct { - Contract *AbiCaller // Generic read-only contract binding to access the raw methods on -} - -// AbiTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AbiTransactorRaw struct { - Contract *AbiTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAbi creates a new instance of Abi, bound to a specific deployed contract. -func NewAbi(address common.Address, backend bind.ContractBackend) (*Abi, error) { - contract, err := bindAbi(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Abi{AbiCaller: AbiCaller{contract: contract}, AbiTransactor: AbiTransactor{contract: contract}, AbiFilterer: AbiFilterer{contract: contract}}, nil -} - -// NewAbiCaller creates a new read-only instance of Abi, bound to a specific deployed contract. -func NewAbiCaller(address common.Address, caller bind.ContractCaller) (*AbiCaller, error) { - contract, err := bindAbi(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AbiCaller{contract: contract}, nil -} - -// NewAbiTransactor creates a new write-only instance of Abi, bound to a specific deployed contract. -func NewAbiTransactor(address common.Address, transactor bind.ContractTransactor) (*AbiTransactor, error) { - contract, err := bindAbi(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AbiTransactor{contract: contract}, nil -} - -// NewAbiFilterer creates a new log filterer instance of Abi, bound to a specific deployed contract. -func NewAbiFilterer(address common.Address, filterer bind.ContractFilterer) (*AbiFilterer, error) { - contract, err := bindAbi(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AbiFilterer{contract: contract}, nil -} - -// bindAbi binds a generic wrapper to an already deployed contract. -func bindAbi(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(AbiABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// ParseAbiABI parses the ABI -func ParseAbiABI() (*abi.ABI, error) { - parsed, err := abi.JSON(strings.NewReader(AbiABI)) - if err != nil { - return nil, err - } - return &parsed, nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Abi *AbiRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Abi.Contract.AbiCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Abi *AbiRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Abi.Contract.AbiTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Abi *AbiRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Abi.Contract.AbiTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Abi *AbiCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Abi.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Abi *AbiTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Abi.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Abi *AbiTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Abi.Contract.contract.Transact(opts, method, params...) -} - -// ChainId is a free data retrieval call binding the contract method 0x9a8a0592. -// -// Solidity: function chainId() view returns(uint16) -func (_Abi *AbiCaller) ChainId(opts *bind.CallOpts) (uint16, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "chainId") - - if err != nil { - return *new(uint16), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - - return out0, err - -} - -// ChainId is a free data retrieval call binding the contract method 0x9a8a0592. -// -// Solidity: function chainId() view returns(uint16) -func (_Abi *AbiSession) ChainId() (uint16, error) { - return _Abi.Contract.ChainId(&_Abi.CallOpts) -} - -// ChainId is a free data retrieval call binding the contract method 0x9a8a0592. -// -// Solidity: function chainId() view returns(uint16) -func (_Abi *AbiCallerSession) ChainId() (uint16, error) { - return _Abi.Contract.ChainId(&_Abi.CallOpts) -} - -// GetCurrentGuardianSetIndex is a free data retrieval call binding the contract method 0x1cfe7951. -// -// Solidity: function getCurrentGuardianSetIndex() view returns(uint32) -func (_Abi *AbiCaller) GetCurrentGuardianSetIndex(opts *bind.CallOpts) (uint32, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "getCurrentGuardianSetIndex") - - if err != nil { - return *new(uint32), err - } - - out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) - - return out0, err - -} - -// GetCurrentGuardianSetIndex is a free data retrieval call binding the contract method 0x1cfe7951. -// -// Solidity: function getCurrentGuardianSetIndex() view returns(uint32) -func (_Abi *AbiSession) GetCurrentGuardianSetIndex() (uint32, error) { - return _Abi.Contract.GetCurrentGuardianSetIndex(&_Abi.CallOpts) -} - -// GetCurrentGuardianSetIndex is a free data retrieval call binding the contract method 0x1cfe7951. -// -// Solidity: function getCurrentGuardianSetIndex() view returns(uint32) -func (_Abi *AbiCallerSession) GetCurrentGuardianSetIndex() (uint32, error) { - return _Abi.Contract.GetCurrentGuardianSetIndex(&_Abi.CallOpts) -} - -// GetGuardianSet is a free data retrieval call binding the contract method 0xf951975a. -// -// Solidity: function getGuardianSet(uint32 index) view returns((address[],uint32)) -func (_Abi *AbiCaller) GetGuardianSet(opts *bind.CallOpts, index uint32) (StructsGuardianSet, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "getGuardianSet", index) - - if err != nil { - return *new(StructsGuardianSet), err - } - - out0 := *abi.ConvertType(out[0], new(StructsGuardianSet)).(*StructsGuardianSet) - - return out0, err - -} - -// GetGuardianSet is a free data retrieval call binding the contract method 0xf951975a. -// -// Solidity: function getGuardianSet(uint32 index) view returns((address[],uint32)) -func (_Abi *AbiSession) GetGuardianSet(index uint32) (StructsGuardianSet, error) { - return _Abi.Contract.GetGuardianSet(&_Abi.CallOpts, index) -} - -// GetGuardianSet is a free data retrieval call binding the contract method 0xf951975a. -// -// Solidity: function getGuardianSet(uint32 index) view returns((address[],uint32)) -func (_Abi *AbiCallerSession) GetGuardianSet(index uint32) (StructsGuardianSet, error) { - return _Abi.Contract.GetGuardianSet(&_Abi.CallOpts, index) -} - -// GetGuardianSetExpiry is a free data retrieval call binding the contract method 0xeb8d3f12. -// -// Solidity: function getGuardianSetExpiry() view returns(uint32) -func (_Abi *AbiCaller) GetGuardianSetExpiry(opts *bind.CallOpts) (uint32, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "getGuardianSetExpiry") - - if err != nil { - return *new(uint32), err - } - - out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) - - return out0, err - -} - -// GetGuardianSetExpiry is a free data retrieval call binding the contract method 0xeb8d3f12. -// -// Solidity: function getGuardianSetExpiry() view returns(uint32) -func (_Abi *AbiSession) GetGuardianSetExpiry() (uint32, error) { - return _Abi.Contract.GetGuardianSetExpiry(&_Abi.CallOpts) -} - -// GetGuardianSetExpiry is a free data retrieval call binding the contract method 0xeb8d3f12. -// -// Solidity: function getGuardianSetExpiry() view returns(uint32) -func (_Abi *AbiCallerSession) GetGuardianSetExpiry() (uint32, error) { - return _Abi.Contract.GetGuardianSetExpiry(&_Abi.CallOpts) -} - -// GovernanceActionIsConsumed is a free data retrieval call binding the contract method 0x2c3c02a4. -// -// Solidity: function governanceActionIsConsumed(bytes32 hash) view returns(bool) -func (_Abi *AbiCaller) GovernanceActionIsConsumed(opts *bind.CallOpts, hash [32]byte) (bool, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "governanceActionIsConsumed", hash) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// GovernanceActionIsConsumed is a free data retrieval call binding the contract method 0x2c3c02a4. -// -// Solidity: function governanceActionIsConsumed(bytes32 hash) view returns(bool) -func (_Abi *AbiSession) GovernanceActionIsConsumed(hash [32]byte) (bool, error) { - return _Abi.Contract.GovernanceActionIsConsumed(&_Abi.CallOpts, hash) -} - -// GovernanceActionIsConsumed is a free data retrieval call binding the contract method 0x2c3c02a4. -// -// Solidity: function governanceActionIsConsumed(bytes32 hash) view returns(bool) -func (_Abi *AbiCallerSession) GovernanceActionIsConsumed(hash [32]byte) (bool, error) { - return _Abi.Contract.GovernanceActionIsConsumed(&_Abi.CallOpts, hash) -} - -// GovernanceChainId is a free data retrieval call binding the contract method 0xfbe3c2cd. -// -// Solidity: function governanceChainId() view returns(uint16) -func (_Abi *AbiCaller) GovernanceChainId(opts *bind.CallOpts) (uint16, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "governanceChainId") - - if err != nil { - return *new(uint16), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - - return out0, err - -} - -// GovernanceChainId is a free data retrieval call binding the contract method 0xfbe3c2cd. -// -// Solidity: function governanceChainId() view returns(uint16) -func (_Abi *AbiSession) GovernanceChainId() (uint16, error) { - return _Abi.Contract.GovernanceChainId(&_Abi.CallOpts) -} - -// GovernanceChainId is a free data retrieval call binding the contract method 0xfbe3c2cd. -// -// Solidity: function governanceChainId() view returns(uint16) -func (_Abi *AbiCallerSession) GovernanceChainId() (uint16, error) { - return _Abi.Contract.GovernanceChainId(&_Abi.CallOpts) -} - -// GovernanceContract is a free data retrieval call binding the contract method 0xb172b222. -// -// Solidity: function governanceContract() view returns(bytes32) -func (_Abi *AbiCaller) GovernanceContract(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "governanceContract") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GovernanceContract is a free data retrieval call binding the contract method 0xb172b222. -// -// Solidity: function governanceContract() view returns(bytes32) -func (_Abi *AbiSession) GovernanceContract() ([32]byte, error) { - return _Abi.Contract.GovernanceContract(&_Abi.CallOpts) -} - -// GovernanceContract is a free data retrieval call binding the contract method 0xb172b222. -// -// Solidity: function governanceContract() view returns(bytes32) -func (_Abi *AbiCallerSession) GovernanceContract() ([32]byte, error) { - return _Abi.Contract.GovernanceContract(&_Abi.CallOpts) -} - -// IsInitialized is a free data retrieval call binding the contract method 0xd60b347f. -// -// Solidity: function isInitialized(address impl) view returns(bool) -func (_Abi *AbiCaller) IsInitialized(opts *bind.CallOpts, impl common.Address) (bool, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "isInitialized", impl) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsInitialized is a free data retrieval call binding the contract method 0xd60b347f. -// -// Solidity: function isInitialized(address impl) view returns(bool) -func (_Abi *AbiSession) IsInitialized(impl common.Address) (bool, error) { - return _Abi.Contract.IsInitialized(&_Abi.CallOpts, impl) -} - -// IsInitialized is a free data retrieval call binding the contract method 0xd60b347f. -// -// Solidity: function isInitialized(address impl) view returns(bool) -func (_Abi *AbiCallerSession) IsInitialized(impl common.Address) (bool, error) { - return _Abi.Contract.IsInitialized(&_Abi.CallOpts, impl) -} - -// MessageFee is a free data retrieval call binding the contract method 0x1a90a219. -// -// Solidity: function messageFee() view returns(uint256) -func (_Abi *AbiCaller) MessageFee(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "messageFee") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MessageFee is a free data retrieval call binding the contract method 0x1a90a219. -// -// Solidity: function messageFee() view returns(uint256) -func (_Abi *AbiSession) MessageFee() (*big.Int, error) { - return _Abi.Contract.MessageFee(&_Abi.CallOpts) -} - -// MessageFee is a free data retrieval call binding the contract method 0x1a90a219. -// -// Solidity: function messageFee() view returns(uint256) -func (_Abi *AbiCallerSession) MessageFee() (*big.Int, error) { - return _Abi.Contract.MessageFee(&_Abi.CallOpts) -} - -// NextSequence is a free data retrieval call binding the contract method 0x4cf842b5. -// -// Solidity: function nextSequence(address emitter) view returns(uint64) -func (_Abi *AbiCaller) NextSequence(opts *bind.CallOpts, emitter common.Address) (uint64, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "nextSequence", emitter) - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// NextSequence is a free data retrieval call binding the contract method 0x4cf842b5. -// -// Solidity: function nextSequence(address emitter) view returns(uint64) -func (_Abi *AbiSession) NextSequence(emitter common.Address) (uint64, error) { - return _Abi.Contract.NextSequence(&_Abi.CallOpts, emitter) -} - -// NextSequence is a free data retrieval call binding the contract method 0x4cf842b5. -// -// Solidity: function nextSequence(address emitter) view returns(uint64) -func (_Abi *AbiCallerSession) NextSequence(emitter common.Address) (uint64, error) { - return _Abi.Contract.NextSequence(&_Abi.CallOpts, emitter) -} - -// ParseAndVerifyVM is a free data retrieval call binding the contract method 0xc0fd8bde. -// -// Solidity: function parseAndVerifyVM(bytes encodedVM) view returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm, bool valid, string reason) -func (_Abi *AbiCaller) ParseAndVerifyVM(opts *bind.CallOpts, encodedVM []byte) (struct { - Vm StructsVM - Valid bool - Reason string -}, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseAndVerifyVM", encodedVM) - - outstruct := new(struct { - Vm StructsVM - Valid bool - Reason string - }) - if err != nil { - return *outstruct, err - } - - outstruct.Vm = *abi.ConvertType(out[0], new(StructsVM)).(*StructsVM) - outstruct.Valid = *abi.ConvertType(out[1], new(bool)).(*bool) - outstruct.Reason = *abi.ConvertType(out[2], new(string)).(*string) - - return *outstruct, err - -} - -// ParseAndVerifyVM is a free data retrieval call binding the contract method 0xc0fd8bde. -// -// Solidity: function parseAndVerifyVM(bytes encodedVM) view returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm, bool valid, string reason) -func (_Abi *AbiSession) ParseAndVerifyVM(encodedVM []byte) (struct { - Vm StructsVM - Valid bool - Reason string -}, error) { - return _Abi.Contract.ParseAndVerifyVM(&_Abi.CallOpts, encodedVM) -} - -// ParseAndVerifyVM is a free data retrieval call binding the contract method 0xc0fd8bde. -// -// Solidity: function parseAndVerifyVM(bytes encodedVM) view returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm, bool valid, string reason) -func (_Abi *AbiCallerSession) ParseAndVerifyVM(encodedVM []byte) (struct { - Vm StructsVM - Valid bool - Reason string -}, error) { - return _Abi.Contract.ParseAndVerifyVM(&_Abi.CallOpts, encodedVM) -} - -// ParseContractUpgrade is a free data retrieval call binding the contract method 0x4fdc60fa. -// -// Solidity: function parseContractUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,address) cu) -func (_Abi *AbiCaller) ParseContractUpgrade(opts *bind.CallOpts, encodedUpgrade []byte) (GovernanceStructsContractUpgrade, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseContractUpgrade", encodedUpgrade) - - if err != nil { - return *new(GovernanceStructsContractUpgrade), err - } - - out0 := *abi.ConvertType(out[0], new(GovernanceStructsContractUpgrade)).(*GovernanceStructsContractUpgrade) - - return out0, err - -} - -// ParseContractUpgrade is a free data retrieval call binding the contract method 0x4fdc60fa. -// -// Solidity: function parseContractUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,address) cu) -func (_Abi *AbiSession) ParseContractUpgrade(encodedUpgrade []byte) (GovernanceStructsContractUpgrade, error) { - return _Abi.Contract.ParseContractUpgrade(&_Abi.CallOpts, encodedUpgrade) -} - -// ParseContractUpgrade is a free data retrieval call binding the contract method 0x4fdc60fa. -// -// Solidity: function parseContractUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,address) cu) -func (_Abi *AbiCallerSession) ParseContractUpgrade(encodedUpgrade []byte) (GovernanceStructsContractUpgrade, error) { - return _Abi.Contract.ParseContractUpgrade(&_Abi.CallOpts, encodedUpgrade) -} - -// ParseGuardianSetUpgrade is a free data retrieval call binding the contract method 0x04ca84cf. -// -// Solidity: function parseGuardianSetUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,(address[],uint32),uint32) gsu) -func (_Abi *AbiCaller) ParseGuardianSetUpgrade(opts *bind.CallOpts, encodedUpgrade []byte) (GovernanceStructsGuardianSetUpgrade, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseGuardianSetUpgrade", encodedUpgrade) - - if err != nil { - return *new(GovernanceStructsGuardianSetUpgrade), err - } - - out0 := *abi.ConvertType(out[0], new(GovernanceStructsGuardianSetUpgrade)).(*GovernanceStructsGuardianSetUpgrade) - - return out0, err - -} - -// ParseGuardianSetUpgrade is a free data retrieval call binding the contract method 0x04ca84cf. -// -// Solidity: function parseGuardianSetUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,(address[],uint32),uint32) gsu) -func (_Abi *AbiSession) ParseGuardianSetUpgrade(encodedUpgrade []byte) (GovernanceStructsGuardianSetUpgrade, error) { - return _Abi.Contract.ParseGuardianSetUpgrade(&_Abi.CallOpts, encodedUpgrade) -} - -// ParseGuardianSetUpgrade is a free data retrieval call binding the contract method 0x04ca84cf. -// -// Solidity: function parseGuardianSetUpgrade(bytes encodedUpgrade) pure returns((bytes32,uint8,uint16,(address[],uint32),uint32) gsu) -func (_Abi *AbiCallerSession) ParseGuardianSetUpgrade(encodedUpgrade []byte) (GovernanceStructsGuardianSetUpgrade, error) { - return _Abi.Contract.ParseGuardianSetUpgrade(&_Abi.CallOpts, encodedUpgrade) -} - -// ParseSetMessageFee is a free data retrieval call binding the contract method 0x515f3247. -// -// Solidity: function parseSetMessageFee(bytes encodedSetMessageFee) pure returns((bytes32,uint8,uint16,uint256) smf) -func (_Abi *AbiCaller) ParseSetMessageFee(opts *bind.CallOpts, encodedSetMessageFee []byte) (GovernanceStructsSetMessageFee, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseSetMessageFee", encodedSetMessageFee) - - if err != nil { - return *new(GovernanceStructsSetMessageFee), err - } - - out0 := *abi.ConvertType(out[0], new(GovernanceStructsSetMessageFee)).(*GovernanceStructsSetMessageFee) - - return out0, err - -} - -// ParseSetMessageFee is a free data retrieval call binding the contract method 0x515f3247. -// -// Solidity: function parseSetMessageFee(bytes encodedSetMessageFee) pure returns((bytes32,uint8,uint16,uint256) smf) -func (_Abi *AbiSession) ParseSetMessageFee(encodedSetMessageFee []byte) (GovernanceStructsSetMessageFee, error) { - return _Abi.Contract.ParseSetMessageFee(&_Abi.CallOpts, encodedSetMessageFee) -} - -// ParseSetMessageFee is a free data retrieval call binding the contract method 0x515f3247. -// -// Solidity: function parseSetMessageFee(bytes encodedSetMessageFee) pure returns((bytes32,uint8,uint16,uint256) smf) -func (_Abi *AbiCallerSession) ParseSetMessageFee(encodedSetMessageFee []byte) (GovernanceStructsSetMessageFee, error) { - return _Abi.Contract.ParseSetMessageFee(&_Abi.CallOpts, encodedSetMessageFee) -} - -// ParseTransferFees is a free data retrieval call binding the contract method 0x0319e59c. -// -// Solidity: function parseTransferFees(bytes encodedTransferFees) pure returns((bytes32,uint8,uint16,uint256,bytes32) tf) -func (_Abi *AbiCaller) ParseTransferFees(opts *bind.CallOpts, encodedTransferFees []byte) (GovernanceStructsTransferFees, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseTransferFees", encodedTransferFees) - - if err != nil { - return *new(GovernanceStructsTransferFees), err - } - - out0 := *abi.ConvertType(out[0], new(GovernanceStructsTransferFees)).(*GovernanceStructsTransferFees) - - return out0, err - -} - -// ParseTransferFees is a free data retrieval call binding the contract method 0x0319e59c. -// -// Solidity: function parseTransferFees(bytes encodedTransferFees) pure returns((bytes32,uint8,uint16,uint256,bytes32) tf) -func (_Abi *AbiSession) ParseTransferFees(encodedTransferFees []byte) (GovernanceStructsTransferFees, error) { - return _Abi.Contract.ParseTransferFees(&_Abi.CallOpts, encodedTransferFees) -} - -// ParseTransferFees is a free data retrieval call binding the contract method 0x0319e59c. -// -// Solidity: function parseTransferFees(bytes encodedTransferFees) pure returns((bytes32,uint8,uint16,uint256,bytes32) tf) -func (_Abi *AbiCallerSession) ParseTransferFees(encodedTransferFees []byte) (GovernanceStructsTransferFees, error) { - return _Abi.Contract.ParseTransferFees(&_Abi.CallOpts, encodedTransferFees) -} - -// ParseVM is a free data retrieval call binding the contract method 0xa9e11893. -// -// Solidity: function parseVM(bytes encodedVM) pure returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) -func (_Abi *AbiCaller) ParseVM(opts *bind.CallOpts, encodedVM []byte) (StructsVM, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "parseVM", encodedVM) - - if err != nil { - return *new(StructsVM), err - } - - out0 := *abi.ConvertType(out[0], new(StructsVM)).(*StructsVM) - - return out0, err - -} - -// ParseVM is a free data retrieval call binding the contract method 0xa9e11893. -// -// Solidity: function parseVM(bytes encodedVM) pure returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) -func (_Abi *AbiSession) ParseVM(encodedVM []byte) (StructsVM, error) { - return _Abi.Contract.ParseVM(&_Abi.CallOpts, encodedVM) -} - -// ParseVM is a free data retrieval call binding the contract method 0xa9e11893. -// -// Solidity: function parseVM(bytes encodedVM) pure returns((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) -func (_Abi *AbiCallerSession) ParseVM(encodedVM []byte) (StructsVM, error) { - return _Abi.Contract.ParseVM(&_Abi.CallOpts, encodedVM) -} - -// VerifySignatures is a free data retrieval call binding the contract method 0xa0cce1b3. -// -// Solidity: function verifySignatures(bytes32 hash, (bytes32,bytes32,uint8,uint8)[] signatures, (address[],uint32) guardianSet) pure returns(bool valid, string reason) -func (_Abi *AbiCaller) VerifySignatures(opts *bind.CallOpts, hash [32]byte, signatures []StructsSignature, guardianSet StructsGuardianSet) (struct { - Valid bool - Reason string -}, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "verifySignatures", hash, signatures, guardianSet) - - outstruct := new(struct { - Valid bool - Reason string - }) - if err != nil { - return *outstruct, err - } - - outstruct.Valid = *abi.ConvertType(out[0], new(bool)).(*bool) - outstruct.Reason = *abi.ConvertType(out[1], new(string)).(*string) - - return *outstruct, err - -} - -// VerifySignatures is a free data retrieval call binding the contract method 0xa0cce1b3. -// -// Solidity: function verifySignatures(bytes32 hash, (bytes32,bytes32,uint8,uint8)[] signatures, (address[],uint32) guardianSet) pure returns(bool valid, string reason) -func (_Abi *AbiSession) VerifySignatures(hash [32]byte, signatures []StructsSignature, guardianSet StructsGuardianSet) (struct { - Valid bool - Reason string -}, error) { - return _Abi.Contract.VerifySignatures(&_Abi.CallOpts, hash, signatures, guardianSet) -} - -// VerifySignatures is a free data retrieval call binding the contract method 0xa0cce1b3. -// -// Solidity: function verifySignatures(bytes32 hash, (bytes32,bytes32,uint8,uint8)[] signatures, (address[],uint32) guardianSet) pure returns(bool valid, string reason) -func (_Abi *AbiCallerSession) VerifySignatures(hash [32]byte, signatures []StructsSignature, guardianSet StructsGuardianSet) (struct { - Valid bool - Reason string -}, error) { - return _Abi.Contract.VerifySignatures(&_Abi.CallOpts, hash, signatures, guardianSet) -} - -// VerifyVM is a free data retrieval call binding the contract method 0x875be02a. -// -// Solidity: function verifyVM((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) view returns(bool valid, string reason) -func (_Abi *AbiCaller) VerifyVM(opts *bind.CallOpts, vm StructsVM) (struct { - Valid bool - Reason string -}, error) { - var out []interface{} - err := _Abi.contract.Call(opts, &out, "verifyVM", vm) - - outstruct := new(struct { - Valid bool - Reason string - }) - if err != nil { - return *outstruct, err - } - - outstruct.Valid = *abi.ConvertType(out[0], new(bool)).(*bool) - outstruct.Reason = *abi.ConvertType(out[1], new(string)).(*string) - - return *outstruct, err - -} - -// VerifyVM is a free data retrieval call binding the contract method 0x875be02a. -// -// Solidity: function verifyVM((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) view returns(bool valid, string reason) -func (_Abi *AbiSession) VerifyVM(vm StructsVM) (struct { - Valid bool - Reason string -}, error) { - return _Abi.Contract.VerifyVM(&_Abi.CallOpts, vm) -} - -// VerifyVM is a free data retrieval call binding the contract method 0x875be02a. -// -// Solidity: function verifyVM((uint8,uint32,uint32,uint16,bytes32,uint64,uint8,bytes,uint32,(bytes32,bytes32,uint8,uint8)[],bytes32) vm) view returns(bool valid, string reason) -func (_Abi *AbiCallerSession) VerifyVM(vm StructsVM) (struct { - Valid bool - Reason string -}, error) { - return _Abi.Contract.VerifyVM(&_Abi.CallOpts, vm) -} - -// PublishMessage is a paid mutator transaction binding the contract method 0xb19a437e. -// -// Solidity: function publishMessage(uint32 nonce, bytes payload, uint8 consistencyLevel) payable returns(uint64 sequence) -func (_Abi *AbiTransactor) PublishMessage(opts *bind.TransactOpts, nonce uint32, payload []byte, consistencyLevel uint8) (*types.Transaction, error) { - return _Abi.contract.Transact(opts, "publishMessage", nonce, payload, consistencyLevel) -} - -// PublishMessage is a paid mutator transaction binding the contract method 0xb19a437e. -// -// Solidity: function publishMessage(uint32 nonce, bytes payload, uint8 consistencyLevel) payable returns(uint64 sequence) -func (_Abi *AbiSession) PublishMessage(nonce uint32, payload []byte, consistencyLevel uint8) (*types.Transaction, error) { - return _Abi.Contract.PublishMessage(&_Abi.TransactOpts, nonce, payload, consistencyLevel) -} - -// PublishMessage is a paid mutator transaction binding the contract method 0xb19a437e. -// -// Solidity: function publishMessage(uint32 nonce, bytes payload, uint8 consistencyLevel) payable returns(uint64 sequence) -func (_Abi *AbiTransactorSession) PublishMessage(nonce uint32, payload []byte, consistencyLevel uint8) (*types.Transaction, error) { - return _Abi.Contract.PublishMessage(&_Abi.TransactOpts, nonce, payload, consistencyLevel) -} - -// SubmitContractUpgrade is a paid mutator transaction binding the contract method 0x5cb8cae2. -// -// Solidity: function submitContractUpgrade(bytes _vm) returns() -func (_Abi *AbiTransactor) SubmitContractUpgrade(opts *bind.TransactOpts, _vm []byte) (*types.Transaction, error) { - return _Abi.contract.Transact(opts, "submitContractUpgrade", _vm) -} - -// SubmitContractUpgrade is a paid mutator transaction binding the contract method 0x5cb8cae2. -// -// Solidity: function submitContractUpgrade(bytes _vm) returns() -func (_Abi *AbiSession) SubmitContractUpgrade(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitContractUpgrade(&_Abi.TransactOpts, _vm) -} - -// SubmitContractUpgrade is a paid mutator transaction binding the contract method 0x5cb8cae2. -// -// Solidity: function submitContractUpgrade(bytes _vm) returns() -func (_Abi *AbiTransactorSession) SubmitContractUpgrade(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitContractUpgrade(&_Abi.TransactOpts, _vm) -} - -// SubmitNewGuardianSet is a paid mutator transaction binding the contract method 0x6606b4e0. -// -// Solidity: function submitNewGuardianSet(bytes _vm) returns() -func (_Abi *AbiTransactor) SubmitNewGuardianSet(opts *bind.TransactOpts, _vm []byte) (*types.Transaction, error) { - return _Abi.contract.Transact(opts, "submitNewGuardianSet", _vm) -} - -// SubmitNewGuardianSet is a paid mutator transaction binding the contract method 0x6606b4e0. -// -// Solidity: function submitNewGuardianSet(bytes _vm) returns() -func (_Abi *AbiSession) SubmitNewGuardianSet(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitNewGuardianSet(&_Abi.TransactOpts, _vm) -} - -// SubmitNewGuardianSet is a paid mutator transaction binding the contract method 0x6606b4e0. -// -// Solidity: function submitNewGuardianSet(bytes _vm) returns() -func (_Abi *AbiTransactorSession) SubmitNewGuardianSet(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitNewGuardianSet(&_Abi.TransactOpts, _vm) -} - -// SubmitSetMessageFee is a paid mutator transaction binding the contract method 0xf42bc641. -// -// Solidity: function submitSetMessageFee(bytes _vm) returns() -func (_Abi *AbiTransactor) SubmitSetMessageFee(opts *bind.TransactOpts, _vm []byte) (*types.Transaction, error) { - return _Abi.contract.Transact(opts, "submitSetMessageFee", _vm) -} - -// SubmitSetMessageFee is a paid mutator transaction binding the contract method 0xf42bc641. -// -// Solidity: function submitSetMessageFee(bytes _vm) returns() -func (_Abi *AbiSession) SubmitSetMessageFee(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitSetMessageFee(&_Abi.TransactOpts, _vm) -} - -// SubmitSetMessageFee is a paid mutator transaction binding the contract method 0xf42bc641. -// -// Solidity: function submitSetMessageFee(bytes _vm) returns() -func (_Abi *AbiTransactorSession) SubmitSetMessageFee(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitSetMessageFee(&_Abi.TransactOpts, _vm) -} - -// SubmitTransferFees is a paid mutator transaction binding the contract method 0x93df337e. -// -// Solidity: function submitTransferFees(bytes _vm) returns() -func (_Abi *AbiTransactor) SubmitTransferFees(opts *bind.TransactOpts, _vm []byte) (*types.Transaction, error) { - return _Abi.contract.Transact(opts, "submitTransferFees", _vm) -} - -// SubmitTransferFees is a paid mutator transaction binding the contract method 0x93df337e. -// -// Solidity: function submitTransferFees(bytes _vm) returns() -func (_Abi *AbiSession) SubmitTransferFees(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitTransferFees(&_Abi.TransactOpts, _vm) -} - -// SubmitTransferFees is a paid mutator transaction binding the contract method 0x93df337e. -// -// Solidity: function submitTransferFees(bytes _vm) returns() -func (_Abi *AbiTransactorSession) SubmitTransferFees(_vm []byte) (*types.Transaction, error) { - return _Abi.Contract.SubmitTransferFees(&_Abi.TransactOpts, _vm) -} - -// TryParseLog attempts to parse a log. Returns the parsed log, evenName and whether it was succesfull -func (_Abi *AbiFilterer) TryParseLog(log types.Log) (eventName string, event interface{}, ok bool, err error) { - eventName, ok, err = _Abi.contract.LogEventName(log) - if err != nil || !ok { - return "", nil, false, err - } - - switch eventName { - case "AdminChanged": - event, err = _Abi.ParseAdminChanged(log) - case "BeaconUpgraded": - event, err = _Abi.ParseBeaconUpgraded(log) - case "ContractUpgraded": - event, err = _Abi.ParseContractUpgraded(log) - case "GuardianSetAdded": - event, err = _Abi.ParseGuardianSetAdded(log) - case "LogMessagePublished": - event, err = _Abi.ParseLogMessagePublished(log) - case "Upgraded": - event, err = _Abi.ParseUpgraded(log) - } - if err != nil { - return "", nil, false, err - } - - return eventName, event, ok, nil -} - -// Fallback is a paid mutator transaction binding the contract fallback function. -// -// Solidity: fallback() payable returns() -func (_Abi *AbiTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { - return _Abi.contract.RawTransact(opts, calldata) -} - -// Fallback is a paid mutator transaction binding the contract fallback function. -// -// Solidity: fallback() payable returns() -func (_Abi *AbiSession) Fallback(calldata []byte) (*types.Transaction, error) { - return _Abi.Contract.Fallback(&_Abi.TransactOpts, calldata) -} - -// Fallback is a paid mutator transaction binding the contract fallback function. -// -// Solidity: fallback() payable returns() -func (_Abi *AbiTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { - return _Abi.Contract.Fallback(&_Abi.TransactOpts, calldata) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Abi *AbiTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Abi.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Abi *AbiSession) Receive() (*types.Transaction, error) { - return _Abi.Contract.Receive(&_Abi.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_Abi *AbiTransactorSession) Receive() (*types.Transaction, error) { - return _Abi.Contract.Receive(&_Abi.TransactOpts) -} - -// AbiAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the Abi contract. -type AbiAdminChangedIterator struct { - Event *AbiAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiAdminChanged represents a AdminChanged event raised by the Abi contract. -type AbiAdminChanged struct { - PreviousAdmin common.Address - NewAdmin common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_Abi *AbiFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*AbiAdminChangedIterator, error) { - - logs, sub, err := _Abi.contract.FilterLogs(opts, "AdminChanged") - if err != nil { - return nil, err - } - return &AbiAdminChangedIterator{contract: _Abi.contract, event: "AdminChanged", logs: logs, sub: sub}, nil -} - -// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_Abi *AbiFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *AbiAdminChanged) (event.Subscription, error) { - - logs, sub, err := _Abi.contract.WatchLogs(opts, "AdminChanged") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiAdminChanged) - if err := _Abi.contract.UnpackLog(event, "AdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_Abi *AbiFilterer) ParseAdminChanged(log types.Log) (*AbiAdminChanged, error) { - event := new(AbiAdminChanged) - if err := _Abi.contract.UnpackLog(event, "AdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AbiBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the Abi contract. -type AbiBeaconUpgradedIterator struct { - Event *AbiBeaconUpgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiBeaconUpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiBeaconUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiBeaconUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiBeaconUpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiBeaconUpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiBeaconUpgraded represents a BeaconUpgraded event raised by the Abi contract. -type AbiBeaconUpgraded struct { - Beacon common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_Abi *AbiFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*AbiBeaconUpgradedIterator, error) { - - var beaconRule []interface{} - for _, beaconItem := range beacon { - beaconRule = append(beaconRule, beaconItem) - } - - logs, sub, err := _Abi.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) - if err != nil { - return nil, err - } - return &AbiBeaconUpgradedIterator{contract: _Abi.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil -} - -// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_Abi *AbiFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *AbiBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { - - var beaconRule []interface{} - for _, beaconItem := range beacon { - beaconRule = append(beaconRule, beaconItem) - } - - logs, sub, err := _Abi.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiBeaconUpgraded) - if err := _Abi.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_Abi *AbiFilterer) ParseBeaconUpgraded(log types.Log) (*AbiBeaconUpgraded, error) { - event := new(AbiBeaconUpgraded) - if err := _Abi.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AbiContractUpgradedIterator is returned from FilterContractUpgraded and is used to iterate over the raw logs and unpacked data for ContractUpgraded events raised by the Abi contract. -type AbiContractUpgradedIterator struct { - Event *AbiContractUpgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiContractUpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiContractUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiContractUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiContractUpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiContractUpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiContractUpgraded represents a ContractUpgraded event raised by the Abi contract. -type AbiContractUpgraded struct { - OldContract common.Address - NewContract common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterContractUpgraded is a free log retrieval operation binding the contract event 0x2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a49. -// -// Solidity: event ContractUpgraded(address indexed oldContract, address indexed newContract) -func (_Abi *AbiFilterer) FilterContractUpgraded(opts *bind.FilterOpts, oldContract []common.Address, newContract []common.Address) (*AbiContractUpgradedIterator, error) { - - var oldContractRule []interface{} - for _, oldContractItem := range oldContract { - oldContractRule = append(oldContractRule, oldContractItem) - } - var newContractRule []interface{} - for _, newContractItem := range newContract { - newContractRule = append(newContractRule, newContractItem) - } - - logs, sub, err := _Abi.contract.FilterLogs(opts, "ContractUpgraded", oldContractRule, newContractRule) - if err != nil { - return nil, err - } - return &AbiContractUpgradedIterator{contract: _Abi.contract, event: "ContractUpgraded", logs: logs, sub: sub}, nil -} - -// WatchContractUpgraded is a free log subscription operation binding the contract event 0x2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a49. -// -// Solidity: event ContractUpgraded(address indexed oldContract, address indexed newContract) -func (_Abi *AbiFilterer) WatchContractUpgraded(opts *bind.WatchOpts, sink chan<- *AbiContractUpgraded, oldContract []common.Address, newContract []common.Address) (event.Subscription, error) { - - var oldContractRule []interface{} - for _, oldContractItem := range oldContract { - oldContractRule = append(oldContractRule, oldContractItem) - } - var newContractRule []interface{} - for _, newContractItem := range newContract { - newContractRule = append(newContractRule, newContractItem) - } - - logs, sub, err := _Abi.contract.WatchLogs(opts, "ContractUpgraded", oldContractRule, newContractRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiContractUpgraded) - if err := _Abi.contract.UnpackLog(event, "ContractUpgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseContractUpgraded is a log parse operation binding the contract event 0x2e4cc16c100f0b55e2df82ab0b1a7e294aa9cbd01b48fbaf622683fbc0507a49. -// -// Solidity: event ContractUpgraded(address indexed oldContract, address indexed newContract) -func (_Abi *AbiFilterer) ParseContractUpgraded(log types.Log) (*AbiContractUpgraded, error) { - event := new(AbiContractUpgraded) - if err := _Abi.contract.UnpackLog(event, "ContractUpgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AbiGuardianSetAddedIterator is returned from FilterGuardianSetAdded and is used to iterate over the raw logs and unpacked data for GuardianSetAdded events raised by the Abi contract. -type AbiGuardianSetAddedIterator struct { - Event *AbiGuardianSetAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiGuardianSetAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiGuardianSetAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiGuardianSetAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiGuardianSetAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiGuardianSetAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiGuardianSetAdded represents a GuardianSetAdded event raised by the Abi contract. -type AbiGuardianSetAdded struct { - Index uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterGuardianSetAdded is a free log retrieval operation binding the contract event 0x2384dbc52f7b617fb7c5aa71e5455a21ff21d58604bb6daef6af2bb44aadebdd. -// -// Solidity: event GuardianSetAdded(uint32 indexed index) -func (_Abi *AbiFilterer) FilterGuardianSetAdded(opts *bind.FilterOpts, index []uint32) (*AbiGuardianSetAddedIterator, error) { - - var indexRule []interface{} - for _, indexItem := range index { - indexRule = append(indexRule, indexItem) - } - - logs, sub, err := _Abi.contract.FilterLogs(opts, "GuardianSetAdded", indexRule) - if err != nil { - return nil, err - } - return &AbiGuardianSetAddedIterator{contract: _Abi.contract, event: "GuardianSetAdded", logs: logs, sub: sub}, nil -} - -// WatchGuardianSetAdded is a free log subscription operation binding the contract event 0x2384dbc52f7b617fb7c5aa71e5455a21ff21d58604bb6daef6af2bb44aadebdd. -// -// Solidity: event GuardianSetAdded(uint32 indexed index) -func (_Abi *AbiFilterer) WatchGuardianSetAdded(opts *bind.WatchOpts, sink chan<- *AbiGuardianSetAdded, index []uint32) (event.Subscription, error) { - - var indexRule []interface{} - for _, indexItem := range index { - indexRule = append(indexRule, indexItem) - } - - logs, sub, err := _Abi.contract.WatchLogs(opts, "GuardianSetAdded", indexRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiGuardianSetAdded) - if err := _Abi.contract.UnpackLog(event, "GuardianSetAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseGuardianSetAdded is a log parse operation binding the contract event 0x2384dbc52f7b617fb7c5aa71e5455a21ff21d58604bb6daef6af2bb44aadebdd. -// -// Solidity: event GuardianSetAdded(uint32 indexed index) -func (_Abi *AbiFilterer) ParseGuardianSetAdded(log types.Log) (*AbiGuardianSetAdded, error) { - event := new(AbiGuardianSetAdded) - if err := _Abi.contract.UnpackLog(event, "GuardianSetAdded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AbiLogMessagePublishedIterator is returned from FilterLogMessagePublished and is used to iterate over the raw logs and unpacked data for LogMessagePublished events raised by the Abi contract. -type AbiLogMessagePublishedIterator struct { - Event *AbiLogMessagePublished // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiLogMessagePublishedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiLogMessagePublished) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiLogMessagePublished) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiLogMessagePublishedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiLogMessagePublishedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiLogMessagePublished represents a LogMessagePublished event raised by the Abi contract. -type AbiLogMessagePublished struct { - Sender common.Address - Sequence uint64 - Nonce uint32 - Payload []byte - ConsistencyLevel uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterLogMessagePublished is a free log retrieval operation binding the contract event 0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2. -// -// Solidity: event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel) -func (_Abi *AbiFilterer) FilterLogMessagePublished(opts *bind.FilterOpts, sender []common.Address) (*AbiLogMessagePublishedIterator, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Abi.contract.FilterLogs(opts, "LogMessagePublished", senderRule) - if err != nil { - return nil, err - } - return &AbiLogMessagePublishedIterator{contract: _Abi.contract, event: "LogMessagePublished", logs: logs, sub: sub}, nil -} - -// WatchLogMessagePublished is a free log subscription operation binding the contract event 0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2. -// -// Solidity: event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel) -func (_Abi *AbiFilterer) WatchLogMessagePublished(opts *bind.WatchOpts, sink chan<- *AbiLogMessagePublished, sender []common.Address) (event.Subscription, error) { - - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Abi.contract.WatchLogs(opts, "LogMessagePublished", senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiLogMessagePublished) - if err := _Abi.contract.UnpackLog(event, "LogMessagePublished", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseLogMessagePublished is a log parse operation binding the contract event 0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2. -// -// Solidity: event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel) -func (_Abi *AbiFilterer) ParseLogMessagePublished(log types.Log) (*AbiLogMessagePublished, error) { - event := new(AbiLogMessagePublished) - if err := _Abi.contract.UnpackLog(event, "LogMessagePublished", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AbiUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Abi contract. -type AbiUpgradedIterator struct { - Event *AbiUpgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AbiUpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AbiUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AbiUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AbiUpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AbiUpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AbiUpgraded represents a Upgraded event raised by the Abi contract. -type AbiUpgraded struct { - Implementation common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Abi *AbiFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*AbiUpgradedIterator, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _Abi.contract.FilterLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return &AbiUpgradedIterator{contract: _Abi.contract, event: "Upgraded", logs: logs, sub: sub}, nil -} - -// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Abi *AbiFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *AbiUpgraded, implementation []common.Address) (event.Subscription, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _Abi.contract.WatchLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AbiUpgraded) - if err := _Abi.contract.UnpackLog(event, "Upgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_Abi *AbiFilterer) ParseUpgraded(log types.Log) (*AbiUpgraded, error) { - event := new(AbiUpgraded) - if err := _Abi.contract.UnpackLog(event, "Upgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/node/pkg/watchers/evm/watcher.go b/node/pkg/watchers/evm/watcher.go index a8853430fe..fa230db746 100644 --- a/node/pkg/watchers/evm/watcher.go +++ b/node/pkg/watchers/evm/watcher.go @@ -120,8 +120,8 @@ type ( currentGuardianSet *uint32 // Interface to the chain specific ethereum library. - ethConn connectors.Connector - unsafeDevMode bool + ethConn connectors.Connector + env common.Environment latestBlockNumber uint64 latestSafeBlockNumber uint64 @@ -163,7 +163,7 @@ func NewEthWatcher( obsvReqC <-chan *gossipv1.ObservationRequest, queryReqC <-chan *query.PerChainQueryInternal, queryResponseC chan<- *query.PerChainQueryResponseInternal, - unsafeDevMode bool, + env common.Environment, ccqBackfillCache bool, ) *Watcher { return &Watcher{ @@ -178,7 +178,7 @@ func NewEthWatcher( queryReqC: queryReqC, queryResponseC: queryResponseC, pending: map[pendingKey]*pendingMessage{}, - unsafeDevMode: unsafeDevMode, + env: env, ccqConfig: query.GetPerChainConfig(chainID), ccqMaxBlockNumber: big.NewInt(0).SetUint64(math.MaxUint64), ccqBackfillCache: ccqBackfillCache, @@ -197,7 +197,7 @@ func (w *Watcher) Run(parentCtx context.Context) error { zap.String("contract", w.contract.String()), zap.String("networkName", w.networkName), zap.String("chainID", w.chainID.String()), - zap.Bool("unsafeDevMode", w.unsafeDevMode), + zap.String("env", string(w.env)), ) // later on we will spawn multiple go-routines through `RunWithScissors`, i.e. catching panics. @@ -232,15 +232,6 @@ func (w *Watcher) Run(parentCtx context.Context) error { return fmt.Errorf("dialing eth client failed: %w", err) } w.ethConn = connectors.NewBatchPollConnector(ctx, logger, baseConnector, safePollingSupported, 1000*time.Millisecond) - } else if w.chainID == vaa.ChainIDCelo { - // When we are running in mainnet or testnet, we need to use the Celo ethereum library rather than go-ethereum. - // However, in devnet, we currently run the standard ETH node for Celo, so we need to use the standard go-ethereum. - w.ethConn, err = connectors.NewCeloConnector(timeout, w.networkName, w.url, w.contract, logger) - if err != nil { - ethConnectionErrors.WithLabelValues(w.networkName, "dial_error").Inc() - p2p.DefaultRegistry.AddErrorCount(w.chainID, 1) - return fmt.Errorf("dialing eth client failed: %w", err) - } } else { // Everything else is instant finality. logger.Info("assuming instant finality") @@ -259,7 +250,7 @@ func (w *Watcher) Run(parentCtx context.Context) error { } if w.ccqConfig.TimestampCacheSupported { - w.ccqTimestampCache = NewBlocksByTimestamp(BTS_MAX_BLOCKS, w.unsafeDevMode) + w.ccqTimestampCache = NewBlocksByTimestamp(BTS_MAX_BLOCKS, (w.env == common.UnsafeDevNet)) } errC := make(chan error) @@ -706,7 +697,7 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) { safe := false // Tilt supports polling for both finalized and safe. - if w.unsafeDevMode { + if w.env == common.UnsafeDevNet { finalized = true safe = true @@ -737,9 +728,11 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) { finalized = true safe = true - // The following chains have their own specialized finalizers. } else if w.chainID == vaa.ChainIDCelo { - return false, false, nil + // TODO: Celo testnet now supports finalized and safe. As of January 2025, mainnet doesn't yet support safe. Once Celo mainnet cuts over, Celo can + // be added to the list above. That change won't be super urgent since we'll just continue to publish safe as finalized, which is not a huge deal. + finalized = true + safe = w.env != common.MainNet // Polygon now supports polling for finalized but not safe. // https://forum.polygon.technology/t/optimizing-decentralized-apps-ux-with-milestones-a-significantly-accelerated-finality-solution/13154