diff --git a/go.mod b/go.mod index 942d3a045..6ccebf82d 100644 --- a/go.mod +++ b/go.mod @@ -11,12 +11,12 @@ require ( github.com/google/uuid v1.3.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230405215737-b39c337cdf0e - github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407 + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504 + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 github.com/stretchr/testify v1.8.2 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.24.0 - golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 + golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 golang.org/x/sync v0.1.0 gopkg.in/guregu/null.v4 v4.0.0 ) @@ -58,7 +58,6 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/riferrei/srclient v0.5.4 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect github.com/tidwall/gjson v1.14.4 // indirect diff --git a/go.sum b/go.sum index 584fcc1ee..bf3dadc9a 100644 --- a/go.sum +++ b/go.sum @@ -408,8 +408,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 h1:lEOLY2vyGIqKWUI9nzsOJRV3mb3WC9dXYORsLEUcoeY= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -417,10 +415,10 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230405215737-b39c337cdf0e h1:cXHJwAbkL5hXmwOGVUcWnxA8lfnwLaflVpwKn16mfbg= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230405215737-b39c337cdf0e/go.mod h1:HvRlco+laJ7MmlmLLabLk8h6uoW4h3JhKGBU+Xg9ivU= -github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407 h1:P3dhh6UkjA6Fxj39y4vQflv7GoDCa+QC/Du7CCDxjfQ= -github.com/smartcontractkit/libocr v0.0.0-20221209172631-568a30f68407/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504 h1:LQB12lOqT0Kg6s9zq/zDF5egSPXi7Hyar3QBmjkD32w= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -522,8 +520,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 4b29fe7b7..4faf19f53 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -17,7 +17,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework v1.11.5 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230418232145-9b83bdc20e8a github.com/smartcontractkit/chainlink/v2 v2.0.0-20230418232145-9b83bdc20e8a - github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc + github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 github.com/stretchr/testify v1.8.2 go.uber.org/zap v1.24.0 golang.org/x/crypto v0.7.0 @@ -274,7 +274,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/slack-go/slack v0.12.2 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230418142941-22572bf2b14a // indirect + github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230328102724-20c5e1a716e9 // indirect github.com/smartcontractkit/ocr2keepers v0.6.14 // indirect github.com/smartcontractkit/ocr2vrf v0.0.0-20230313164535-dce9b4be73a3 // indirect @@ -324,7 +324,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.10.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect + golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.9.0 // indirect golang.org/x/net v0.9.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 8fabf5437..39a57e35f 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1289,8 +1289,8 @@ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQ github.com/smartcontractkit/chainlink-cosmos v0.1.7-0.20230407210547-2b9d8b0180ee h1:wHyuoacM5Sn9XNioZ/55q7ZqzByzZoj5kRZLCoXrOVU= github.com/smartcontractkit/chainlink-env v0.30.20 h1:3VQIQcXoprC3AIq1lVhiby3ZEWokuKhVTlCToIvt2uc= github.com/smartcontractkit/chainlink-env v0.30.20/go.mod h1:9c0Czq4a6wZKY20BcoAlK29DnejQIiLo/MwKYtSFnHk= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230418142941-22572bf2b14a h1:dSxZz/tJU4wMHf8g/z6DUtK3sFdoi+tYY2NqyhkZJv4= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230418142941-22572bf2b14a/go.mod h1:HvRlco+laJ7MmlmLLabLk8h6uoW4h3JhKGBU+Xg9ivU= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504 h1:LQB12lOqT0Kg6s9zq/zDF5egSPXi7Hyar3QBmjkD32w= +github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230525161650-dce1bc58b504/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230328102724-20c5e1a716e9 h1:ib6EjsDRasmO2uCstsWSwWqsWeIiMBMMTR+5KcCozWo= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230328102724-20c5e1a716e9/go.mod h1:3xUS0kadHzpEM7JtoTHUJkSkByHCU+LbxnQVgCaLNJA= github.com/smartcontractkit/chainlink-testing-framework v1.11.5 h1:gYSnOQhLxgE0mxwnv015nNnPgH9kcosx+AzPboEFo38= @@ -1299,8 +1299,8 @@ github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230418232145-9b github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230418232145-9b83bdc20e8a/go.mod h1:yEBKMo/0B2q2U7peHWTUiAVYU0swpgrBGP87ZUBcsvg= github.com/smartcontractkit/chainlink/v2 v2.0.0-20230418232145-9b83bdc20e8a h1:euA3VRgcEXw8RtsYD9srEsGkl08O19JhYcWUggmi1Zs= github.com/smartcontractkit/chainlink/v2 v2.0.0-20230418232145-9b83bdc20e8a/go.mod h1:s4z5oq5g5J+ezpO8DGUcS1FnlnXzgmnLty+4F2FowEE= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc h1:aSCDAai0Dmbhp/KHTtJnC/EJcaEz4CAO80SKRzRZiQA= -github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 h1:/Gel/U5eIZ/BGGr25OrHaXiVDTAJ5DYX5+UlXp3q7Gg= +github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/smartcontractkit/ocr2keepers v0.6.14 h1:Rg+SYd8PCyd4CcCetwnRKjVEQsHVsV6QOaWcLhi+6sg= github.com/smartcontractkit/ocr2keepers v0.6.14/go.mod h1:gqIksJFzdXFsHfGdCWm1uTxbwvAltgcwcaqIgAStC1A= github.com/smartcontractkit/ocr2vrf v0.0.0-20230313164535-dce9b4be73a3 h1:YqC6hCZpYPafWIYNcWDWCG/pbrvc6vhfnIKhbp6GBQ8= @@ -1558,8 +1558,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= +golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= diff --git a/pkg/solana/config_digester.go b/pkg/solana/config_digester.go index e027a7630..00d446464 100644 --- a/pkg/solana/config_digester.go +++ b/pkg/solana/config_digester.go @@ -87,12 +87,16 @@ func (d OffchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co return digest, fmt.Errorf("incorrect hash size %d, expected %d", n, len(digest)) } - binary.BigEndian.PutUint16(digest[0:2], uint16(d.ConfigDigestPrefix())) + pre, err := d.ConfigDigestPrefix() + if err != nil { + return digest, err + } + binary.BigEndian.PutUint16(digest[0:2], uint16(pre)) return digest, nil } // This should return the same constant value on every invocation -func (OffchainConfigDigester) ConfigDigestPrefix() types.ConfigDigestPrefix { - return types.ConfigDigestPrefixSolana +func (OffchainConfigDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) { + return types.ConfigDigestPrefixSolana, nil } diff --git a/pkg/solana/report.go b/pkg/solana/report.go index 8324a5727..416786cd5 100644 --- a/pkg/solana/report.go +++ b/pkg/solana/report.go @@ -91,6 +91,6 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { return bigbigendian.DeserializeSigned(int(MedianLen), median) } -func (c ReportCodec) MaxReportLength(n int) int { - return int(ReportLen) +func (c ReportCodec) MaxReportLength(n int) (int, error) { + return int(ReportLen), nil } diff --git a/pkg/solana/report_test.go b/pkg/solana/report_test.go index 2051cfd3e..b27d4c9fc 100644 --- a/pkg/solana/report_test.go +++ b/pkg/solana/report_test.go @@ -152,7 +152,9 @@ func TestMedianFromReport(t *testing.T) { } report, err := cdc.BuildReport(pos) require.NoError(t, err) - assert.Equal(t, len(report), cdc.MaxReportLength(len(tc.obs))) + max, err := cdc.MaxReportLength(len(tc.obs)) + require.NoError(t, err) + assert.Equal(t, len(report), max) med, err := cdc.MedianFromReport(report) require.NoError(t, err) assert.Equal(t, tc.expectedMedian.String(), med.String()) diff --git a/pkg/solana/transmitter.go b/pkg/solana/transmitter.go index 0a2777b4e..8c71b7452 100644 --- a/pkg/solana/transmitter.go +++ b/pkg/solana/transmitter.go @@ -97,6 +97,6 @@ func (c *Transmitter) LatestConfigDigestAndEpoch( return state.Config.LatestConfigDigest, state.Config.Epoch, err } -func (c *Transmitter) FromAccount() types.Account { - return types.Account(c.transmissionSigner.String()) +func (c *Transmitter) FromAccount() (types.Account, error) { + return types.Account(c.transmissionSigner.String()), nil }