Skip to content

Commit

Permalink
bumpc libocr and update affected areas (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored May 25, 2023
1 parent 0b7a6e4 commit a3cfbcd
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 29 deletions.
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,17 @@ 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=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
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=
Expand Down Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
10 changes: 7 additions & 3 deletions pkg/solana/config_digester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions pkg/solana/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 3 additions & 1 deletion pkg/solana/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions pkg/solana/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a3cfbcd

Please sign in to comment.