diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index 7bc131afef4..dcea0b823ea 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -659,11 +659,9 @@ func (lp *logPoller) backfill(ctx context.Context, start, end int64) error { gethLogs, err := lp.ec.FilterLogs(ctx, lp.Filter(big.NewInt(from), big.NewInt(to), nil)) if err != nil { var rpcErr client.JsonError - if errors.As(err, &rpcErr) { - if rpcErr.Code != jsonRpcLimitExceeded { - lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to) - return err - } + if !errors.As(err, &rpcErr) || rpcErr.Code != jsonRpcLimitExceeded { + lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to) + return err } if batchSize == 1 { lp.lggr.Criticalw("Too many log results in a single block, failed to retrieve logs! Node may be running in a degraded state.", "err", err, "from", from, "to", to, "LogBackfillBatchSize", lp.backfillBatchSize) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index 70d4b0d79fd..179a4f4573c 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -187,50 +187,62 @@ func setupNodeOCR2( func TestIntegration_OCR2(t *testing.T) { t.Parallel() - owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) - - lggr := logger.TestLogger(t) - bootstrapNodePort := freeport.GetOne(t) - bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, false /* useForwarders */, b, nil) - - var ( - oracles []confighelper2.OracleIdentityExtra - transmitters []common.Address - kbs []ocr2key.KeyBundle - apps []*cltest.TestApplication - ) - ports := freeport.GetN(t, 4) - for i := 0; i < 4; i++ { - node := setupNodeOCR2(t, owner, ports[i], false /* useForwarders */, b, []commontypes.BootstrapperLocator{ - // Supply the bootstrap IP and port as a V2 peer address - {PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, - }) - - kbs = append(kbs, node.keybundle) - apps = append(apps, node.app) - transmitters = append(transmitters, node.transmitter) - oracles = append(oracles, confighelper2.OracleIdentityExtra{ - OracleIdentity: confighelper2.OracleIdentity{ - OnchainPublicKey: node.keybundle.PublicKey(), - TransmitAccount: ocrtypes2.Account(node.transmitter.String()), - OffchainPublicKey: node.keybundle.OffchainPublicKey(), - PeerID: node.peerID, - }, - ConfigEncryptionPublicKey: node.keybundle.ConfigEncryptionPublicKey(), - }) - } + for _, test := range []struct { + name string + chainReaderAndCodec bool + }{ + {"legacy", false}, + {"chain-reader", true}, + } { + test := test + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) + + lggr := logger.TestLogger(t) + bootstrapNodePort := freeport.GetOne(t) + bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, false /* useForwarders */, b, nil) + + var ( + oracles []confighelper2.OracleIdentityExtra + transmitters []common.Address + kbs []ocr2key.KeyBundle + apps []*cltest.TestApplication + ) + ports := freeport.GetN(t, 4) + for i := 0; i < 4; i++ { + node := setupNodeOCR2(t, owner, ports[i], false /* useForwarders */, b, []commontypes.BootstrapperLocator{ + // Supply the bootstrap IP and port as a V2 peer address + {PeerID: bootstrapNode.peerID, Addrs: []string{fmt.Sprintf("127.0.0.1:%d", bootstrapNodePort)}}, + }) + + kbs = append(kbs, node.keybundle) + apps = append(apps, node.app) + transmitters = append(transmitters, node.transmitter) + + oracles = append(oracles, confighelper2.OracleIdentityExtra{ + OracleIdentity: confighelper2.OracleIdentity{ + OnchainPublicKey: node.keybundle.PublicKey(), + TransmitAccount: ocrtypes2.Account(node.transmitter.String()), + OffchainPublicKey: node.keybundle.OffchainPublicKey(), + PeerID: node.peerID, + }, + ConfigEncryptionPublicKey: node.keybundle.ConfigEncryptionPublicKey(), + }) + } - tick := time.NewTicker(1 * time.Second) - defer tick.Stop() - go func() { - for range tick.C { - b.Commit() - } - }() + tick := time.NewTicker(1 * time.Second) + defer tick.Stop() + go func() { + for range tick.C { + b.Commit() + } + }() - blockBeforeConfig := initOCR2(t, lggr, b, ocrContract, owner, bootstrapNode, oracles, transmitters, transmitters, func(blockNum int64) string { - return fmt.Sprintf(` + blockBeforeConfig := initOCR2(t, lggr, b, ocrContract, owner, bootstrapNode, oracles, transmitters, transmitters, func(blockNum int64) string { + return fmt.Sprintf(` type = "bootstrap" name = "bootstrap" relay = "evm" @@ -240,54 +252,71 @@ contractID = "%s" chainID = 1337 fromBlock = %d `, ocrContractAddress, blockNum) - }) - - var jids []int32 - var servers, slowServers = make([]*httptest.Server, 4), make([]*httptest.Server, 4) - // We expect metadata of: - // latestAnswer:nil // First call - // latestAnswer:0 - // latestAnswer:10 - // latestAnswer:20 - // latestAnswer:30 - var metaLock sync.Mutex - expectedMeta := map[string]struct{}{ - "0": {}, "10": {}, "20": {}, "30": {}, - } - for i := 0; i < 4; i++ { - s := i - require.NoError(t, apps[i].Start(testutils.Context(t))) - - // API speed is > observation timeout set in ContractSetConfigArgsForIntegrationTest - slowServers[i] = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - time.Sleep(5 * time.Second) - res.WriteHeader(http.StatusOK) - _, err := res.Write([]byte(`{"data":10}`)) - require.NoError(t, err) - })) - t.Cleanup(slowServers[s].Close) - servers[i] = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) - require.NoError(t, err) - var m bridges.BridgeMetaDataJSON - require.NoError(t, json.Unmarshal(b, &m)) - if m.Meta.LatestAnswer != nil && m.Meta.UpdatedAt != nil { - metaLock.Lock() - delete(expectedMeta, m.Meta.LatestAnswer.String()) - metaLock.Unlock() + }) + + var jids []int32 + var servers, slowServers = make([]*httptest.Server, 4), make([]*httptest.Server, 4) + // We expect metadata of: + // latestAnswer:nil // First call + // latestAnswer:0 + // latestAnswer:10 + // latestAnswer:20 + // latestAnswer:30 + var metaLock sync.Mutex + expectedMeta := map[string]struct{}{ + "0": {}, "10": {}, "20": {}, "30": {}, } - res.WriteHeader(http.StatusOK) - _, err = res.Write([]byte(`{"data":10}`)) - require.NoError(t, err) - })) - t.Cleanup(servers[s].Close) - u, _ := url.Parse(servers[i].URL) - require.NoError(t, apps[i].BridgeORM().CreateBridgeType(&bridges.BridgeType{ - Name: bridges.BridgeName(fmt.Sprintf("bridge%d", i)), - URL: models.WebURL(*u), - })) - - ocrJob, err := validate.ValidatedOracleSpecToml(apps[i].Config.OCR2(), apps[i].Config.Insecure(), fmt.Sprintf(` + returnData := int(10) + for i := 0; i < 4; i++ { + s := i + require.NoError(t, apps[i].Start(testutils.Context(t))) + + // API speed is > observation timeout set in ContractSetConfigArgsForIntegrationTest + slowServers[i] = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + time.Sleep(5 * time.Second) + var result string + metaLock.Lock() + result = fmt.Sprintf(`{"data":%d}`, returnData) + metaLock.Unlock() + res.WriteHeader(http.StatusOK) + t.Logf("Slow Bridge %d returning data:10", s) + _, err := res.Write([]byte(result)) + require.NoError(t, err) + })) + t.Cleanup(slowServers[s].Close) + servers[i] = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + b, err := io.ReadAll(req.Body) + require.NoError(t, err) + var m bridges.BridgeMetaDataJSON + require.NoError(t, json.Unmarshal(b, &m)) + var result string + metaLock.Lock() + result = fmt.Sprintf(`{"data":%d}`, returnData) + metaLock.Unlock() + if m.Meta.LatestAnswer != nil && m.Meta.UpdatedAt != nil { + t.Logf("Bridge %d deleting %s, from request body: %s", s, m.Meta.LatestAnswer, b) + metaLock.Lock() + delete(expectedMeta, m.Meta.LatestAnswer.String()) + metaLock.Unlock() + } + res.WriteHeader(http.StatusOK) + _, err = res.Write([]byte(result)) + require.NoError(t, err) + })) + t.Cleanup(servers[s].Close) + u, _ := url.Parse(servers[i].URL) + require.NoError(t, apps[i].BridgeORM().CreateBridgeType(&bridges.BridgeType{ + Name: bridges.BridgeName(fmt.Sprintf("bridge%d", i)), + URL: models.WebURL(*u), + })) + + var chainReaderSpec string + if test.chainReaderAndCodec { + chainReaderSpec = ` +chainReader = '{"chainContractReaders":{"median":{"contractABI":"[{\"inputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"int192\",\"name\":\"minAnswer_\",\"type\":\"int192\"},{\"internalType\":\"int192\",\"name\":\"maxAnswer_\",\"type\":\"int192\"},{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"billingAccessController\",\"type\":\"address\"},{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"requesterAccessController\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals_\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"description_\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"current\",\"type\":\"int256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"old\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"BillingAccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"name\":\"BillingSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"oldLinkToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"newLinkToken\",\"type\":\"address\"}],\"name\":\"LinkTokenSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"startedBy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"aggregatorRoundId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"answer\",\"type\":\"int192\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"observationsTimestamp\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int192[]\",\"name\":\"observations\",\"type\":\"int192[]\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"observers\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"juelsPerFeeCoin\",\"type\":\"int192\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"epochAndRound\",\"type\":\"uint40\"}],\"name\":\"NewTransmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"}],\"name\":\"OraclePaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"current\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"old\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"RequesterAccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"round\",\"type\":\"uint8\"}],\"name\":\"RoundRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"previousValidator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousGasLimit\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"currentValidator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"currentGasLimit\",\"type\":\"uint32\"}],\"name\":\"ValidatorConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"acceptPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"description\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBilling\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBillingAccessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkToken\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequesterAccessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"}],\"name\":\"getRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId_\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getValidatorConfig\",\"outputs\":[{\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"validator\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTransmissionDetails\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"round\",\"type\":\"uint8\"},{\"internalType\":\"int192\",\"name\":\"latestAnswer_\",\"type\":\"int192\"},{\"internalType\":\"uint64\",\"name\":\"latestTimestamp_\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"availableBalance\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitterAddress\",\"type\":\"address\"}],\"name\":\"oracleObservationCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitterAddress\",\"type\":\"address\"}],\"name\":\"owedPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestNewRound\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"name\":\"setBilling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"_billingAccessController\",\"type\":\"address\"}],\"name\":\"setBillingAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"setPayees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"requesterAccessController\",\"type\":\"address\"}],\"name\":\"setRequesterAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"newValidator\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newGasLimit\",\"type\":\"uint32\"}],\"name\":\"setValidatorConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"withdrawPayment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]","chainReaderDefinitions":{"LatestTransmissionDetails":{"chainSpecificName":"latestTransmissionDetails","readType":0, "output_modifications":[{"type":"rename","fields":{"LatestAnswer_":"LatestAnswer","LatestTimestamp_":"LatestTimestamp"}}]},"LatestRoundRequested":{"chainSpecificName":"RoundRequested","params":{"requester":""},"readType":1}}}}}' +codec = '{"chainCodecConfig" :{"MedianReport":{"TypeAbi": "[{\"Name\": \"Timestamp\",\"Type\": \"uint32\"},{\"Name\": \"Observers\",\"Type\": \"bytes32\"},{\"Name\": \"Observations\",\"Type\": \"int192[]\"},{\"Name\": \"JuelsPerFeeCoin\",\"Type\": \"int192\"}]"}}}'` + } + ocrJob, err := validate.ValidatedOracleSpecToml(apps[i].Config.OCR2(), apps[i].Config.Insecure(), fmt.Sprintf(` type = "offchainreporting2" relay = "evm" schemaVersion = 1 @@ -316,7 +345,7 @@ observationSource = """ """ [relayConfig] chainID = 1337 -fromBlock = %d +fromBlock = %d%s [pluginConfig] juelsPerFeeCoinSource = """ // data source 1 @@ -334,72 +363,128 @@ juelsPerFeeCoinSource = """ answer1 [type=median index=0]; """ -`, ocrContractAddress, kbs[i].ID(), transmitters[i], fmt.Sprintf("bridge%d", i), i, slowServers[i].URL, i, blockBeforeConfig.Number().Int64(), fmt.Sprintf("bridge%d", i), i, slowServers[i].URL, i)) - require.NoError(t, err) - err = apps[i].AddJobV2(testutils.Context(t), &ocrJob) - require.NoError(t, err) - jids = append(jids, ocrJob.ID) - } +`, ocrContractAddress, kbs[i].ID(), transmitters[i], fmt.Sprintf("bridge%d", i), i, slowServers[i].URL, i, blockBeforeConfig.Number().Int64(), chainReaderSpec, fmt.Sprintf("bridge%d", i), i, slowServers[i].URL, i)) + require.NoError(t, err) + err = apps[i].AddJobV2(testutils.Context(t), &ocrJob) + require.NoError(t, err) + jids = append(jids, ocrJob.ID) + } - // Assert that all the OCR jobs get a run with valid values eventually. - var wg sync.WaitGroup - for i := 0; i < 4; i++ { - ic := i - wg.Add(1) - go func() { - defer wg.Done() - // Want at least 2 runs so we see all the metadata. - pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], 2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) - jb, err := pr[0].Outputs.MarshalJSON() - require.NoError(t, err) - assert.Equal(t, []byte(fmt.Sprintf("[\"%d\"]", 10*ic)), jb, "pr[0] %+v pr[1] %+v", pr[0], pr[1]) - require.NoError(t, err) - }() - } - wg.Wait() + // Watch for OCR2AggregatorTransmitted events + start := uint64(0) + txEvents := make(chan *ocr2aggregator.OCR2AggregatorTransmitted) + ocrContract.WatchTransmitted(&bind.WatchOpts{Start: &start, Context: testutils.Context(t)}, txEvents) + newTxEvents := make(chan *ocr2aggregator.OCR2AggregatorNewTransmission) + ocrContract.WatchNewTransmission(&bind.WatchOpts{Start: &start, Context: testutils.Context(t)}, newTxEvents, []uint32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) + + go func() { + var newTxEvent *ocr2aggregator.OCR2AggregatorNewTransmission + select { + case txEvent := <-txEvents: + t.Logf("txEvent: %v", txEvent) + if newTxEvent != nil { + assert.Equal(t, txEvent.Epoch, uint32(newTxEvent.EpochAndRound.Uint64())) + } + case newTxEvent = <-newTxEvents: + t.Logf("newTxEvent: %v", newTxEvent) + } + }() - // 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). - gomega.NewGomegaWithT(t).Eventually(func() string { - answer, err := ocrContract.LatestAnswer(nil) - require.NoError(t, err) - return answer.String() - }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal("20")) + for trial := 0; trial < 2; trial++ { + var retVal int - for _, app := range apps { - jobs, _, err := app.JobORM().FindJobs(0, 1000) - require.NoError(t, err) - // No spec errors - for _, j := range jobs { - ignore := 0 - for i := range j.JobSpecErrors { - // Non-fatal timing related error, ignore for testing. - if strings.Contains(j.JobSpecErrors[i].Description, "leader's phase conflicts tGrace timeout") { - ignore++ + metaLock.Lock() + returnData = 10 * (trial + 1) + retVal = returnData + for i := 0; i < 4; i++ { + expectedMeta[fmt.Sprintf("%d", returnData*i)] = struct{}{} + } + metaLock.Unlock() + + // Assert that all the OCR jobs get a run with valid values eventually. + var wg sync.WaitGroup + for i := 0; i < 4; i++ { + ic := i + wg.Add(1) + go func() { + defer wg.Done() + completedRuns, err := apps[ic].JobORM().FindPipelineRunIDsByJobID(jids[ic], 0, 1000) + require.NoError(t, err) + // Want at least 2 runs so we see all the metadata. + pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], len(completedRuns)+2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) + jb, err := pr[0].Outputs.MarshalJSON() + require.NoError(t, err) + assert.Equal(t, []byte(fmt.Sprintf("[\"%d\"]", retVal*ic)), jb, "pr[0] %+v pr[1] %+v", pr[0], pr[1]) + require.NoError(t, err) + }() + } + wg.Wait() + + // Trail #1: 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). + // Trial #2: 4 oracles reporting 0, 20, 40, 60. Answer should be 40 (results[4/2]). + gomega.NewGomegaWithT(t).Eventually(func() string { + answer, err := ocrContract.LatestAnswer(nil) + require.NoError(t, err) + return answer.String() + }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal(fmt.Sprintf("%d", 2*retVal))) + + for _, app := range apps { + jobs, _, err := app.JobORM().FindJobs(0, 1000) + require.NoError(t, err) + // No spec errors + for _, j := range jobs { + ignore := 0 + for i := range j.JobSpecErrors { + // Non-fatal timing related error, ignore for testing. + if strings.Contains(j.JobSpecErrors[i].Description, "leader's phase conflicts tGrace timeout") { + ignore++ + } + } + require.Len(t, j.JobSpecErrors, ignore) + } + } + em := map[string]struct{}{} + metaLock.Lock() + maps.Copy(em, expectedMeta) + metaLock.Unlock() + assert.Len(t, em, 0, "expected metadata %v", em) + + t.Logf("======= Summary =======") + roundId, err := ocrContract.LatestRound(nil) + for i := 0; i <= int(roundId.Int64()); i++ { + roundData, err := ocrContract.GetRoundData(nil, big.NewInt(int64(i))) + require.NoError(t, err) + t.Logf("RoundId: %d, AnsweredInRound: %d, Answer: %d, StartedAt: %v, UpdatedAt: %v", roundData.RoundId, roundData.AnsweredInRound, roundData.Answer, roundData.StartedAt, roundData.UpdatedAt) + } + + expectedAnswer := big.NewInt(2 * int64(retVal)) + + // Assert we can read the latest config digest and epoch after a report has been submitted. + contractABI, err := abi.JSON(strings.NewReader(ocr2aggregator.OCR2AggregatorABI)) + require.NoError(t, err) + apps[0].GetRelayers().LegacyEVMChains().Slice() + ct, err := evm.NewOCRContractTransmitter(ocrContractAddress, apps[0].GetRelayers().LegacyEVMChains().Slice()[0].Client(), contractABI, nil, apps[0].GetRelayers().LegacyEVMChains().Slice()[0].LogPoller(), lggr, nil) + require.NoError(t, err) + configDigest, epoch, err := ct.LatestConfigDigestAndEpoch(testutils.Context(t)) + require.NoError(t, err) + details, err := ocrContract.LatestConfigDetails(nil) + require.NoError(t, err) + assert.True(t, bytes.Equal(configDigest[:], details.ConfigDigest[:])) + digestAndEpoch, err := ocrContract.LatestConfigDigestAndEpoch(nil) + require.NoError(t, err) + assert.Equal(t, digestAndEpoch.Epoch, epoch) + latestTransmissionDetails, err := ocrContract.LatestTransmissionDetails(nil) + require.NoError(t, err) + assert.Equal(t, expectedAnswer, latestTransmissionDetails.LatestAnswer) + require.NoError(t, err) + newTransmissionEvents, err := ocrContract.FilterTransmitted(&bind.FilterOpts{Start: 0, End: nil}) + require.NoError(t, err) + for newTransmissionEvents.Next() { + assert.Equal(t, 3, newTransmissionEvents.Event.Epoch) } } - require.Len(t, j.JobSpecErrors, ignore) - } + }) } - em := map[string]struct{}{} - metaLock.Lock() - maps.Copy(em, expectedMeta) - metaLock.Unlock() - assert.Len(t, em, 0, "expected metadata %v", em) - - // Assert we can read the latest config digest and epoch after a report has been submitted. - contractABI, err := abi.JSON(strings.NewReader(ocr2aggregator.OCR2AggregatorABI)) - require.NoError(t, err) - apps[0].GetRelayers().LegacyEVMChains().Slice() - ct, err := evm.NewOCRContractTransmitter(ocrContractAddress, apps[0].GetRelayers().LegacyEVMChains().Slice()[0].Client(), contractABI, nil, apps[0].GetRelayers().LegacyEVMChains().Slice()[0].LogPoller(), lggr, nil) - require.NoError(t, err) - configDigest, epoch, err := ct.LatestConfigDigestAndEpoch(testutils.Context(t)) - require.NoError(t, err) - details, err := ocrContract.LatestConfigDetails(nil) - require.NoError(t, err) - assert.True(t, bytes.Equal(configDigest[:], details.ConfigDigest[:])) - digestAndEpoch, err := ocrContract.LatestConfigDigestAndEpoch(nil) - require.NoError(t, err) - assert.Equal(t, digestAndEpoch.Epoch, epoch) } func initOCR2(t *testing.T, lggr logger.Logger, b *backends.SimulatedBackend, diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 33ae9fa5ee9..8d5f3724c55 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -237,10 +237,10 @@ require ( github.com/shirou/gopsutil/v3 v3.23.11 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d // indirect + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index e195e12a45d..d4ab4dee392 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1148,14 +1148,14 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b h1:4S2FO2YsCRT3KiImGxI+ZAUMl/peweiQuIk8Tm4WEBU= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d h1:w4MsbOtNk6nD/mcXLstHWk9hB6g7QLtcAfhPjhwvOaQ= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d/go.mod h1:YPAfLNowdBwiKiYOwgwtbJHi8AJWbcxkbOY0ItAvkfc= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc= diff --git a/core/services/job/models.go b/core/services/job/models.go index b21ecc12e72..c48ec04b4cf 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -276,7 +276,21 @@ type JSONConfig map[string]interface{} // Bytes returns the raw bytes func (r JSONConfig) Bytes() []byte { - b, _ := json.Marshal(r) + var retCopy = make(JSONConfig, len(r)) + for key, value := range r { + copiedVal := value + // If the value is a json structure string, unmarshal it to preserve JSON structure + // e.g. instead of this {"key":"{\"nestedKey\":{\"nestedValue\":123}}"} + // we want this {"key":{"nestedKey":{"nestedValue":123}}}, + if strValue, ok := copiedVal.(string); ok { + if object, ok := asObject(strValue); ok { + copiedVal = object + } + } + retCopy[key] = copiedVal + } + + b, _ := json.Marshal(retCopy) return b } @@ -306,6 +320,11 @@ func (r JSONConfig) MercuryCredentialName() (string, error) { return name, nil } +func asObject(s string) (any, bool) { + var js map[string]interface{} + return js, json.Unmarshal([]byte(s), &js) == nil +} + var ForwardersSupportedPlugins = []types.OCR2PluginType{types.Median, types.DKG, types.OCR2VRF, types.OCR2Keeper, types.Functions} // OCR2OracleSpec defines the job spec for OCR2 jobs. diff --git a/core/services/ocr2/plugins/median/plugin.go b/core/services/ocr2/plugins/median/plugin.go deleted file mode 100644 index cad2099832d..00000000000 --- a/core/services/ocr2/plugins/median/plugin.go +++ /dev/null @@ -1,68 +0,0 @@ -package median - -import ( - "context" - - "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/loop" - "github.com/smartcontractkit/chainlink-common/pkg/services" - "github.com/smartcontractkit/chainlink-common/pkg/types" -) - -type Plugin struct { - loop.Plugin - stop services.StopChan -} - -func NewPlugin(lggr logger.Logger) *Plugin { - return &Plugin{Plugin: loop.Plugin{Logger: lggr}, stop: make(services.StopChan)} -} - -func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) { - var ctxVals loop.ContextValues - ctxVals.SetValues(ctx) - lggr := logger.With(p.Logger, ctxVals.Args()...) - - factory := median.NumericalMedianFactory{ - ContractTransmitter: provider.MedianContract(), - DataSource: dataSource, - JuelsPerFeeCoinDataSource: juelsPerFeeCoin, - Logger: logger.NewOCRWrapper(lggr, true, func(msg string) { - ctx, cancelFn := p.stop.NewCtx() - defer cancelFn() - if err := errorLog.SaveError(ctx, msg); err != nil { - lggr.Errorw("Unable to save error", "err", msg) - } - }), - OnchainConfigCodec: provider.OnchainConfigCodec(), - ReportCodec: provider.ReportCodec(), - } - s := &reportingPluginFactoryService{lggr: logger.Named(lggr, "ReportingPluginFactory"), ReportingPluginFactory: factory} - - p.SubService(s) - - return s, nil -} - -type reportingPluginFactoryService struct { - services.StateMachine - lggr logger.Logger - ocrtypes.ReportingPluginFactory -} - -func (r *reportingPluginFactoryService) Name() string { return r.lggr.Name() } - -func (r *reportingPluginFactoryService) Start(ctx context.Context) error { - return r.StartOnce("ReportingPluginFactory", func() error { return nil }) -} - -func (r *reportingPluginFactoryService) Close() error { - return r.StopOnce("ReportingPluginFactory", func() error { return nil }) -} - -func (r *reportingPluginFactoryService) HealthReport() map[string]error { - return map[string]error{r.Name(): r.Healthy()} -} diff --git a/core/services/ocr2/plugins/median/services.go b/core/services/ocr2/plugins/median/services.go index 79abbc96a4b..bdf6feaed47 100644 --- a/core/services/ocr2/plugins/median/services.go +++ b/core/services/ocr2/plugins/median/services.go @@ -5,14 +5,9 @@ import ( "encoding/json" "errors" "fmt" - "math/big" "time" - "github.com/ethereum/go-ethereum/common" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus" - ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - mediantypes "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -57,21 +52,6 @@ func (m *medianConfig) JobPipelineResultWriteQueueDepth() uint64 { return m.jobPipelineResultWriteQueueDepth } -// This wrapper avoids the need to modify the signature of NewMedianFactory in all of the non-evm -// relay repos as well as its primary definition in chainlink-common. Once ChainReader is implemented -// and working on all 4 blockchain families, we can remove the original MedianContract() method from -// MedianProvider and pass medianContract as a separate param to NewMedianFactory -type medianProviderWrapper struct { - types.MedianProvider - contract mediantypes.MedianContract -} - -// Override relay's implementation of MedianContract with product plugin's implementation of -// MedianContract, making use of product-agnostic ChainReader to read the contract instead of relay MedianContract -func (m medianProviderWrapper) MedianContract() mediantypes.MedianContract { - return m.contract -} - func NewMedianServices(ctx context.Context, jb job.Job, isNewlyCreatedJob bool, @@ -145,24 +125,10 @@ func NewMedianServices(ctx context.Context, CreatedAt: time.Now(), }, lggr) - medianPluginCmd := env.MedianPluginCmd.Get() - medianLoopEnabled := medianPluginCmd != "" - - // TODO BCF-2821 handle this properly as this blocks Solana chain reader dev - if !medianLoopEnabled && medianProvider.ChainReader() != nil { - lggr.Info("Chain Reader enabled") - medianProvider = medianProviderWrapper{ - medianProvider, // attach newer MedianContract which uses ChainReader - newMedianContract(provider.ChainReader(), common.HexToAddress(spec.ContractID)), - } - } else { - lggr.Info("Chain Reader disabled") - } - - if medianLoopEnabled { + if cmdName := env.MedianPluginCmd.Get(); cmdName != "" { // use unique logger names so we can use it to register a loop medianLggr := lggr.Named("Median").Named(spec.ContractID).Named(spec.GetID()) - cmdFn, telem, err2 := cfg.RegisterLOOP(medianLggr.Name(), medianPluginCmd) + cmdFn, telem, err2 := cfg.RegisterLOOP(medianLggr.Name(), cmdName) if err2 != nil { err = fmt.Errorf("failed to register loop: %w", err2) abort() @@ -192,49 +158,3 @@ func NewMedianServices(ctx context.Context, } return } - -type medianContract struct { - chainReader types.ChainReader - contract types.BoundContract -} - -type latestTransmissionDetailsResponse struct { - configDigest ocr2types.ConfigDigest - epoch uint32 - round uint8 - latestAnswer *big.Int - latestTimestamp time.Time -} - -type latestRoundRequested struct { - configDigest ocr2types.ConfigDigest - epoch uint32 - round uint8 -} - -func (m *medianContract) LatestTransmissionDetails(ctx context.Context) (configDigest ocr2types.ConfigDigest, epoch uint32, round uint8, latestAnswer *big.Int, latestTimestamp time.Time, err error) { - var resp latestTransmissionDetailsResponse - - err = m.chainReader.GetLatestValue(ctx, m.contract.Name, "LatestTransmissionDetails", nil, &resp) - if err != nil { - return - } - - return resp.configDigest, resp.epoch, resp.round, resp.latestAnswer, resp.latestTimestamp, err -} - -func (m *medianContract) LatestRoundRequested(ctx context.Context, lookback time.Duration) (configDigest ocr2types.ConfigDigest, epoch uint32, round uint8, err error) { - var resp latestRoundRequested - - err = m.chainReader.GetLatestValue(ctx, m.contract.Name, "LatestRoundRequested", map[string]string{}, &resp) - if err != nil { - return - } - - return resp.configDigest, resp.epoch, resp.round, err -} - -func newMedianContract(chainReader types.ChainReader, address common.Address) *medianContract { - contract := types.BoundContract{Address: address.String(), Name: "median", Pending: true} - return &medianContract{chainReader, contract} -} diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index ea3498fec94..2330fc7ca4c 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -47,7 +47,7 @@ func NewChainReaderService(lggr logger.Logger, lp logpoller.LogPoller, b Binding return nil, err } - c, err := parsed.toCodec() + c, err := parsed.toCodec(lggr) return &chainReader{ lggr: lggr.Named("ChainReader"), @@ -63,8 +63,10 @@ func (cr *chainReader) Name() string { return cr.lggr.Name() } var _ commontypes.ContractTypeProvider = &chainReader{} func (cr *chainReader) GetLatestValue(ctx context.Context, contractName, method string, params any, returnVal any) error { + cr.lggr.Infof("!!!!!!!!!!\nEVM CR\n%s.%s\n%#v\n%s\n!!!!!!!!!!\n", contractName, method, params) ae, err := cr.bindings.getBinding(contractName, method, false) if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nEVM CR err:\n%v\n!!!!!!!!!!\n", err) return err } @@ -76,29 +78,43 @@ func (cr *chainReader) GetLatestValue(ctx context.Context, contractName, method } func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contractName, method string, hash common.Hash, returnVal any) error { + cr.lggr.Infof("!!!!!!!!!!\nlp: EVM latest from log poller\n!!!!!!!!!!\n") ae, err := cr.bindings.getBinding(contractName, method, false) if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nlp: EVM no binding err:\n%v\n!!!!!!!!!!\n", err) return err } - log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized) + log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, 1) if err != nil { - if strings.Contains(err.Error(), "not found") { - return fmt.Errorf("%w: %w", commontypes.ErrNotFound, err) + errStr := err.Error() + if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") { + cr.lggr.Infof("!!!!!!!!!!\nlp: Returning no error when nothing is found\n!!!!!!!!!!\n") + return nil } + cr.lggr.Errorf("!!!!!!!!!!\nlp: No sig err:\n%v\n!!!!!!!!!!\n", err) return fmt.Errorf("%w: %w", commontypes.ErrInternal, err) } - return cr.codec.Decode(ctx, log.Data, returnVal, wrapItemType(contractName, method, false)) + err = cr.codec.Decode(ctx, log.Data, returnVal, wrapItemType(contractName, method, false)) + if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nlp: EVM decode err:\n%v\n!!!!!!!!!!\n", err) + } else { + cr.lggr.Infof("!!!!!!!!!!\nlp: EVM decode success\n%#v\n!!!!!!!!!!\n", returnVal) + } + return err } func (cr *chainReader) getLatestValueFromContract(ctx context.Context, contractName, method string, params any, returnVal any) error { + cr.lggr.Infof("!!!!!!!!!!\nEVM latest from contract\n!!!!!!!!!!\n") data, err := cr.codec.Encode(ctx, params, wrapItemType(contractName, method, true)) if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nEVM encode err:\n%v\n!!!!!!!!!!\n", err) return err } ae, err := cr.bindings.getBinding(contractName, method, true) if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nEVM no binding err:\n%v\n!!!!!!!!!!\n", err) return err } callMsg := ethereum.CallMsg{ @@ -110,10 +126,19 @@ func (cr *chainReader) getLatestValueFromContract(ctx context.Context, contractN output, err := cr.client.CallContract(ctx, callMsg, nil) if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nEVM call err:\n%v\n!!!!!!!!!!\n", err) return err } - return cr.codec.Decode(ctx, output, returnVal, wrapItemType(contractName, method, false)) + cr.lggr.Infof("!!!!!!!!!!\nEVM results \n%x\n!!!!!!!!!!\n", output) + + err = cr.codec.Decode(ctx, output, returnVal, wrapItemType(contractName, method, false)) + if err != nil { + cr.lggr.Errorf("!!!!!!!!!!\nEVM decode err:\n%v\n!!!!!!!!!!\n", err) + } else { + cr.lggr.Infof("!!!!!!!!!!\nEVM decode success\n%#v\n!!!!!!!!!!\n", returnVal) + } + return err } func (cr *chainReader) Start(_ context.Context) error { diff --git a/core/services/relay/evm/chain_reader_test.go b/core/services/relay/evm/chain_reader_test.go index a39cf07a8c1..ca313f9ffdd 100644 --- a/core/services/relay/evm/chain_reader_test.go +++ b/core/services/relay/evm/chain_reader_test.go @@ -129,10 +129,10 @@ func (it *chainReaderInterfaceTester) Name() string { } func (it *chainReaderInterfaceTester) GetAccountBytes(i int) []byte { - account := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2} - account[i%32] += byte(i) - account[(i+3)%32] += byte(i + 3) - return account + account := [20]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} + account[i%20] += byte(i) + account[(i+3)%20] += byte(i + 3) + return account[:] } func (it *chainReaderInterfaceTester) GetChainReader(t *testing.T) clcommontypes.ChainReader { @@ -176,7 +176,7 @@ func (it *chainReaderInterfaceTester) TriggerEvent(t *testing.T, testStruct *Tes it.sendTxWithTestStruct(t, testStruct, (*testfiles.TestfilesTransactor).TriggerEvent) } -type testStructFn = func(*testfiles.TestfilesTransactor, *bind.TransactOpts, int32, string, uint8, [32]uint8, [32]byte, [][32]byte, *big.Int, testfiles.MidLevelTestStruct) (*evmtypes.Transaction, error) +type testStructFn = func(*testfiles.TestfilesTransactor, *bind.TransactOpts, int32, string, uint8, [32]uint8, common.Address, []common.Address, *big.Int, testfiles.MidLevelTestStruct) (*evmtypes.Transaction, error) func (it *chainReaderInterfaceTester) sendTxWithTestStruct(t *testing.T, testStruct *TestStruct, fn testStructFn) { tx, err := fn( @@ -186,7 +186,7 @@ func (it *chainReaderInterfaceTester) sendTxWithTestStruct(t *testing.T, testStr testStruct.DifferentField, uint8(testStruct.OracleID), convertOracleIDs(testStruct.OracleIDs), - [32]byte(testStruct.Account), + common.Address(testStruct.Account), convertAccounts(testStruct.Accounts), testStruct.BigField, midToInternalType(testStruct.NestedStruct), @@ -205,10 +205,10 @@ func convertOracleIDs(oracleIDs [32]commontypes.OracleID) [32]byte { return convertedIds } -func convertAccounts(accounts [][]byte) [][32]byte { - convertedAccounts := make([][32]byte, len(accounts)) +func convertAccounts(accounts [][]byte) []common.Address { + convertedAccounts := make([]common.Address, len(accounts)) for i, a := range accounts { - convertedAccounts[i] = [32]byte(a) + convertedAccounts[i] = common.Address(a) } return convertedAccounts } @@ -267,10 +267,10 @@ func (it *chainReaderInterfaceTester) incNonce() { } } -func getAccounts(first TestStruct) [][32]byte { - accountBytes := make([][32]byte, len(first.Accounts)) +func getAccounts(first TestStruct) []common.Address { + accountBytes := make([]common.Address, len(first.Accounts)) for i, account := range first.Accounts { - accountBytes[i] = [32]byte(account) + accountBytes[i] = common.Address(account) } return accountBytes } @@ -302,7 +302,7 @@ func toInternalType(testStruct TestStruct) testfiles.TestStruct { DifferentField: testStruct.DifferentField, OracleId: byte(testStruct.OracleID), OracleIds: convertOracleIDs(testStruct.OracleIDs), - Account: [32]byte(testStruct.Account), + Account: common.Address(testStruct.Account), Accounts: convertAccounts(testStruct.Accounts), BigField: testStruct.BigField, NestedStruct: midToInternalType(testStruct.NestedStruct), diff --git a/core/services/relay/evm/codec.go b/core/services/relay/evm/codec.go index 71813de865f..879012fda9b 100644 --- a/core/services/relay/evm/codec.go +++ b/core/services/relay/evm/codec.go @@ -7,6 +7,7 @@ import ( "reflect" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/mitchellh/mapstructure" @@ -14,6 +15,7 @@ import ( commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) @@ -24,9 +26,10 @@ import ( // SliceToArrayVerifySizeHook verifies that slices have the correct size when converting to an array // sizeVerifyBigIntHook allows our custom types that verify the number fits in the on-chain type to be converted as-if // it was a *big.Int -var evmDecoderHooks = []mapstructure.DecodeHookFunc{decodeAccountHook, codec.BigIntHook, codec.SliceToArrayVerifySizeHook, sizeVerifyBigIntHook} +var evmDecoderHooks = []mapstructure.DecodeHookFunc{decodeAccountHook, codec.EpochToTimeHook, codec.BigIntHook, codec.SliceToArrayVerifySizeHook, sizeVerifyBigIntHook} -func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) { +func NewCodec(conf types.CodecConfig, lggr logger.Logger) (commontypes.RemoteCodec, error) { + fmt.Printf("!!!!!!!!!!\nNewCodec\n%#v\n!!!!!!!!!!\n", conf.ChainCodecConfigs) parsed := &parsedTypes{ encoderDefs: map[string]*codecEntry{}, decoderDefs: map[string]*codecEntry{}, @@ -35,16 +38,19 @@ func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) { for k, v := range conf.ChainCodecConfigs { args := abi.Arguments{} if err := json.Unmarshal(([]byte)(v.TypeAbi), &args); err != nil { + fmt.Printf("!!!!!!!!!!\nNewCodec json abi/n%s/n err\n%#v\n!!!!!!!!!!\n", v.TypeAbi, err) return nil, err } mod, err := v.ModifierConfigs.ToModifier(evmDecoderHooks...) if err != nil { + fmt.Printf("!!!!!!!!!!\nNewCodec mod err\n%#v\n!!!!!!!!!!\n%", err) return nil, err } item := &codecEntry{Args: args, mod: mod} - if err := item.Init(); err != nil { + if err = item.Init(); err != nil { + fmt.Printf("!!!!!!!!!!\nNewCodec init err\n%#v\n!!!!!!!!!!\n%", err) return nil, err } @@ -52,7 +58,7 @@ func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) { parsed.decoderDefs[k] = item } - return parsed.toCodec() + return parsed.toCodec(lggr) } type evmCodec struct { @@ -106,13 +112,17 @@ func sizeVerifyBigIntHook(from, to reflect.Type, data any) (any, error) { } func decodeAccountHook(from, to reflect.Type, data any) (any, error) { - b32, _ := types.GetType("bytes32") - if from.Kind() == reflect.String && to == b32.Checked { + if from.Kind() == reflect.String && to == reflect.TypeOf(common.Address{}) { decoded, err := hexutil.Decode(data.(string)) if err != nil { return nil, fmt.Errorf("%w: %w", commontypes.ErrInvalidType, err) + } else if len(decoded) != common.AddressLength { + return nil, fmt.Errorf( + "%w: wrong number size for address expected %v got %v", + commontypes.ErrWrongNumberOfElements, + common.AddressLength, len(decoded)) } - return [32]byte(decoded), nil + return common.Address(decoded), nil } return data, nil } diff --git a/core/services/relay/evm/codec_entry.go b/core/services/relay/evm/codec_entry.go index e8a7a51165f..1ef5d4f0591 100644 --- a/core/services/relay/evm/codec_entry.go +++ b/core/services/relay/evm/codec_entry.go @@ -1,6 +1,7 @@ package evm import ( + "fmt" "reflect" "strings" @@ -116,6 +117,9 @@ func getNativeAndCheckedTypes(curType *abi.Type) (reflect.Type, reflect.Type, er func createTupleType(curType *abi.Type, converter func(reflect.Type) reflect.Type) (reflect.Type, reflect.Type, error) { if len(curType.TupleElems) == 0 { + if curType.TupleType == nil { + return nil, nil, fmt.Errorf("%w: unsupported solitidy type: %v", commontypes.ErrInvalidType, curType.String()) + } return curType.TupleType, curType.TupleType, nil } diff --git a/core/services/relay/evm/codec_entry_test.go b/core/services/relay/evm/codec_entry_test.go index df843bff85f..600afcf6669 100644 --- a/core/services/relay/evm/codec_entry_test.go +++ b/core/services/relay/evm/codec_entry_test.go @@ -1,6 +1,7 @@ package evm import ( + "fmt" "math/big" "reflect" "testing" @@ -136,4 +137,19 @@ func TestCodecEntry(t *testing.T) { iNative := reflect.Indirect(native) iNative.FieldByName("Field1").Set(reflect.ValueOf([3]int16{2, 3, 30})) }) + + t.Run("Not return values makes struct{}", func(t *testing.T) { + entry := codecEntry{Args: abi.Arguments{}} + require.NoError(t, entry.Init()) + assert.Equal(t, reflect.TypeOf(struct{}{}), entry.nativeType) + assert.Equal(t, reflect.TypeOf(struct{}{}), entry.checkedType) + }) + + t.Run("Address works", func(t *testing.T) { + address, err := abi.NewType("address", "", []abi.ArgumentMarshaling{}) + require.NoError(t, err) + entry := codecEntry{Args: abi.Arguments{{Name: "foo", Type: address}}} + fmt.Printf("%+v\n", address.GetType()) + require.NoError(t, entry.Init()) + }) } diff --git a/core/services/relay/evm/decoder.go b/core/services/relay/evm/decoder.go index 96f560ae9a8..e63727c339a 100644 --- a/core/services/relay/evm/decoder.go +++ b/core/services/relay/evm/decoder.go @@ -7,22 +7,28 @@ import ( "github.com/mitchellh/mapstructure" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" ) type decoder struct { Definitions map[string]*codecEntry + lggr logger.Logger } var _ commontypes.Decoder = &decoder{} func (m *decoder) Decode(ctx context.Context, raw []byte, into any, itemType string) error { + m.lggr.Infof("!!!!!!!!!!\nDecode\n%s\n!!!!!!!!!!\n", itemType) info, ok := m.Definitions[itemType] if !ok { + m.lggr.Errorf("!!!!!!!!!!\nDecode err not found type\n%s\n!!!!!!!!!!\n", itemType) return commontypes.ErrInvalidType } decode, err := extractDecoding(info, raw) if err != nil { + m.lggr.Errorf("!!!!!!!!!!\nDecode err: %v\n%s\n!!!!!!!!!!\n", err, itemType) return err } @@ -35,18 +41,20 @@ func (m *decoder) Decode(ctx context.Context, raw []byte, into any, itemType str return commontypes.ErrWrongNumberOfElements } iInto.Set(reflect.New(iInto.Type()).Elem()) - return setElements(length, rDecode, iInto) + return setElements(length, rDecode, iInto, m.lggr) case reflect.Slice: iInto := reflect.Indirect(reflect.ValueOf(into)) length := rDecode.Len() iInto.Set(reflect.MakeSlice(iInto.Type(), length, length)) - return setElements(length, rDecode, iInto) + return setElements(length, rDecode, iInto, m.lggr) default: - return mapstructureDecode(decode, into) + return mapstructureDecode(decode, into, m.lggr) } } func (m *decoder) GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) { + m.lggr.Infof("!!!!!!!!!!\nGetMaxDecodingSize\n%s\n\n%v\n!!!!!!!!!!\n", itemType, m.Definitions) + return m.Definitions[itemType].GetMaxSize(n) } @@ -63,9 +71,9 @@ func extractDecoding(info *codecEntry, raw []byte) (any, error) { return decode, nil } -func setElements(length int, rDecode reflect.Value, iInto reflect.Value) error { +func setElements(length int, rDecode reflect.Value, iInto reflect.Value, lggr logger.Logger) error { for i := 0; i < length; i++ { - if err := mapstructureDecode(rDecode.Index(i).Interface(), iInto.Index(i).Addr().Interface()); err != nil { + if err := mapstructureDecode(rDecode.Index(i).Interface(), iInto.Index(i).Addr().Interface(), lggr); err != nil { return err } } @@ -73,14 +81,16 @@ func setElements(length int, rDecode reflect.Value, iInto reflect.Value) error { return nil } -func mapstructureDecode(src, dest any) error { +func mapstructureDecode(src, dest any, lggr logger.Logger) error { mDecoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ DecodeHook: mapstructure.ComposeDecodeHookFunc(evmDecoderHooks...), Result: dest, Squash: true, }) if err != nil || mDecoder.Decode(src) != nil { + lggr.Errorf("!!!!!!!!!!\nDecode item error: %v\n%v\n!!!!!!!!!!\n", err, mDecoder.Decode(src)) return commontypes.ErrInvalidType } + lggr.Infof("!!!!!!!!!!\nDecode item success\n%#v\n%#v\n!!!!!!!!!!\n", dest, src) return nil } diff --git a/core/services/relay/evm/encoder.go b/core/services/relay/evm/encoder.go index 09f1b40184b..67ab1568386 100644 --- a/core/services/relay/evm/encoder.go +++ b/core/services/relay/evm/encoder.go @@ -4,20 +4,23 @@ import ( "context" "reflect" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" ) type encoder struct { Definitions map[string]*codecEntry + lggr logger.Logger } var _ commontypes.Encoder = &encoder{} func (e *encoder) Encode(ctx context.Context, item any, itemType string) ([]byte, error) { + e.lggr.Infof("!!!!!!!!!!\nEncode: %#v\n%s\n!!!!!!!!!!\n", item, itemType) info, ok := e.Definitions[itemType] if !ok { + e.lggr.Errorf("!!!!!!!!!!\nEncode error not found\n%s\n!!!!!!!!!!\n", itemType) return nil, commontypes.ErrInvalidType } @@ -27,28 +30,35 @@ func (e *encoder) Encode(ctx context.Context, item any, itemType string) ([]byte return cpy, nil } - return encode(reflect.ValueOf(item), info) + b, err := encode(reflect.ValueOf(item), info, e.lggr) + if err == nil { + e.lggr.Infof("!!!!!!!!!!\nEncode success\n%s\n!!!!!!!!!!\n", itemType) + } else { + e.lggr.Errorf("!!!!!!!!!!\nEncode error\n%v\n%s\n!!!!!!!!!!\n", err, itemType) + } + return b, err } func (e *encoder) GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error) { + e.lggr.Infof("!!!!!!!!!!\nGetMaxEncodingSize\n%s\n\n%v\n!!!!!!!!!!\n", itemType, e.Definitions) return e.Definitions[itemType].GetMaxSize(n) } -func encode(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) { +func encode(item reflect.Value, info *codecEntry, lggr logger.Logger) ([]byte, error) { for item.Kind() == reflect.Pointer { item = reflect.Indirect(item) } switch item.Kind() { case reflect.Array, reflect.Slice: - return encodeArray(item, info) + return encodeArray(item, info, lggr) case reflect.Struct, reflect.Map: - return encodeItem(item, info) + return encodeItem(item, info, lggr) default: return nil, commontypes.ErrInvalidEncoding } } -func encodeArray(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) { +func encodeArray(item reflect.Value, info *codecEntry, lggr logger.Logger) ([]byte, error) { length := item.Len() var native reflect.Value switch info.checkedType.Kind() { @@ -67,7 +77,7 @@ func encodeArray(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) nativeElm := info.nativeType.Elem() for i := 0; i < length; i++ { tmp := reflect.New(checkedElm) - if err := mapstructureDecode(item.Index(i).Interface(), tmp.Interface()); err != nil { + if err := mapstructureDecode(item.Index(i).Interface(), tmp.Interface(), lggr); err != nil { return nil, err } native.Index(i).Set(reflect.NewAt(nativeElm, tmp.UnsafePointer()).Elem()) @@ -76,12 +86,12 @@ func encodeArray(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) return pack(info, native.Interface()) } -func encodeItem(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) { +func encodeItem(item reflect.Value, info *codecEntry, lggr logger.Logger) ([]byte, error) { if item.Type() == reflect.PointerTo(info.checkedType) { item = reflect.NewAt(info.nativeType, item.UnsafePointer()) } else if item.Type() != reflect.PointerTo(info.nativeType) { checked := reflect.New(info.checkedType) - if err := mapstructureDecode(item.Interface(), checked.Interface()); err != nil { + if err := mapstructureDecode(item.Interface(), checked.Interface(), lggr); err != nil { return nil, err } item = reflect.NewAt(info.nativeType, checked.UnsafePointer()) @@ -100,7 +110,7 @@ func encodeItem(item reflect.Value, info *codecEntry) (ocrtypes.Report, error) { return pack(info, values...) } -func pack(info *codecEntry, values ...any) (ocrtypes.Report, error) { +func pack(info *codecEntry, values ...any) ([]byte, error) { if bytes, err := info.Args.Pack(values...); err == nil { withPrefix := make([]byte, 0, len(info.encodingPrefix)+len(bytes)) withPrefix = append(withPrefix, info.encodingPrefix...) diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index e0934c66b4c..941c8ab3b2b 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -453,22 +453,27 @@ func newContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, tra func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.MedianProvider, error) { lggr := r.lggr.Named("MedianProvider").Named(rargs.ExternalJobID.String()) + lggr.Infof("!!!!!!!!\nIn new median provider\n%s\n!!!!!!!!\n", string(rargs.RelayConfig)) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { + lggr.Infof("!!!!!!!!\nfailed to get relay config: %w\n!!!!!!!!\n", err) return nil, fmt.Errorf("failed to get relay config: %w", err) } expectedChainID := relayConfig.ChainID.String() if expectedChainID != r.chain.ID().String() { + lggr.Infof("!!!!!!!!\nwrong chain id %s\n!!!!!!!!\n", r.chain.ID().String()) return nil, fmt.Errorf("internal error: chain id in spec does not match this relayer's chain: have %s expected %s", relayConfig.ChainID.String(), r.chain.ID().String()) } if !common.IsHexAddress(relayOpts.ContractID) { + lggr.Infof("!!!!!!!!\ninvalid contract id %s\n!!!!!!!!\n", relayOpts.ContractID) return nil, fmt.Errorf("invalid contractID %s, expected hex address", relayOpts.ContractID) } contractID := common.HexToAddress(relayOpts.ContractID) configWatcher, err := newConfigProvider(lggr, r.chain, relayOpts, r.eventBroadcaster) if err != nil { + lggr.Infof("!!!!!!!!\nconfig watcher %s\n!!!!!!!!\n", configWatcher) return nil, err } @@ -491,13 +496,13 @@ func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontyp } // allow fallback until chain reader is default and median contract is removed, but still log just in case - var chainReaderService commontypes.ChainReader + var chainReaderService ChainReaderService if relayConfig.ChainReader != nil { b := Bindings{ // TODO BCF-2837: clean up the hard-coded values. "median": { "LatestTransmissionDetails": &addrEvtBinding{addr: contractID}, - "LatestRoundReported": &addrEvtBinding{addr: contractID}, + "LatestRoundRequested": &addrEvtBinding{addr: contractID}, }, } @@ -510,8 +515,10 @@ func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontyp medianProvider.chainReader = chainReaderService if relayConfig.Codec != nil { - medianProvider.codec, err = NewCodec(*relayConfig.Codec) + lggr.Infof("!!!!!!!!\nCodec config found\n%#v\n!!!!!!!!\n", relayConfig.Codec) + medianProvider.codec, err = NewCodec(*relayConfig.Codec, lggr) if err != nil { + lggr.Infof("!!!!!!!!\nfailed to make new codec\n%v\n!!!!!!!!\n", err) return nil, err } } else { @@ -528,7 +535,7 @@ type medianProvider struct { contractTransmitter ContractTransmitter reportCodec median.ReportCodec medianContract *medianContract - chainReader commontypes.ChainReader + chainReader ChainReaderService codec commontypes.Codec ms services.MultiStart } @@ -538,7 +545,11 @@ func (p *medianProvider) Name() string { } func (p *medianProvider) Start(ctx context.Context) error { - return p.ms.Start(ctx, p.configWatcher, p.contractTransmitter) + if p.chainReader == nil { + return p.ms.Start(ctx, p.configWatcher, p.contractTransmitter) + } + + return p.ms.Start(ctx, p.configWatcher, p.contractTransmitter, p.chainReader) } func (p *medianProvider) Close() error { diff --git a/core/services/relay/evm/parsed_types.go b/core/services/relay/evm/parsed_types.go index da54d5c15a3..c8ad55f0f39 100644 --- a/core/services/relay/evm/parsed_types.go +++ b/core/services/relay/evm/parsed_types.go @@ -6,6 +6,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/codec" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/logger" ) type parsedTypes struct { @@ -13,25 +15,30 @@ type parsedTypes struct { decoderDefs map[string]*codecEntry } -func (parsed *parsedTypes) toCodec() (commontypes.RemoteCodec, error) { +func (parsed *parsedTypes) toCodec(lggr logger.Logger) (commontypes.RemoteCodec, error) { modByTypeName := map[string]codec.Modifier{} if err := addEntries(parsed.encoderDefs, modByTypeName); err != nil { + lggr.Errorf("!!!!!!!!!!\nto codec add encoder entries err\n%#v\n!!!!!!!!!!\n%", err) return nil, err } if err := addEntries(parsed.decoderDefs, modByTypeName); err != nil { + lggr.Errorf("!!!!!!!!!!\nto codec add decoder entries err\n%#v\n!!!!!!!!!!\n%", err) return nil, err } mod, err := codec.NewByItemTypeModifier(modByTypeName) if err != nil { + lggr.Errorf("!!!!!!!!!!\nto codec mod by type err\n%#v\n!!!!!!!!!!\n%", err) return nil, err } underlying := &evmCodec{ - encoder: &encoder{Definitions: parsed.encoderDefs}, - decoder: &decoder{Definitions: parsed.decoderDefs}, + encoder: &encoder{Definitions: parsed.encoderDefs, lggr: lggr}, + decoder: &decoder{Definitions: parsed.decoderDefs, lggr: lggr}, parsedTypes: parsed, } - return codec.NewModifierCodec(underlying, mod, evmDecoderHooks...) + mc, err := codec.NewModifierCodec(underlying, mod, evmDecoderHooks...) + lggr.Errorf("!!!!!!!!!!\nnow modifier codec: has error?\n%v\n%#v\n!!!!!!!!!!\n%", err != nil, err) + return mc, err } // addEntries extracts the mods from codecEntry and adds them to modByTypeName use with codec.NewByItemTypeModifier diff --git a/core/services/relay/evm/testfiles/chain_reader_test_contract.sol b/core/services/relay/evm/testfiles/chain_reader_test_contract.sol index feeecda1c25..169b980a327 100644 --- a/core/services/relay/evm/testfiles/chain_reader_test_contract.sol +++ b/core/services/relay/evm/testfiles/chain_reader_test_contract.sol @@ -6,8 +6,8 @@ struct TestStruct { string DifferentField; uint8 OracleId; uint8[32] OracleIds; - bytes32 Account; - bytes32[] Accounts; + address Account; + address[] Accounts; int192 BigField; MidLevelTestStruct NestedStruct; } @@ -28,8 +28,8 @@ contract LatestValueHolder { string differentField, uint8 oracleId, uint8[32] oracleIds, - bytes32 account, - bytes32[] accounts, + address Account, + address[] Accounts, int192 bigField, MidLevelTestStruct nestedStruct); @@ -47,8 +47,8 @@ contract LatestValueHolder { string calldata differentField, uint8 oracleId, uint8[32] calldata oracleIds, - bytes32 account, - bytes32[] calldata accounts, + address account, + address[] calldata accounts, int192 bigField, MidLevelTestStruct calldata nestedStruct) public { seen.push(TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct)); @@ -59,8 +59,8 @@ contract LatestValueHolder { string calldata differentField, uint8 oracleId, uint8[32] calldata oracleIds, - bytes32 account, - bytes32[] calldata accounts, + address account, + address[] calldata accounts, int192 bigField, MidLevelTestStruct calldata nestedStruct) pure public returns (TestStruct memory) { return TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct); @@ -89,8 +89,8 @@ contract LatestValueHolder { string calldata differentField, uint8 oracleId, uint8[32] calldata oracleIds, - bytes32 account, - bytes32[] calldata accounts, + address account, + address[] calldata accounts, int192 bigField, MidLevelTestStruct calldata nestedStruct) public { emit Triggered(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct); diff --git a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.abi b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.abi index cdefbb905ba..603c33acdcd 100644 --- a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.abi +++ b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.abi @@ -1 +1 @@ -[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int32","name":"field","type":"int32"},{"indexed":false,"internalType":"string","name":"differentField","type":"string"},{"indexed":false,"internalType":"uint8","name":"oracleId","type":"uint8"},{"indexed":false,"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"indexed":false,"internalType":"bytes32","name":"account","type":"bytes32"},{"indexed":false,"internalType":"bytes32[]","name":"accounts","type":"bytes32[]"},{"indexed":false,"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"indexed":false,"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"Triggered","type":"event"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"bytes32[]","name":"accounts","type":"bytes32[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"AddTestStruct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"GetDifferentPrimitiveValue","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"GetElementAtIndex","outputs":[{"components":[{"internalType":"int32","name":"Field","type":"int32"},{"internalType":"string","name":"DifferentField","type":"string"},{"internalType":"uint8","name":"OracleId","type":"uint8"},{"internalType":"uint8[32]","name":"OracleIds","type":"uint8[32]"},{"internalType":"bytes32","name":"Account","type":"bytes32"},{"internalType":"bytes32[]","name":"Accounts","type":"bytes32[]"},{"internalType":"int192","name":"BigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"NestedStruct","type":"tuple"}],"internalType":"struct TestStruct","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GetPrimitiveValue","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"GetSliceValue","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"bytes32[]","name":"accounts","type":"bytes32[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"ReturnSeen","outputs":[{"components":[{"internalType":"int32","name":"Field","type":"int32"},{"internalType":"string","name":"DifferentField","type":"string"},{"internalType":"uint8","name":"OracleId","type":"uint8"},{"internalType":"uint8[32]","name":"OracleIds","type":"uint8[32]"},{"internalType":"bytes32","name":"Account","type":"bytes32"},{"internalType":"bytes32[]","name":"Accounts","type":"bytes32[]"},{"internalType":"int192","name":"BigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"NestedStruct","type":"tuple"}],"internalType":"struct TestStruct","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"bytes32[]","name":"accounts","type":"bytes32[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"TriggerEvent","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int32","name":"field","type":"int32"},{"indexed":false,"internalType":"string","name":"differentField","type":"string"},{"indexed":false,"internalType":"uint8","name":"oracleId","type":"uint8"},{"indexed":false,"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"indexed":false,"internalType":"address","name":"Account","type":"address"},{"indexed":false,"internalType":"address[]","name":"Accounts","type":"address[]"},{"indexed":false,"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"indexed":false,"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"Triggered","type":"event"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"AddTestStruct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"GetDifferentPrimitiveValue","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"GetElementAtIndex","outputs":[{"components":[{"internalType":"int32","name":"Field","type":"int32"},{"internalType":"string","name":"DifferentField","type":"string"},{"internalType":"uint8","name":"OracleId","type":"uint8"},{"internalType":"uint8[32]","name":"OracleIds","type":"uint8[32]"},{"internalType":"address","name":"Account","type":"address"},{"internalType":"address[]","name":"Accounts","type":"address[]"},{"internalType":"int192","name":"BigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"NestedStruct","type":"tuple"}],"internalType":"struct TestStruct","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GetPrimitiveValue","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"GetSliceValue","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"ReturnSeen","outputs":[{"components":[{"internalType":"int32","name":"Field","type":"int32"},{"internalType":"string","name":"DifferentField","type":"string"},{"internalType":"uint8","name":"OracleId","type":"uint8"},{"internalType":"uint8[32]","name":"OracleIds","type":"uint8[32]"},{"internalType":"address","name":"Account","type":"address"},{"internalType":"address[]","name":"Accounts","type":"address[]"},{"internalType":"int192","name":"BigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"NestedStruct","type":"tuple"}],"internalType":"struct TestStruct","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"int32","name":"field","type":"int32"},{"internalType":"string","name":"differentField","type":"string"},{"internalType":"uint8","name":"oracleId","type":"uint8"},{"internalType":"uint8[32]","name":"oracleIds","type":"uint8[32]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"int192","name":"bigField","type":"int192"},{"components":[{"internalType":"bytes2","name":"FixedBytes","type":"bytes2"},{"components":[{"internalType":"int64","name":"I","type":"int64"},{"internalType":"string","name":"S","type":"string"}],"internalType":"struct InnerTestStruct","name":"Inner","type":"tuple"}],"internalType":"struct MidLevelTestStruct","name":"nestedStruct","type":"tuple"}],"name":"TriggerEvent","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.bin b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.bin index 57aef1bf047..5617cf53e25 100644 --- a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.bin +++ b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a9182029102199092169190911790556111ba806100a96000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063b95ad4111161005b578063b95ad411146100d9578063bdb37c90146100ec578063da8e7a8214610101578063e669831d1461010857600080fd5b8063030d3ca2146100825780637dd6af5b146100a45780639ca04f67146100b9575b600080fd5b6107c65b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100b76100b2366004610af9565b61011b565b005b6100cc6100c7366004610be4565b61034a565b60405161009b9190610eff565b6100cc6100e7366004610af9565b6105fa565b6100f46106eb565b60405161009b9190610e03565b6003610086565b6100b7610116366004610af9565b610777565b60006040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526020808201899052604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b60208201526040016101f584611036565b905281546001818101845560009384526020938490208351600a90930201805460039390930b63ffffffff1663ffffffff199093169290921782558383015180519394929361024c939285019291909101906107cc565b50604082015160028201805460ff191660ff909216919091179055606082015161027c9060038301906020610850565b506080820151600482015560a082015180516102a29160058401916020909101906108de565b5060c082015160068201805460179290920b6001600160c01b03166001600160c01b031990921691909117905560e082015180516007808401805460f09390931c61ffff1990931692909217825560208084015180516008870180549190940b67ffffffffffffffff1667ffffffffffffffff19909116178355808201518051919392610337926009890192909101906107cc565b5050505050505050505050505050505050565b610352610918565b600061035f600184611011565b8154811061036f5761036f611158565b90600052602060002090600a0201604051806101000160405290816000820160009054906101000a900460030b60030b60030b81526020016001820180546103b690611123565b80601f01602080910402602001604051908101604052809291908181526020018280546103e290611123565b801561042f5780601f106104045761010080835404028352916020019161042f565b820191906000526020600020905b81548152906001019060200180831161041257829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116104645790505050505050815260200160048201548152602001600582018054806020026020016040519081016040528092919081815260200182805480156104f457602002820191906000526020600020905b8154815260200190600101908083116104e0575b50505091835250506006820154601790810b810b900b6020808301919091526040805180820182526007808601805460f01b6001600160f01b031916835283518085018552600888018054840b840b90930b8152600988018054959097019693959194868301949193928401919061056b90611123565b80601f016020809104026020016040519081016040528092919081815260200182805461059790611123565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050509190925250505090525090525092915050565b610602610918565b6040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526020808201899052604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b60208201526040016106da84611036565b90529b9a5050505050505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561076d57602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116107285790505b5050505050905090565b7f7d2abe6109e46b893ac1835c9287d6ad5c5ccf3d0254d2ca72225873795e0f538a8a8a8a8a8a8a8a8a8a6040516107b89a99989796959493929190610e51565b60405180910390a150505050505050505050565b8280546107d890611123565b90600052602060002090601f0160209004810192826107fa5760008555610840565b82601f1061081357805160ff1916838001178555610840565b82800160010185558215610840579182015b82811115610840578251825591602001919060010190610825565b5061084c929150610967565b5090565b6001830191839082156108405791602002820160005b838211156108a457835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302610866565b80156108d15782816101000a81549060ff02191690556001016020816000010492830192600103026108a4565b505061084c929150610967565b8280548282559060005260206000209081019282156108405791602002820182811115610840578251825591602001919060010190610825565b604080516101008101825260008082526060602083018190529282015290810161094061097c565b815260006020820181905260606040830181905282015260800161096261099b565b905290565b5b8082111561084c5760008155600101610968565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060006001600160f01b03191681526020016109626040518060400160405280600060070b8152602001606081525090565b60008083601f8401126109e957600080fd5b50813567ffffffffffffffff811115610a0157600080fd5b6020830191508360208260051b8501011115610a1c57600080fd5b9250929050565b806104008101831015610a3557600080fd5b92915050565b80356001600160f01b031981168114610a5357600080fd5b919050565b8035601781900b8114610a5357600080fd5b8035600381900b8114610a5357600080fd5b8035600781900b8114610a5357600080fd5b60008083601f840112610aa057600080fd5b50813567ffffffffffffffff811115610ab857600080fd5b602083019150836020828501011115610a1c57600080fd5b600060408284031215610ae257600080fd5b50919050565b803560ff81168114610a5357600080fd5b6000806000806000806000806000806104e08b8d031215610b1957600080fd5b610b228b610a6a565b995060208b013567ffffffffffffffff80821115610b3f57600080fd5b610b4b8e838f01610a8e565b909b509950899150610b5f60408e01610ae8565b9850610b6e8e60608f01610a23565b97506104608d013596506104808d0135915080821115610b8d57600080fd5b610b998e838f016109d7565b9096509450849150610bae6104a08e01610a58565b93506104c08d0135915080821115610bc557600080fd5b50610bd28d828e01610ad0565b9150509295989b9194979a5092959850565b600060208284031215610bf657600080fd5b5035919050565b81835260006001600160fb1b03831115610c1657600080fd5b8260051b8083602087013760009401602001938452509192915050565b600081518084526020808501945080840160005b83811015610c6357815187529582019590820190600101610c47565b509495945050505050565b8060005b6020808210610c815750610c98565b825160ff1685529384019390910190600101610c72565b50505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610ced57602081850181015186830182015201610cd1565b81811115610cff576000602083870101525b50601f01601f19169290920160200192915050565b6001600160f01b0319610d2682610a3b565b16825260006020820135603e19833603018112610d4257600080fd5b604060208501528201610d5481610a7c565b60070b60408501526020810135601e19823603018112610d7357600080fd5b8101803567ffffffffffffffff811115610d8c57600080fd5b803603831315610d9b57600080fd5b60406060870152610db3608087018260208501610c9e565b9695505050505050565b61ffff60f01b81511682526000602082015160406020850152805160070b60408501526020810151905060406060850152610dfb6080850182610cc7565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015610e4557835167ffffffffffffffff1683529284019291840191600101610e1f565b50909695505050505050565b60006104e08c60030b835260208181850152610e708285018d8f610c9e565b915060ff808c166040860152606085018b60005b84811015610ea95783610e9683610ae8565b1683529184019190840190600101610e84565b505050505087610460840152828103610480840152610ec9818789610bfd565b9050610edb6104a084018660170b9052565b8281036104c0840152610eee8185610d14565b9d9c50505050505050505050505050565b60208152610f1360208201835160030b9052565b600060208301516104e0806040850152610f31610500850183610cc7565b91506040850151610f47606086018260ff169052565b506060850151610f5a6080860182610c6e565b50608085015161048085015260a0850151601f1980868503016104a0870152610f838483610c33565b935060c08701519150610f9c6104c087018360170b9052565b60e0870151915080868503018387015250610db38382610dbd565b6040805190810167ffffffffffffffff81118282101715610fda57610fda61116e565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156110095761100961116e565b604052919050565b60008282101561103157634e487b7160e01b600052601160045260246000fd5b500390565b60006040823603121561104857600080fd5b611050610fb7565b61105983610a3b565b815260208084013567ffffffffffffffff8082111561107757600080fd5b81860191506040823603121561108c57600080fd5b611094610fb7565b61109d83610a7c565b815283830135828111156110b057600080fd5b929092019136601f8401126110c457600080fd5b8235828111156110d6576110d661116e565b6110e8601f8201601f19168601610fe0565b925080835236858286010111156110fe57600080fd5b8085850186850137600090830185015280840191909152918301919091525092915050565b600181811c9082168061113757607f821691505b60208210811415610ae257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212207f1ef47c84498df82a83ce9c4eed62d431c29fbd05ad8899d4ef1dfcb22f147e64736f6c63430008060033 \ No newline at end of file +608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a91820291021990921691909117905561125b806100a96000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80639ca04f671161005b5780639ca04f67146100cc578063b9dad6b0146100ec578063bdb37c90146100ff578063da8e7a821461011457600080fd5b8063030d3ca2146100825780636c7cf955146100a45780638b659d6e146100b9575b600080fd5b6107c65b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100b76100b2366004610b6c565b61011b565b005b6100b76100c7366004610b6c565b610371565b6100df6100da366004610c5e565b6103c6565b60405161009b9190610f97565b6100df6100fa366004610b6c565b610685565b610107610781565b60405161009b9190610e8c565b6003610086565b60006040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526001600160a01b038816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b6020820152604001610200846110d7565b905281546001818101845560009384526020938490208351600a90930201805460039390930b63ffffffff1663ffffffff19909316929092178255838301518051939492936102579392850192919091019061080d565b50604082015160028201805460ff191660ff90921691909117905560608201516102879060038301906020610891565b5060808201516004820180546001600160a01b0319166001600160a01b0390921691909117905560a082015180516102c991600584019160209091019061091f565b5060c082015160068201805460179290920b6001600160c01b03166001600160c01b031990921691909117905560e082015180516007808401805460f09390931c61ffff1990931692909217825560208084015180516008870180549190940b67ffffffffffffffff1667ffffffffffffffff1990911617835580820151805191939261035e9260098901929091019061080d565b5050505050505050505050505050505050565b7f7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d8a8a8a8a8a8a8a8a8a8a6040516103b29a99989796959493929190610eda565b60405180910390a150505050505050505050565b6103ce610974565b60006103db6001846110b2565b815481106103eb576103eb6111f9565b90600052602060002090600a0201604051806101000160405290816000820160009054906101000a900460030b60030b60030b8152602001600182018054610432906111c4565b80601f016020809104026020016040519081016040528092919081815260200182805461045e906111c4565b80156104ab5780601f10610480576101008083540402835291602001916104ab565b820191906000526020600020905b81548152906001019060200180831161048e57829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116104e05750505092845250505060048201546001600160a01b0316602080830191909152600583018054604080518285028101850182528281529401939283018282801561057f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610561575b50505091835250506006820154601790810b810b900b6020808301919091526040805180820182526007808601805460f01b6001600160f01b031916835283518085018552600888018054840b840b90930b815260098801805495909701969395919486830194919392840191906105f6906111c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610622906111c4565b801561066f5780601f106106445761010080835404028352916020019161066f565b820191906000526020600020905b81548152906001019060200180831161065257829003601f168201915b5050509190925250505090525090525092915050565b61068d610974565b6040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526001600160a01b038816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b6020820152604001610770846110d7565b90529b9a5050505050505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116107be5790505b5050505050905090565b828054610819906111c4565b90600052602060002090601f01602090048101928261083b5760008555610881565b82601f1061085457805160ff1916838001178555610881565b82800160010185558215610881579182015b82811115610881578251825591602001919060010190610866565b5061088d9291506109c3565b5090565b6001830191839082156108815791602002820160005b838211156108e557835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026108a7565b80156109125782816101000a81549060ff02191690556001016020816000010492830192600103026108e5565b505061088d9291506109c3565b828054828255906000526020600020908101928215610881579160200282015b8281111561088157825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019061093f565b604080516101008101825260008082526060602083018190529282015290810161099c6109d8565b81526000602082018190526060604083018190528201526080016109be6109f7565b905290565b5b8082111561088d57600081556001016109c4565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060006001600160f01b03191681526020016109be6040518060400160405280600060070b8152602001606081525090565b80356001600160a01b0381168114610a4a57600080fd5b919050565b60008083601f840112610a6157600080fd5b50813567ffffffffffffffff811115610a7957600080fd5b6020830191508360208260051b8501011115610a9457600080fd5b9250929050565b806104008101831015610aad57600080fd5b92915050565b80356001600160f01b031981168114610a4a57600080fd5b8035601781900b8114610a4a57600080fd5b8035600381900b8114610a4a57600080fd5b8035600781900b8114610a4a57600080fd5b60008083601f840112610b1357600080fd5b50813567ffffffffffffffff811115610b2b57600080fd5b602083019150836020828501011115610a9457600080fd5b600060408284031215610b5557600080fd5b50919050565b803560ff81168114610a4a57600080fd5b6000806000806000806000806000806104e08b8d031215610b8c57600080fd5b610b958b610add565b995060208b013567ffffffffffffffff80821115610bb257600080fd5b610bbe8e838f01610b01565b909b509950899150610bd260408e01610b5b565b9850610be18e60608f01610a9b565b9750610bf06104608e01610a33565b96506104808d0135915080821115610c0757600080fd5b610c138e838f01610a4f565b9096509450849150610c286104a08e01610acb565b93506104c08d0135915080821115610c3f57600080fd5b50610c4c8d828e01610b43565b9150509295989b9194979a5092959850565b600060208284031215610c7057600080fd5b5035919050565b8183526000602080850194508260005b85811015610cb3576001600160a01b03610ca083610a33565b1687529582019590820190600101610c87565b509495945050505050565b600081518084526020808501945080840160005b83811015610cb35781516001600160a01b031687529582019590820190600101610cd2565b8060005b6020808210610d0a5750610d21565b825160ff1685529384019390910190600101610cfb565b50505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610d7657602081850181015186830182015201610d5a565b81811115610d88576000602083870101525b50601f01601f19169290920160200192915050565b6001600160f01b0319610daf82610ab3565b16825260006020820135603e19833603018112610dcb57600080fd5b604060208501528201610ddd81610aef565b60070b60408501526020810135601e19823603018112610dfc57600080fd5b8101803567ffffffffffffffff811115610e1557600080fd5b803603831315610e2457600080fd5b60406060870152610e3c608087018260208501610d27565b9695505050505050565b61ffff60f01b81511682526000602082015160406020850152805160070b60408501526020810151905060406060850152610e846080850182610d50565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015610ece57835167ffffffffffffffff1683529284019291840191600101610ea8565b50909695505050505050565b60006104e08c60030b835260208181850152610ef98285018d8f610d27565b915060ff808c166040860152606085018b60005b84811015610f325783610f1f83610b5b565b1683529184019190840190600101610f0d565b5050505050610f4d6104608401896001600160a01b03169052565b828103610480840152610f61818789610c77565b9050610f736104a084018660170b9052565b8281036104c0840152610f868185610d9d565b9d9c50505050505050505050505050565b60208152610fab60208201835160030b9052565b600060208301516104e0806040850152610fc9610500850183610d50565b91506040850151610fdf606086018260ff169052565b506060850151610ff26080860182610cf7565b5060808501516001600160a01b031661048085015260a0850151601f1985840381016104a08701526110248483610cbe565b935060c0870151915061103d6104c087018360170b9052565b60e0870151915080868503018387015250610e3c8382610e46565b6040805190810167ffffffffffffffff8111828210171561107b5761107b61120f565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156110aa576110aa61120f565b604052919050565b6000828210156110d257634e487b7160e01b600052601160045260246000fd5b500390565b6000604082360312156110e957600080fd5b6110f1611058565b6110fa83610ab3565b815260208084013567ffffffffffffffff8082111561111857600080fd5b81860191506040823603121561112d57600080fd5b611135611058565b61113e83610aef565b8152838301358281111561115157600080fd5b929092019136601f84011261116557600080fd5b8235828111156111775761117761120f565b611189601f8201601f19168601611081565b9250808352368582860101111561119f57600080fd5b8085850186850137600090830185015280840191909152918301919091525092915050565b600181811c908216806111d857607f821691505b60208210811415610b5557634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dce1950ddad4c207dfaef7c48111c80f3a73cf85e5711bf7a3afe15473519a1664736f6c63430008060033 \ No newline at end of file diff --git a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.go b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.go index e4475c9b650..f6d0d120742 100644 --- a/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.go +++ b/core/services/relay/evm/testfiles/chain_reader_test_contract_gen.go @@ -47,16 +47,16 @@ type TestStruct struct { DifferentField string OracleId uint8 OracleIds [32]uint8 - Account [32]byte - Accounts [][32]byte + Account common.Address + Accounts []common.Address BigField *big.Int NestedStruct MidLevelTestStruct } // TestfilesMetaData contains all meta data concerning the Testfiles contract. var TestfilesMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32[]\",\"name\":\"accounts\",\"type\":\"bytes32[]\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"accounts\",\"type\":\"bytes32[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"AddTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"GetElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"Account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"Accounts\",\"type\":\"bytes32[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"accounts\",\"type\":\"bytes32[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"ReturnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"Account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"Accounts\",\"type\":\"bytes32[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"accounts\",\"type\":\"bytes32[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"TriggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a9182029102199092169190911790556111ba806100a96000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063b95ad4111161005b578063b95ad411146100d9578063bdb37c90146100ec578063da8e7a8214610101578063e669831d1461010857600080fd5b8063030d3ca2146100825780637dd6af5b146100a45780639ca04f67146100b9575b600080fd5b6107c65b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100b76100b2366004610af9565b61011b565b005b6100cc6100c7366004610be4565b61034a565b60405161009b9190610eff565b6100cc6100e7366004610af9565b6105fa565b6100f46106eb565b60405161009b9190610e03565b6003610086565b6100b7610116366004610af9565b610777565b60006040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526020808201899052604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b60208201526040016101f584611036565b905281546001818101845560009384526020938490208351600a90930201805460039390930b63ffffffff1663ffffffff199093169290921782558383015180519394929361024c939285019291909101906107cc565b50604082015160028201805460ff191660ff909216919091179055606082015161027c9060038301906020610850565b506080820151600482015560a082015180516102a29160058401916020909101906108de565b5060c082015160068201805460179290920b6001600160c01b03166001600160c01b031990921691909117905560e082015180516007808401805460f09390931c61ffff1990931692909217825560208084015180516008870180549190940b67ffffffffffffffff1667ffffffffffffffff19909116178355808201518051919392610337926009890192909101906107cc565b5050505050505050505050505050505050565b610352610918565b600061035f600184611011565b8154811061036f5761036f611158565b90600052602060002090600a0201604051806101000160405290816000820160009054906101000a900460030b60030b60030b81526020016001820180546103b690611123565b80601f01602080910402602001604051908101604052809291908181526020018280546103e290611123565b801561042f5780601f106104045761010080835404028352916020019161042f565b820191906000526020600020905b81548152906001019060200180831161041257829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116104645790505050505050815260200160048201548152602001600582018054806020026020016040519081016040528092919081815260200182805480156104f457602002820191906000526020600020905b8154815260200190600101908083116104e0575b50505091835250506006820154601790810b810b900b6020808301919091526040805180820182526007808601805460f01b6001600160f01b031916835283518085018552600888018054840b840b90930b8152600988018054959097019693959194868301949193928401919061056b90611123565b80601f016020809104026020016040519081016040528092919081815260200182805461059790611123565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050509190925250505090525090525092915050565b610602610918565b6040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526020808201899052604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b60208201526040016106da84611036565b90529b9a5050505050505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561076d57602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116107285790505b5050505050905090565b7f7d2abe6109e46b893ac1835c9287d6ad5c5ccf3d0254d2ca72225873795e0f538a8a8a8a8a8a8a8a8a8a6040516107b89a99989796959493929190610e51565b60405180910390a150505050505050505050565b8280546107d890611123565b90600052602060002090601f0160209004810192826107fa5760008555610840565b82601f1061081357805160ff1916838001178555610840565b82800160010185558215610840579182015b82811115610840578251825591602001919060010190610825565b5061084c929150610967565b5090565b6001830191839082156108405791602002820160005b838211156108a457835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302610866565b80156108d15782816101000a81549060ff02191690556001016020816000010492830192600103026108a4565b505061084c929150610967565b8280548282559060005260206000209081019282156108405791602002820182811115610840578251825591602001919060010190610825565b604080516101008101825260008082526060602083018190529282015290810161094061097c565b815260006020820181905260606040830181905282015260800161096261099b565b905290565b5b8082111561084c5760008155600101610968565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060006001600160f01b03191681526020016109626040518060400160405280600060070b8152602001606081525090565b60008083601f8401126109e957600080fd5b50813567ffffffffffffffff811115610a0157600080fd5b6020830191508360208260051b8501011115610a1c57600080fd5b9250929050565b806104008101831015610a3557600080fd5b92915050565b80356001600160f01b031981168114610a5357600080fd5b919050565b8035601781900b8114610a5357600080fd5b8035600381900b8114610a5357600080fd5b8035600781900b8114610a5357600080fd5b60008083601f840112610aa057600080fd5b50813567ffffffffffffffff811115610ab857600080fd5b602083019150836020828501011115610a1c57600080fd5b600060408284031215610ae257600080fd5b50919050565b803560ff81168114610a5357600080fd5b6000806000806000806000806000806104e08b8d031215610b1957600080fd5b610b228b610a6a565b995060208b013567ffffffffffffffff80821115610b3f57600080fd5b610b4b8e838f01610a8e565b909b509950899150610b5f60408e01610ae8565b9850610b6e8e60608f01610a23565b97506104608d013596506104808d0135915080821115610b8d57600080fd5b610b998e838f016109d7565b9096509450849150610bae6104a08e01610a58565b93506104c08d0135915080821115610bc557600080fd5b50610bd28d828e01610ad0565b9150509295989b9194979a5092959850565b600060208284031215610bf657600080fd5b5035919050565b81835260006001600160fb1b03831115610c1657600080fd5b8260051b8083602087013760009401602001938452509192915050565b600081518084526020808501945080840160005b83811015610c6357815187529582019590820190600101610c47565b509495945050505050565b8060005b6020808210610c815750610c98565b825160ff1685529384019390910190600101610c72565b50505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610ced57602081850181015186830182015201610cd1565b81811115610cff576000602083870101525b50601f01601f19169290920160200192915050565b6001600160f01b0319610d2682610a3b565b16825260006020820135603e19833603018112610d4257600080fd5b604060208501528201610d5481610a7c565b60070b60408501526020810135601e19823603018112610d7357600080fd5b8101803567ffffffffffffffff811115610d8c57600080fd5b803603831315610d9b57600080fd5b60406060870152610db3608087018260208501610c9e565b9695505050505050565b61ffff60f01b81511682526000602082015160406020850152805160070b60408501526020810151905060406060850152610dfb6080850182610cc7565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015610e4557835167ffffffffffffffff1683529284019291840191600101610e1f565b50909695505050505050565b60006104e08c60030b835260208181850152610e708285018d8f610c9e565b915060ff808c166040860152606085018b60005b84811015610ea95783610e9683610ae8565b1683529184019190840190600101610e84565b505050505087610460840152828103610480840152610ec9818789610bfd565b9050610edb6104a084018660170b9052565b8281036104c0840152610eee8185610d14565b9d9c50505050505050505050505050565b60208152610f1360208201835160030b9052565b600060208301516104e0806040850152610f31610500850183610cc7565b91506040850151610f47606086018260ff169052565b506060850151610f5a6080860182610c6e565b50608085015161048085015260a0850151601f1980868503016104a0870152610f838483610c33565b935060c08701519150610f9c6104c087018360170b9052565b60e0870151915080868503018387015250610db38382610dbd565b6040805190810167ffffffffffffffff81118282101715610fda57610fda61116e565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156110095761100961116e565b604052919050565b60008282101561103157634e487b7160e01b600052601160045260246000fd5b500390565b60006040823603121561104857600080fd5b611050610fb7565b61105983610a3b565b815260208084013567ffffffffffffffff8082111561107757600080fd5b81860191506040823603121561108c57600080fd5b611094610fb7565b61109d83610a7c565b815283830135828111156110b057600080fd5b929092019136601f8401126110c457600080fd5b8235828111156110d6576110d661116e565b6110e8601f8201601f19168601610fe0565b925080835236858286010111156110fe57600080fd5b8085850186850137600090830185015280840191909152918301919091525092915050565b600181811c9082168061113757607f821691505b60208210811415610ae257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212207f1ef47c84498df82a83ce9c4eed62d431c29fbd05ad8899d4ef1dfcb22f147e64736f6c63430008060033", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"AddTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"GetElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"ReturnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"NestedStruct\",\"type\":\"tuple\"}],\"internalType\":\"structTestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"I\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"structInnerTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"structMidLevelTestStruct\",\"name\":\"nestedStruct\",\"type\":\"tuple\"}],\"name\":\"TriggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b50600180548082018255600082905260048082047fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101805460086003958616810261010090810a8088026001600160401b0391820219909416939093179093558654808801909755848704909301805496909516909202900a91820291021990921691909117905561125b806100a96000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80639ca04f671161005b5780639ca04f67146100cc578063b9dad6b0146100ec578063bdb37c90146100ff578063da8e7a821461011457600080fd5b8063030d3ca2146100825780636c7cf955146100a45780638b659d6e146100b9575b600080fd5b6107c65b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100b76100b2366004610b6c565b61011b565b005b6100b76100c7366004610b6c565b610371565b6100df6100da366004610c5e565b6103c6565b60405161009b9190610f97565b6100df6100fa366004610b6c565b610685565b610107610781565b60405161009b9190610e8c565b6003610086565b60006040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526001600160a01b038816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b6020820152604001610200846110d7565b905281546001818101845560009384526020938490208351600a90930201805460039390930b63ffffffff1663ffffffff19909316929092178255838301518051939492936102579392850192919091019061080d565b50604082015160028201805460ff191660ff90921691909117905560608201516102879060038301906020610891565b5060808201516004820180546001600160a01b0319166001600160a01b0390921691909117905560a082015180516102c991600584019160209091019061091f565b5060c082015160068201805460179290920b6001600160c01b03166001600160c01b031990921691909117905560e082015180516007808401805460f09390931c61ffff1990931692909217825560208084015180516008870180549190940b67ffffffffffffffff1667ffffffffffffffff1990911617835580820151805191939261035e9260098901929091019061080d565b5050505050505050505050505050505050565b7f7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d8a8a8a8a8a8a8a8a8a8a6040516103b29a99989796959493929190610eda565b60405180910390a150505050505050505050565b6103ce610974565b60006103db6001846110b2565b815481106103eb576103eb6111f9565b90600052602060002090600a0201604051806101000160405290816000820160009054906101000a900460030b60030b60030b8152602001600182018054610432906111c4565b80601f016020809104026020016040519081016040528092919081815260200182805461045e906111c4565b80156104ab5780601f10610480576101008083540402835291602001916104ab565b820191906000526020600020905b81548152906001019060200180831161048e57829003601f168201915b5050509183525050600282015460ff166020808301919091526040805161040081018083529190930192916003850191826000855b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116104e05750505092845250505060048201546001600160a01b0316602080830191909152600583018054604080518285028101850182528281529401939283018282801561057f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610561575b50505091835250506006820154601790810b810b900b6020808301919091526040805180820182526007808601805460f01b6001600160f01b031916835283518085018552600888018054840b840b90930b815260098801805495909701969395919486830194919392840191906105f6906111c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610622906111c4565b801561066f5780601f106106445761010080835404028352916020019161066f565b820191906000526020600020905b81548152906001019060200180831161065257829003601f168201915b5050509190925250505090525090525092915050565b61068d610974565b6040518061010001604052808c60030b81526020018b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060ff8a166020808301919091526040805161040081810183529190930192918b918390839080828437600092019190915250505081526001600160a01b038816602080830191909152604080518883028181018401835289825291909301929189918991829190850190849080828437600092019190915250505090825250601785900b6020820152604001610770846110d7565b90529b9a5050505050505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116107be5790505b5050505050905090565b828054610819906111c4565b90600052602060002090601f01602090048101928261083b5760008555610881565b82601f1061085457805160ff1916838001178555610881565b82800160010185558215610881579182015b82811115610881578251825591602001919060010190610866565b5061088d9291506109c3565b5090565b6001830191839082156108815791602002820160005b838211156108e557835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026108a7565b80156109125782816101000a81549060ff02191690556001016020816000010492830192600103026108e5565b505061088d9291506109c3565b828054828255906000526020600020908101928215610881579160200282015b8281111561088157825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019061093f565b604080516101008101825260008082526060602083018190529282015290810161099c6109d8565b81526000602082018190526060604083018190528201526080016109be6109f7565b905290565b5b8082111561088d57600081556001016109c4565b6040518061040001604052806020906020820280368337509192915050565b604051806040016040528060006001600160f01b03191681526020016109be6040518060400160405280600060070b8152602001606081525090565b80356001600160a01b0381168114610a4a57600080fd5b919050565b60008083601f840112610a6157600080fd5b50813567ffffffffffffffff811115610a7957600080fd5b6020830191508360208260051b8501011115610a9457600080fd5b9250929050565b806104008101831015610aad57600080fd5b92915050565b80356001600160f01b031981168114610a4a57600080fd5b8035601781900b8114610a4a57600080fd5b8035600381900b8114610a4a57600080fd5b8035600781900b8114610a4a57600080fd5b60008083601f840112610b1357600080fd5b50813567ffffffffffffffff811115610b2b57600080fd5b602083019150836020828501011115610a9457600080fd5b600060408284031215610b5557600080fd5b50919050565b803560ff81168114610a4a57600080fd5b6000806000806000806000806000806104e08b8d031215610b8c57600080fd5b610b958b610add565b995060208b013567ffffffffffffffff80821115610bb257600080fd5b610bbe8e838f01610b01565b909b509950899150610bd260408e01610b5b565b9850610be18e60608f01610a9b565b9750610bf06104608e01610a33565b96506104808d0135915080821115610c0757600080fd5b610c138e838f01610a4f565b9096509450849150610c286104a08e01610acb565b93506104c08d0135915080821115610c3f57600080fd5b50610c4c8d828e01610b43565b9150509295989b9194979a5092959850565b600060208284031215610c7057600080fd5b5035919050565b8183526000602080850194508260005b85811015610cb3576001600160a01b03610ca083610a33565b1687529582019590820190600101610c87565b509495945050505050565b600081518084526020808501945080840160005b83811015610cb35781516001600160a01b031687529582019590820190600101610cd2565b8060005b6020808210610d0a5750610d21565b825160ff1685529384019390910190600101610cfb565b50505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610d7657602081850181015186830182015201610d5a565b81811115610d88576000602083870101525b50601f01601f19169290920160200192915050565b6001600160f01b0319610daf82610ab3565b16825260006020820135603e19833603018112610dcb57600080fd5b604060208501528201610ddd81610aef565b60070b60408501526020810135601e19823603018112610dfc57600080fd5b8101803567ffffffffffffffff811115610e1557600080fd5b803603831315610e2457600080fd5b60406060870152610e3c608087018260208501610d27565b9695505050505050565b61ffff60f01b81511682526000602082015160406020850152805160070b60408501526020810151905060406060850152610e846080850182610d50565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015610ece57835167ffffffffffffffff1683529284019291840191600101610ea8565b50909695505050505050565b60006104e08c60030b835260208181850152610ef98285018d8f610d27565b915060ff808c166040860152606085018b60005b84811015610f325783610f1f83610b5b565b1683529184019190840190600101610f0d565b5050505050610f4d6104608401896001600160a01b03169052565b828103610480840152610f61818789610c77565b9050610f736104a084018660170b9052565b8281036104c0840152610f868185610d9d565b9d9c50505050505050505050505050565b60208152610fab60208201835160030b9052565b600060208301516104e0806040850152610fc9610500850183610d50565b91506040850151610fdf606086018260ff169052565b506060850151610ff26080860182610cf7565b5060808501516001600160a01b031661048085015260a0850151601f1985840381016104a08701526110248483610cbe565b935060c0870151915061103d6104c087018360170b9052565b60e0870151915080868503018387015250610e3c8382610e46565b6040805190810167ffffffffffffffff8111828210171561107b5761107b61120f565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156110aa576110aa61120f565b604052919050565b6000828210156110d257634e487b7160e01b600052601160045260246000fd5b500390565b6000604082360312156110e957600080fd5b6110f1611058565b6110fa83610ab3565b815260208084013567ffffffffffffffff8082111561111857600080fd5b81860191506040823603121561112d57600080fd5b611135611058565b61113e83610aef565b8152838301358281111561115157600080fd5b929092019136601f84011261116557600080fd5b8235828111156111775761117761120f565b611189601f8201601f19168601611081565b9250808352368582860101111561119f57600080fd5b8085850186850137600090830185015280840191909152918301919091525092915050565b600181811c908216806111d857607f821691505b60208210811415610b5557634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dce1950ddad4c207dfaef7c48111c80f3a73cf85e5711bf7a3afe15473519a1664736f6c63430008060033", } // TestfilesABI is the input ABI used to generate the binding from. @@ -259,7 +259,7 @@ func (_Testfiles *TestfilesCallerSession) GetDifferentPrimitiveValue() (uint64, // GetElementAtIndex is a free data retrieval call binding the contract method 0x9ca04f67. // -// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) +// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) func (_Testfiles *TestfilesCaller) GetElementAtIndex(opts *bind.CallOpts, i *big.Int) (TestStruct, error) { var out []interface{} err := _Testfiles.contract.Call(opts, &out, "GetElementAtIndex", i) @@ -276,14 +276,14 @@ func (_Testfiles *TestfilesCaller) GetElementAtIndex(opts *bind.CallOpts, i *big // GetElementAtIndex is a free data retrieval call binding the contract method 0x9ca04f67. // -// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) +// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) func (_Testfiles *TestfilesSession) GetElementAtIndex(i *big.Int) (TestStruct, error) { return _Testfiles.Contract.GetElementAtIndex(&_Testfiles.CallOpts, i) } // GetElementAtIndex is a free data retrieval call binding the contract method 0x9ca04f67. // -// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) +// Solidity: function GetElementAtIndex(uint256 i) view returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) func (_Testfiles *TestfilesCallerSession) GetElementAtIndex(i *big.Int) (TestStruct, error) { return _Testfiles.Contract.GetElementAtIndex(&_Testfiles.CallOpts, i) } @@ -350,10 +350,10 @@ func (_Testfiles *TestfilesCallerSession) GetSliceValue() ([]uint64, error) { return _Testfiles.Contract.GetSliceValue(&_Testfiles.CallOpts) } -// ReturnSeen is a free data retrieval call binding the contract method 0xb95ad411. +// ReturnSeen is a free data retrieval call binding the contract method 0xb9dad6b0. // -// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) -func (_Testfiles *TestfilesCaller) ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { +// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) +func (_Testfiles *TestfilesCaller) ReturnSeen(opts *bind.CallOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { var out []interface{} err := _Testfiles.contract.Call(opts, &out, "ReturnSeen", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) @@ -367,59 +367,59 @@ func (_Testfiles *TestfilesCaller) ReturnSeen(opts *bind.CallOpts, field int32, } -// ReturnSeen is a free data retrieval call binding the contract method 0xb95ad411. +// ReturnSeen is a free data retrieval call binding the contract method 0xb9dad6b0. // -// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) -func (_Testfiles *TestfilesSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { +// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) +func (_Testfiles *TestfilesSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { return _Testfiles.Contract.ReturnSeen(&_Testfiles.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// ReturnSeen is a free data retrieval call binding the contract method 0xb95ad411. +// ReturnSeen is a free data retrieval call binding the contract method 0xb9dad6b0. // -// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],bytes32,bytes32[],int192,(bytes2,(int64,string)))) -func (_Testfiles *TestfilesCallerSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { +// Solidity: function ReturnSeen(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) pure returns((int32,string,uint8,uint8[32],address,address[],int192,(bytes2,(int64,string)))) +func (_Testfiles *TestfilesCallerSession) ReturnSeen(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (TestStruct, error) { return _Testfiles.Contract.ReturnSeen(&_Testfiles.CallOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// AddTestStruct is a paid mutator transaction binding the contract method 0x7dd6af5b. +// AddTestStruct is a paid mutator transaction binding the contract method 0x6c7cf955. // -// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesTransactor) AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesTransactor) AddTestStruct(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.contract.Transact(opts, "AddTestStruct", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// AddTestStruct is a paid mutator transaction binding the contract method 0x7dd6af5b. +// AddTestStruct is a paid mutator transaction binding the contract method 0x6c7cf955. // -// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.Contract.AddTestStruct(&_Testfiles.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// AddTestStruct is a paid mutator transaction binding the contract method 0x7dd6af5b. +// AddTestStruct is a paid mutator transaction binding the contract method 0x6c7cf955. // -// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesTransactorSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function AddTestStruct(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesTransactorSession) AddTestStruct(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.Contract.AddTestStruct(&_Testfiles.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// TriggerEvent is a paid mutator transaction binding the contract method 0xe669831d. +// TriggerEvent is a paid mutator transaction binding the contract method 0x8b659d6e. // -// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesTransactor) TriggerEvent(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesTransactor) TriggerEvent(opts *bind.TransactOpts, field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.contract.Transact(opts, "TriggerEvent", field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// TriggerEvent is a paid mutator transaction binding the contract method 0xe669831d. +// TriggerEvent is a paid mutator transaction binding the contract method 0x8b659d6e. // -// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.Contract.TriggerEvent(&_Testfiles.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } -// TriggerEvent is a paid mutator transaction binding the contract method 0xe669831d. +// TriggerEvent is a paid mutator transaction binding the contract method 0x8b659d6e. // -// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() -func (_Testfiles *TestfilesTransactorSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account [32]byte, accounts [][32]byte, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { +// Solidity: function TriggerEvent(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address account, address[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) returns() +func (_Testfiles *TestfilesTransactorSession) TriggerEvent(field int32, differentField string, oracleId uint8, oracleIds [32]uint8, account common.Address, accounts []common.Address, bigField *big.Int, nestedStruct MidLevelTestStruct) (*types.Transaction, error) { return _Testfiles.Contract.TriggerEvent(&_Testfiles.TransactOpts, field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct) } @@ -496,16 +496,16 @@ type TestfilesTriggered struct { DifferentField string OracleId uint8 OracleIds [32]uint8 - Account [32]byte - Accounts [][32]byte + Account common.Address + Accounts []common.Address BigField *big.Int NestedStruct MidLevelTestStruct Raw types.Log // Blockchain specific contextual infos } -// FilterTriggered is a free log retrieval operation binding the contract event 0x7d2abe6109e46b893ac1835c9287d6ad5c5ccf3d0254d2ca72225873795e0f53. +// FilterTriggered is a free log retrieval operation binding the contract event 0x7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d. // -// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) +// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address Account, address[] Accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) func (_Testfiles *TestfilesFilterer) FilterTriggered(opts *bind.FilterOpts) (*TestfilesTriggeredIterator, error) { logs, sub, err := _Testfiles.contract.FilterLogs(opts, "Triggered") @@ -515,9 +515,9 @@ func (_Testfiles *TestfilesFilterer) FilterTriggered(opts *bind.FilterOpts) (*Te return &TestfilesTriggeredIterator{contract: _Testfiles.contract, event: "Triggered", logs: logs, sub: sub}, nil } -// WatchTriggered is a free log subscription operation binding the contract event 0x7d2abe6109e46b893ac1835c9287d6ad5c5ccf3d0254d2ca72225873795e0f53. +// WatchTriggered is a free log subscription operation binding the contract event 0x7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d. // -// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) +// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address Account, address[] Accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) func (_Testfiles *TestfilesFilterer) WatchTriggered(opts *bind.WatchOpts, sink chan<- *TestfilesTriggered) (event.Subscription, error) { logs, sub, err := _Testfiles.contract.WatchLogs(opts, "Triggered") @@ -552,9 +552,9 @@ func (_Testfiles *TestfilesFilterer) WatchTriggered(opts *bind.WatchOpts, sink c }), nil } -// ParseTriggered is a log parse operation binding the contract event 0x7d2abe6109e46b893ac1835c9287d6ad5c5ccf3d0254d2ca72225873795e0f53. +// ParseTriggered is a log parse operation binding the contract event 0x7188419dcd8b51877b71766f075f3626586c0ff190e7d056aa65ce9acb649a3d. // -// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, bytes32 account, bytes32[] accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) +// Solidity: event Triggered(int32 field, string differentField, uint8 oracleId, uint8[32] oracleIds, address Account, address[] Accounts, int192 bigField, (bytes2,(int64,string)) nestedStruct) func (_Testfiles *TestfilesFilterer) ParseTriggered(log types.Log) (*TestfilesTriggered, error) { event := new(TestfilesTriggered) if err := _Testfiles.contract.UnpackLog(event, "Triggered", log); err != nil { diff --git a/core/services/relay/evm/types/abi_types.go b/core/services/relay/evm/types/abi_types.go index 001810a2b33..6749d62fd26 100644 --- a/core/services/relay/evm/types/abi_types.go +++ b/core/services/relay/evm/types/abi_types.go @@ -2,6 +2,8 @@ package types import ( "reflect" + + "github.com/ethereum/go-ethereum/common" ) //go:generate go run ./gen/main.go @@ -47,6 +49,10 @@ var typeMap = map[string]*AbiEncodingType{ Native: reflect.TypeOf(""), Checked: reflect.TypeOf(""), }, + "address": { + Native: reflect.TypeOf(common.Address{}), + Checked: reflect.TypeOf(common.Address{}), + }, } type AbiEncodingType struct { diff --git a/go.mod b/go.mod index 2d17c802bb8..d35fb6fc636 100644 --- a/go.mod +++ b/go.mod @@ -65,10 +65,10 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 github.com/smartcontractkit/chainlink-automation v1.0.1 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 - github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d + github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 @@ -324,6 +324,11 @@ replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 + // until merged upstream: https://github.com/mitchellh/mapstructure/pull/343 + github.com/mitchellh/mapstructure v1.5.0 => github.com/nolag/mapstructure v1.5.1 + // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f ) + +replace github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7 => github.com/nolag/libocr v0.0.0-20231215213449-cd7653352251 diff --git a/go.sum b/go.sum index 25e18d7e987..ec42a26dc4d 100644 --- a/go.sum +++ b/go.sum @@ -936,8 +936,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -966,6 +964,10 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= +github.com/nolag/libocr v0.0.0-20231215213449-cd7653352251 h1:JdQiA2h8BQDyOHJVA7EhQjZVlkJaww36hV+X+iWyUjs= +github.com/nolag/libocr v0.0.0-20231215213449-cd7653352251/go.mod h1:WcuWFMskcGK0MYZuH5hEhGJOzdJRUFeNEM4PAKlejI4= +github.com/nolag/mapstructure v1.5.1 h1:jEMB2AM8NXEosSMTPXlbycOpBsqttEBh5owT0gJs9/I= +github.com/nolag/mapstructure v1.5.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1134,14 +1136,14 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b h1:4S2FO2YsCRT3KiImGxI+ZAUMl/peweiQuIk8Tm4WEBU= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d h1:w4MsbOtNk6nD/mcXLstHWk9hB6g7QLtcAfhPjhwvOaQ= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d/go.mod h1:YPAfLNowdBwiKiYOwgwtbJHi8AJWbcxkbOY0ItAvkfc= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 h1:PmJRQUEd46glRHQWCrMyRTWfTocG5SlMovIOei25+ho= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc= @@ -1152,8 +1154,6 @@ github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88 github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7 h1:AA7vf29c6lFsZm+MtIEtXtg6VUOQV6waJo5MUuHfRjQ= -github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7/go.mod h1:WcuWFMskcGK0MYZuH5hEhGJOzdJRUFeNEM4PAKlejI4= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= diff --git a/integration-tests/actions/ocr2_helpers.go b/integration-tests/actions/ocr2_helpers.go index c4bc30c7c5e..11f5caef309 100644 --- a/integration-tests/actions/ocr2_helpers.go +++ b/integration-tests/actions/ocr2_helpers.go @@ -22,6 +22,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ctfClient "github.com/smartcontractkit/chainlink-testing-framework/client" + "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/testhelpers" @@ -376,6 +377,7 @@ func StartNewOCR2Round( timeout time.Duration, logger zerolog.Logger, ) error { + time.Sleep(5 * time.Second) for i := 0; i < len(ocrInstances); i++ { err := ocrInstances[i].RequestNewRound() if err != nil { @@ -383,9 +385,16 @@ func StartNewOCR2Round( } ocrRound := contracts.NewOffchainAggregatorV2RoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), timeout, logger) client.AddHeaderEventSubscription(ocrInstances[i].Address(), ocrRound) - err = client.WaitForEvents() + //err = client.WaitForEvents() + //if err != nil { + // return fmt.Errorf("failed to wait for event subscriptions of OCR instance %d: %w", i+1, err) + //} + err = ocrRound.Wait() // wait for OCR Round to complete if err != nil { - return fmt.Errorf("failed to wait for event subscriptions of OCR instance %d: %w", i+1, err) + return fmt.Errorf("failed to wait for OCR Round %d to complete", roundNumber, i) + } + if !ocrRound.Complete() { + return fmt.Errorf("failed to complete OCR Round %d for ocr instance %d", roundNumber, i) } } return nil diff --git a/integration-tests/actions/ocr2_helpers_local.go b/integration-tests/actions/ocr2_helpers_local.go index 4a08921b8d1..67b7e6f946d 100644 --- a/integration-tests/actions/ocr2_helpers_local.go +++ b/integration-tests/actions/ocr2_helpers_local.go @@ -2,6 +2,7 @@ package actions import ( "crypto/ed25519" + _ "embed" "encoding/hex" "fmt" "net/http" @@ -38,6 +39,7 @@ func CreateOCRv2JobsLocal( mockAdapterValue int, // Value to get from the mock server when querying the path chainId uint64, // EVM chain ID forwardingAllowed bool, + enableChainReaderAndCodec bool, ) error { // Collect P2P ID bootstrapP2PIds, err := bootstrapNode.MustReadP2PKeys() @@ -125,6 +127,11 @@ func CreateOCRv2JobsLocal( P2PV2Bootstrappers: pq.StringArray{p2pV2Bootstrapper}, // bootstrap node key and address @bootstrap:6690 }, } + if enableChainReaderAndCodec { + ocrSpec.OCR2OracleSpec.RelayConfig["chainReader"] = `{"chainContractReaders":{"median":{"contractABI":"[{\"inputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"link\",\"type\":\"address\"},{\"internalType\":\"int192\",\"name\":\"minAnswer_\",\"type\":\"int192\"},{\"internalType\":\"int192\",\"name\":\"maxAnswer_\",\"type\":\"int192\"},{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"billingAccessController\",\"type\":\"address\"},{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"requesterAccessController\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"decimals_\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"description_\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"current\",\"type\":\"int256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"old\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"BillingAccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"name\":\"BillingSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousConfigBlockNumber\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"oldLinkToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"newLinkToken\",\"type\":\"address\"}],\"name\":\"LinkTokenSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"startedBy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"aggregatorRoundId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"answer\",\"type\":\"int192\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"observationsTimestamp\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"int192[]\",\"name\":\"observations\",\"type\":\"int192[]\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"observers\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"juelsPerFeeCoin\",\"type\":\"int192\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"epochAndRound\",\"type\":\"uint40\"}],\"name\":\"NewTransmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"}],\"name\":\"OraclePaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"current\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previous\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"PayeeshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"old\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractAccessControllerInterface\",\"name\":\"current\",\"type\":\"address\"}],\"name\":\"RequesterAccessControllerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"round\",\"type\":\"uint8\"}],\"name\":\"RoundRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"previousValidator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"previousGasLimit\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"currentValidator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"currentGasLimit\",\"type\":\"uint32\"}],\"name\":\"ValidatorConfigSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"acceptPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"description\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBilling\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBillingAccessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLinkToken\",\"outputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequesterAccessController\",\"outputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"}],\"name\":\"getRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId_\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"roundId\",\"type\":\"uint256\"}],\"name\":\"getTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransmitters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getValidatorConfig\",\"outputs\":[{\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"validator\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDetails\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"configCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestConfigDigestAndEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"scanLogs\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestTransmissionDetails\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"ConfigDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"epoch\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"round\",\"type\":\"uint8\"},{\"internalType\":\"int192\",\"name\":\"latestAnswer_\",\"type\":\"int192\"},{\"internalType\":\"uint64\",\"name\":\"latestTimestamp_\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"linkAvailableForPayment\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"availableBalance\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitterAddress\",\"type\":\"address\"}],\"name\":\"oracleObservationCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitterAddress\",\"type\":\"address\"}],\"name\":\"owedPayment\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestNewRound\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"maximumGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"reasonableGasPriceGwei\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"observationPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"transmissionPaymentGjuels\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"accountingGas\",\"type\":\"uint24\"}],\"name\":\"setBilling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"_billingAccessController\",\"type\":\"address\"}],\"name\":\"setBillingAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"uint8\",\"name\":\"f\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"onchainConfig\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractLinkTokenInterface\",\"name\":\"linkToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"setLinkToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"payees\",\"type\":\"address[]\"}],\"name\":\"setPayees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAccessControllerInterface\",\"name\":\"requesterAccessController\",\"type\":\"address\"}],\"name\":\"setRequesterAccessController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAggregatorValidatorInterface\",\"name\":\"newValidator\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newGasLimit\",\"type\":\"uint32\"}],\"name\":\"setValidatorConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proposed\",\"type\":\"address\"}],\"name\":\"transferPayeeship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"transmit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"transmitter\",\"type\":\"address\"}],\"name\":\"withdrawPayment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]","chainReaderDefinitions":{"LatestTransmissionDetails":{"chainSpecificName":"latestTransmissionDetails","readType":0,"output_modifications":[{"type":"rename","fields":{"LatestAnswer_":"LatestAnswer","LatestTimestamp_":"LatestTimestamp"}}]},"LatestRoundRequested":{"chainSpecificName":"RoundRequested","params":{"requester":""},"readType":1}}}}}` + ocrSpec.OCR2OracleSpec.RelayConfig["codec"] = `{"chainCodecConfig" :{"MedianReport":{"TypeAbi": "[{\"Name\": \"Timestamp\",\"Type\": \"uint32\"},{\"Name\": \"Observers\",\"Type\": \"bytes32\"},{\"Name\": \"Observations\",\"Type\": \"int192[]\"},{\"Name\": \"JuelsPerFeeCoin\",\"Type\": \"int192\"}]"}}}` + } + _, err = chainlinkNode.MustCreateJob(ocrSpec) if err != nil { return fmt.Errorf("creating OCR task job on OCR node have failed: %w", err) diff --git a/integration-tests/client/chainlink_models.go b/integration-tests/client/chainlink_models.go index e6e1de25e41..41fdebac94c 100644 --- a/integration-tests/client/chainlink_models.go +++ b/integration-tests/client/chainlink_models.go @@ -1110,7 +1110,12 @@ observationSource = """ {{$key}} = {{$value}}{{end}} {{end}} [relayConfig]{{range $key, $value := .RelayConfig}} -{{$key}} = {{$value}}{{end}} + {{if or (eq $key "chainReader") (eq $key "codec")}} + {{$key}} = '{{$value}}' + {{else}} + {{$key}} = {{$value}} + {{end}} +{{end}} ` return MarshallTemplate(specWrap, "OCR2 Job", ocr2TemplateString) } diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 6a87cf45dd4..a64e08d11b5 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.1 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b github.com/smartcontractkit/chainlink-testing-framework v1.22.0 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 @@ -347,7 +347,7 @@ require ( github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 85fde648069..9c4dfa1693b 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1432,14 +1432,14 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d h1:azq9Vi7aWsq7HOUIYKFCD3Xksuz03q+UFUUkhPwYByc= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231213203435-f213bca2982d/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b h1:4S2FO2YsCRT3KiImGxI+ZAUMl/peweiQuIk8Tm4WEBU= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 h1:iu1pNbUoSDTrp+7BUtfTygZ2C0f5C2ZOBQhIoJjp+S0= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d h1:w4MsbOtNk6nD/mcXLstHWk9hB6g7QLtcAfhPjhwvOaQ= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d/go.mod h1:YPAfLNowdBwiKiYOwgwtbJHi8AJWbcxkbOY0ItAvkfc= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc= diff --git a/integration-tests/smoke/chain_reader_and_codec_test.go b/integration-tests/smoke/chain_reader_and_codec_test.go new file mode 100644 index 00000000000..6620b2c2324 --- /dev/null +++ b/integration-tests/smoke/chain_reader_and_codec_test.go @@ -0,0 +1,137 @@ +package smoke + +import ( + "fmt" + "math/big" + "net/http" + "testing" + "time" + + "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" + + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/v2/core/utils" + + "github.com/smartcontractkit/chainlink/integration-tests/actions" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" + "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" +) + +func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) { + t.Parallel() + l := logging.GetTestLogger(t) + + network, err := actions.EthereumNetworkConfigFromEnvOrDefault(l) + require.NoError(t, err, "Error building ethereum network config") + + env, err := test_env.NewCLTestEnvBuilder(). + WithTestInstance(t). + WithPrivateEthereumNetwork(network). + WithMockAdapter(). + WithCLNodeConfig(node.NewConfig(node.NewBaseConfig(), + node.WithOCR2(), + node.WithP2Pv2(), + node.WithTracing(), + func(c *chainlink.Config) { + c.Core.WebServer.HTTPMaxSize = ptr.Ptr(utils.FileSize(65536)) + }, + )). + WithCLNodes(6). + WithFunding(big.NewFloat(.1)). + WithStandardCleanup(). + WithLogStream(). + Build() + require.NoError(t, err) + fmt.Println("Done starting") + + env.ParallelTransactions(true) + + nodeClients := env.ClCluster.NodeAPIs() + bootstrapNode, workerNodes := nodeClients[0], nodeClients[1:] + + linkToken, err := env.ContractDeployer.DeployLinkTokenContract() + require.NoError(t, err, "Deploying Link Token Contract shouldn't fail") + + err = actions.FundChainlinkNodesLocal(workerNodes, env.EVMClient, big.NewFloat(.05)) + require.NoError(t, err, "Error funding Chainlink nodes") + + // Gather transmitters + var transmitters []string + for _, node := range workerNodes { + addr, err := node.PrimaryEthAddress() + if err != nil { + require.NoError(t, fmt.Errorf("error getting node's primary ETH address: %w", err)) + } + transmitters = append(transmitters, addr) + } + + ocrOffchainOptions := contracts.DefaultOffChainAggregatorOptions() + aggregatorContracts, err := actions.DeployOCRv2Contracts(1, linkToken, env.ContractDeployer, transmitters, env.EVMClient, ocrOffchainOptions) + require.NoError(t, err, "Error deploying OCRv2 aggregator contracts") + + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false, true) + require.NoError(t, err, "Error creating OCRv2 jobs") + fmt.Println("Jobs done") + + ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) + require.NoError(t, err, "Error building OCRv2 config") + fmt.Println("built local") + + err = actions.ConfigureOCRv2AggregatorContracts(env.EVMClient, ocrv2Config, aggregatorContracts) + require.NoError(t, err, "Error configuring OCRv2 aggregator contracts") + fmt.Println("built agg") + + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 50) + require.NoError(t, err) + + err = actions.StartNewOCR2Round(1, aggregatorContracts, env.EVMClient, time.Minute*5, l) + + require.NoError(t, err, "Error starting new OCR2 round") + fmt.Println("round done") + + roundData, err := aggregatorContracts[0].GetRound(testcontext.Get(t), big.NewInt(1)) + require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail") + fmt.Println("get latest") + + fmt.Printf("want 50 it's %v\n", roundData.Answer.Int64()) + + fmt.Println("answer") + + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10) + require.NoError(t, err) + fmt.Println("adapter") + + err = actions.StartNewOCR2Round(2, aggregatorContracts, env.EVMClient, time.Minute*5, l) + require.NoError(t, err) + fmt.Println("new round 2") + + roundData, err = aggregatorContracts[0].GetRound(testcontext.Get(t), big.NewInt(2)) + require.NoError(t, err, "Error getting latest OCR answer") + fmt.Println("got answer 2") + + fmt.Printf("want 10 it's %v\n", roundData.Answer.Int64()) + + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 15) + require.NoError(t, err) + fmt.Println("adapter 2") + + err = actions.StartNewOCR2Round(3, aggregatorContracts, env.EVMClient, time.Minute*5, l) + require.NoError(t, err) + fmt.Println("new round 3") + + roundData, err = aggregatorContracts[0].GetRound(testcontext.Get(t), big.NewInt(3)) + require.NoError(t, err, "Error getting latest OCR answer") + fmt.Println("got answer 3") + + fmt.Printf("want 15 it's %v\n", roundData.Answer.Int64()) + + require.Equal(t, int64(15), roundData.Answer.Int64(), + "Expected latest answer from OCR contract to be 15 but got %d", + roundData.Answer.Int64(), + ) +} diff --git a/integration-tests/smoke/forwarders_ocr2_test.go b/integration-tests/smoke/forwarders_ocr2_test.go index c2e2b12e51d..4f862d87bc3 100644 --- a/integration-tests/smoke/forwarders_ocr2_test.go +++ b/integration-tests/smoke/forwarders_ocr2_test.go @@ -78,7 +78,7 @@ func TestForwarderOCR2Basic(t *testing.T) { err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") - err = actions.CreateOCRv2JobsLocal(ocrInstances, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), true) + err = actions.CreateOCRv2JobsLocal(ocrInstances, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), true, false) require.NoError(t, err, "Error creating OCRv2 jobs with forwarders") err = env.EVMClient.WaitForEvents() require.NoError(t, err, "Error waiting for events") diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index a1a37c3b18e..bb2e5d6dd87 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -11,6 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" @@ -66,7 +67,7 @@ func TestOCRv2Basic(t *testing.T) { aggregatorContracts, err := actions.DeployOCRv2Contracts(1, linkToken, env.ContractDeployer, transmitters, env.EVMClient, ocrOffchainOptions) require.NoError(t, err, "Error deploying OCRv2 aggregator contracts") - err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false) + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false, false) require.NoError(t, err, "Error creating OCRv2 jobs") ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) @@ -141,7 +142,7 @@ func TestOCRv2JobReplacement(t *testing.T) { aggregatorContracts, err := actions.DeployOCRv2Contracts(1, linkToken, env.ContractDeployer, transmitters, env.EVMClient, ocrOffchainOptions) require.NoError(t, err, "Error deploying OCRv2 aggregator contracts") - err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false) + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 5, env.EVMClient.GetChainID().Uint64(), false, false) require.NoError(t, err, "Error creating OCRv2 jobs") ocrv2Config, err := actions.BuildMedianOCR2ConfigLocal(workerNodes, ocrOffchainOptions) @@ -177,7 +178,7 @@ func TestOCRv2JobReplacement(t *testing.T) { err = actions.DeleteBridges(nodeClients) require.NoError(t, err) - err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 15, env.EVMClient.GetChainID().Uint64(), false) + err = actions.CreateOCRv2JobsLocal(aggregatorContracts, bootstrapNode, workerNodes, env.MockAdapter, "ocr2", 15, env.EVMClient.GetChainID().Uint64(), false, false) require.NoError(t, err, "Error creating OCRv2 jobs") err = actions.StartNewOCR2Round(3, aggregatorContracts, env.EVMClient, time.Minute*3, l)