Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump libocr and update affected areas #291

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a
github.com/smartcontractkit/chainlink-env v0.3.29
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086
github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20230329050701-40e3b18bb026
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230530233948-90c8af98011e
github.com/smartcontractkit/chainlink-testing-framework v1.11.5
Expand Down Expand Up @@ -272,7 +272,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/libocr v0.0.0-20230503222226-29f534b2de1a // indirect
github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 // indirect
github.com/smartcontractkit/ocr2keepers v0.6.15 // indirect
github.com/smartcontractkit/ocr2vrf v0.0.0-20230510102715-c58be582bf19 // indirect
github.com/smartcontractkit/sqlx v1.3.5-0.20210805004948-4be295aacbeb // indirect
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1321,17 +1321,17 @@ github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a/go.mod h1:2
github.com/smartcontractkit/chainlink-cosmos v0.4.0 h1:xYLAcJJIm0cyMtYtMaosO45bykEwcwQOmZz3mz46Y2A=
github.com/smartcontractkit/chainlink-env v0.3.29 h1:hcIw/BeuB0wKiiE3umAUNBZzWkHO24XF3OW9xSrlMbI=
github.com/smartcontractkit/chainlink-env v0.3.29/go.mod h1:9c0Czq4a6wZKY20BcoAlK29DnejQIiLo/MwKYtSFnHk=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087 h1:Xq3iwi8Vn+5uZb6RtKOn43GbSWLW7ij6S8Nn8JZ8vsg=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087/go.mod h1:f7/HKcJWWFzINrkDDlpKsFaU6D+8D4B4OrQxkkCX4oc=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230518143827-0b7a6e43719c h1:pM7FH+S92F7Xa/VSfbIs941FDKqSmo9pYeUBWHl1Pq0=
github.com/smartcontractkit/chainlink-testing-framework v1.11.5 h1:gYSnOQhLxgE0mxwnv015nNnPgH9kcosx+AzPboEFo38=
github.com/smartcontractkit/chainlink-testing-framework v1.11.5/go.mod h1:0ktPcDE5fFSvNewsaHuC4tGVaiCMQsl5RN/cWO5k0rg=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230420131147-ce3c53a39d07 h1:UW3llKpFIfVmtu5F1GDLz0S4cze9Un46k15M+JDXSCU=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20230420131147-ce3c53a39d07/go.mod h1:dvEXSlzknoPm6YFaa0Ubs57CPFjhBbXnMju7WgiqiD4=
github.com/smartcontractkit/chainlink/v2 v2.2.0-mercury-20230527.0.20230531010141-105ba3488387 h1:6TI7kysRc1vZuRDPdU66Gvfc8k51Bh5qYf3YWPP/NFI=
github.com/smartcontractkit/chainlink/v2 v2.2.0-mercury-20230527.0.20230531010141-105ba3488387/go.mod h1:euMZJQMObJPBsmMD8Klvy/xvXg/hOzbU2D4eal8phiM=
github.com/smartcontractkit/libocr v0.0.0-20230503222226-29f534b2de1a h1:NFTlIAjSwx9vBYZeUerd0DDsvg+zZ5TSESw4dPNdwJk=
github.com/smartcontractkit/libocr v0.0.0-20230503222226-29f534b2de1a/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.15 h1:dFhg+qT+tc6b3G8N4qnAHuHe8N0m8CSA8g4YGSeTGPo=
github.com/smartcontractkit/ocr2keepers v0.6.15/go.mod h1:gqIksJFzdXFsHfGdCWm1uTxbwvAltgcwcaqIgAStC1A=
github.com/smartcontractkit/ocr2vrf v0.0.0-20230510102715-c58be582bf19 h1:RxaC+V34UEP2u/riXfcvWPZEglri4UsfQi5joUObZ08=
Expand Down
4 changes: 2 additions & 2 deletions monitoring/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.20
require (
github.com/prometheus/client_golang v1.14.0
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1
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/multierr v1.9.0
)
Expand Down
8 changes: 4 additions & 4 deletions monitoring/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a h1:B0WjTVtPW+GNY90rpmiwD/8tf3xr4jFC60sjuznNtRs=
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087 h1:Xq3iwi8Vn+5uZb6RtKOn43GbSWLW7ij6S8Nn8JZ8vsg=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087/go.mod h1:f7/HKcJWWFzINrkDDlpKsFaU6D+8D4B4OrQxkkCX4oc=
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/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/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/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand Down
4 changes: 2 additions & 2 deletions ops/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ require (
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087 // indirect
github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 // indirect
github.com/smartcontractkit/libocr v0.0.0-20230525150148-a75f6e244bb3 // indirect
github.com/spf13/cobra v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.3 // indirect
Expand Down
8 changes: 4 additions & 4 deletions ops/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a h1:B0WjTVtP
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-env v0.3.29 h1:hcIw/BeuB0wKiiE3umAUNBZzWkHO24XF3OW9xSrlMbI=
github.com/smartcontractkit/chainlink-env v0.3.29/go.mod h1:9c0Czq4a6wZKY20BcoAlK29DnejQIiLo/MwKYtSFnHk=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087 h1:Xq3iwi8Vn+5uZb6RtKOn43GbSWLW7ij6S8Nn8JZ8vsg=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087/go.mod h1:f7/HKcJWWFzINrkDDlpKsFaU6D+8D4B4OrQxkkCX4oc=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/go.mod h1:zfUba6Okm7zTBxap24I78Vq9z+twHmjXSMBAl2C2Qgc=
github.com/smartcontractkit/chainlink-testing-framework v1.11.5 h1:gYSnOQhLxgE0mxwnv015nNnPgH9kcosx+AzPboEFo38=
github.com/smartcontractkit/chainlink-testing-framework v1.11.5/go.mod h1:0ktPcDE5fFSvNewsaHuC4tGVaiCMQsl5RN/cWO5k0rg=
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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI=
github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
Expand Down
4 changes: 2 additions & 2 deletions relayer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/pkg/errors v0.9.1
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087
github.com/smartcontractkit/libocr v0.0.0-20230413082317-9561d14087cc
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086
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/exp v0.0.0-20230425010034-47ecfdc1ba53
Expand Down
8 changes: 4 additions & 4 deletions relayer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a h1:B0WjTVtPW+GNY90rpmiwD/8tf3xr4jFC60sjuznNtRs=
github.com/smartcontractkit/caigo v0.0.0-20230526231506-786d4587099a/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087 h1:Xq3iwi8Vn+5uZb6RtKOn43GbSWLW7ij6S8Nn8JZ8vsg=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230530222821-30d787a10087/go.mod h1:f7/HKcJWWFzINrkDDlpKsFaU6D+8D4B4OrQxkkCX4oc=
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/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086 h1:d2WiCTnsCtA16KVabnX3E9SZH1irp2/d0MLT0/UI3XY=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230531014621-9c303da4c086/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/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand Down
10 changes: 7 additions & 3 deletions relayer/pkg/chainlink/ocr2/config_digester.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ func (d offchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co
digest.FillBytes(configDigest[:])

// set first two bytes to the digest prefix
binary.BigEndian.PutUint16(configDigest[:2], uint16(d.ConfigDigestPrefix()))
pre, err := d.ConfigDigestPrefix()
if err != nil {
return configDigest, err
}
binary.BigEndian.PutUint16(configDigest[:2], uint16(pre))

return configDigest, nil
}

func (offchainConfigDigester) ConfigDigestPrefix() types.ConfigDigestPrefix {
return ConfigDigestPrefixStarknet
func (offchainConfigDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) {
return ConfigDigestPrefixStarknet, nil
}
4 changes: 2 additions & 2 deletions relayer/pkg/chainlink/ocr2/contract_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ func (c *contractTransmitter) LatestConfigDigestAndEpoch(
return
}

func (c *contractTransmitter) FromAccount() types.Account {
return types.Account(c.accountAddress.String())
func (c *contractTransmitter) FromAccount() (types.Account, error) {
return types.Account(c.accountAddress.String()), nil
}
6 changes: 3 additions & 3 deletions relayer/pkg/chainlink/ocr2/medianreport/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet"

junotypes "github.com/NethermindEth/juno/pkg/types"
caigotypes "github.com/smartcontractkit/caigo/types"
"github.com/pkg/errors"
caigotypes "github.com/smartcontractkit/caigo/types"

"github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median"
"github.com/smartcontractkit/libocr/offchainreporting2/types"
Expand Down Expand Up @@ -133,8 +133,8 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) {
return oo[n/2], nil
}

func (c ReportCodec) MaxReportLength(n int) int {
return prefixSizeBytes + (n * observationSizeBytes) + juelsPerFeeCoinSizeBytes + gasPriceSizeBytes
func (c ReportCodec) MaxReportLength(n int) (int, error) {
return prefixSizeBytes + (n * observationSizeBytes) + juelsPerFeeCoinSizeBytes + gasPriceSizeBytes, nil
}

func SplitReport(report types.Report) ([][]byte, error) {
Expand Down
4 changes: 3 additions & 1 deletion relayer/pkg/chainlink/ocr2/medianreport/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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