diff --git a/go.mod b/go.mod index 06402b2bd..fb587e906 100644 --- a/go.mod +++ b/go.mod @@ -17,8 +17,8 @@ require ( github.com/jpillora/backoff v1.0.0 github.com/pelletier/go-toml/v2 v2.2.0 github.com/prometheus/client_golang v1.17.0 - github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536 - github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e + github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a + github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 diff --git a/go.sum b/go.sum index 9e8bacb8e..220154a50 100644 --- a/go.sum +++ b/go.sum @@ -435,12 +435,12 @@ 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.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536 h1:k6DLMavlqxr7cnZN1DOZLwxeiZfCK2UHeCJ0tyXSuw4= -github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a h1:bikufO+dNLABCBFayR37JERW45veXBjMdDjogDw2JCQ= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e h1:9ypZ/8aW8Vm497i1gXHcT96oNLiu88jbg9QdX+IUE3E= -github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= +github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= 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= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 509753a3a..a777663d6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -14,13 +14,13 @@ require ( github.com/lib/pq v1.10.9 github.com/pelletier/go-toml/v2 v2.2.2 github.com/rs/zerolog v1.33.0 - github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240911182932-3c609a6ac664 + github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240930233806-34ea20cf17a5 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 - github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240924233109-8b37da54ea01 - github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240924233109-8b37da54ea01 - github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 + github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241001112034-e0a907140a63 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241001112034-e0a907140a63 + github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.28.0 golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 @@ -117,7 +117,6 @@ require ( github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/containerd v1.7.18 // indirect - github.com/containerd/continuity v0.4.3 // indirect github.com/containerd/errdefs v0.1.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect @@ -335,7 +334,6 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/opencontainers/runc v1.1.10 // indirect github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect @@ -377,17 +375,17 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/slack-go/slack v0.12.2 // indirect github.com/smartcontractkit/chain-selectors v1.0.23 // indirect - github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20240924115754-8858b0423283 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect - github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae // indirect + github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240930232254-0c951d25dee5 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241001110749-d9aa240e94e1 // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240930233417-f2db555fecf5 // indirect + github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240930233258-5ec01acfafde // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20240930233321-c6231b8b2a65 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240930233834-e1fdf2284e8c // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect - github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect - github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect + github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect + github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.2 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/sony/gobreaker v0.5.0 // indirect @@ -410,7 +408,7 @@ require ( github.com/tidwall/btree v1.6.0 // indirect github.com/tidwall/gjson v1.17.0 // indirect github.com/tidwall/match v1.1.1 // indirect - github.com/tidwall/pretty v1.2.0 // indirect + github.com/tidwall/pretty v1.2.1 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 55f790540..bb0c659ae 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -259,8 +259,8 @@ github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3 h1:SDlJ7bAm4ewvrmZtR0DaiYbQGdKPeaaIm7bM+qRhFeU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= @@ -779,8 +779,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= -github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450WpPH+yvXo= github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -1390,20 +1390,20 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnjjIQAEBnutCtksPzVDY= github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= -github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= -github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20240924115754-8858b0423283 h1:f0vdqcOL9kJZwfmWE76roIyEuiZx/R82js0IfXNAvXg= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20240924115754-8858b0423283/go.mod h1:KP82vFCqm+M1G1t6Vos5CewGUGYJkxxCEdxnta4uLlE= -github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536 h1:k6DLMavlqxr7cnZN1DOZLwxeiZfCK2UHeCJ0tyXSuw4= -github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926180110-0784a13b2536/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q= -github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs= +github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240930232254-0c951d25dee5 h1:FKmzpD3gpATPTtHBZYY3olxQNEIFrBoqmPVAiFw6K0w= +github.com/smartcontractkit/chainlink-automation v1.0.5-0.20240930232254-0c951d25dee5/go.mod h1:0noOo0WRIYoTUnmdNE86lYDrvST9TgVCIKWLxqCiJ/s= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241001110749-d9aa240e94e1 h1:y10Gv+xG6zZ9L6ti8tWSfFDpOZ4XqEF+nWYdDKsceeQ= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241001110749-d9aa240e94e1/go.mod h1:m8WPFcHYDX3GAsgEJujGgYDEVREQxowmILoYn8UiR9I= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a h1:bikufO+dNLABCBFayR37JERW45veXBjMdDjogDw2JCQ= +github.com/smartcontractkit/chainlink-common v0.2.3-0.20241008131024-f2b58057d10a/go.mod h1:tsGgeEJc5SUSlfVGSX0wR0EkRU3pM58D6SKF97V68ko= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240930233417-f2db555fecf5 h1:bREOhEHi1H2HP2P3ENWWG78Spd05IXStE3tGU+2rICU= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240930233417-f2db555fecf5/go.mod h1:YJqQwshHmrthrEEb/NoBVRZuARbnWzOP6WLnBJfLI2A= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240930233258-5ec01acfafde h1:215V6lBcOXlHsYBwkeFkb/XrKMGXR+Iyiie5DM61ITw= +github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240930233258-5ec01acfafde/go.mod h1:7gOPWifgcZ9zqMyZaLfGnP/PtMqeoGIrBxkeV51uvJ8= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240930233321-c6231b8b2a65 h1:6wX8xDvkL9w/ooONr9nRKMelzMcUi8LmviqLbk2vKcM= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20240930233321-c6231b8b2a65/go.mod h1:DR0HSDz/Mnzhi6j0fbrfHYcnbOkJddGnaCFT/R38oyQ= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240930233834-e1fdf2284e8c h1:xXieDRsqnI+mXkiWPP0bobAygN3WcKn/H7Rz/45YFG0= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240930233834-e1fdf2284e8c/go.mod h1:GSrZCTJleT1t+ycrjnLFgaG8LQl05ZqAeJ/25LFkK8E= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9 h1:/2kAb6y854viKigkdFMWDNNbaz3zD0gAkbZoSHC8Rrg= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9/go.mod h1:7R5wGWWJi0dr5Y5cXbLQ4vSeIj0ElvhBaymcfvqqUmo= github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 h1:VIxK8u0Jd0Q/VuhmsNm6Bls6Tb31H/sA3A/rbc5hnhg= @@ -1412,18 +1412,18 @@ github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1 h1:2OxnPfvj github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1/go.mod h1:afY3QmNgeR/VI1pRbGH8g3YXGy7C2RrFOwUzEFvL3L8= github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0 h1:gfhfTn7HkbUHNooSF3c9vzQyN8meWJVGt6G/pNUbpYk= github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0/go.mod h1:tqajhpUJA/9OaMCLitghBXjAgqYO4i27St0F4TUO3+M= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240924233109-8b37da54ea01 h1:UWorvRQoLSXcUpd9l86NMukrvOIecEQzUdBv6jqsVsY= -github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240924233109-8b37da54ea01/go.mod h1:C88WPhGG4MGJ1c1w5G5suEkxyqqkf9yqIBE/L3zXpu8= -github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240924233109-8b37da54ea01 h1:JLav4sr7cvfRTUiQDkRJk954wR8kEJLr5rRRYQYB/yA= -github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20240924233109-8b37da54ea01/go.mod h1:YSzPgNWJ8oM489tXQPdwAgNRhlvEjicfONRVsObwo3w= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241001112034-e0a907140a63 h1:P2/2aCa/quOVQQu0H7wLT1/d21f5ebIA6tf3Hxcppos= +github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241001112034-e0a907140a63/go.mod h1:4VmWcfsr+ZLRpHYIRX7TI0ChdvYMEybZ3f4h+kanylY= +github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241001112034-e0a907140a63 h1:3ns3uSvEN/mAewN3XJuURO+m+9/8Oq629nYtXBiM7q4= +github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241001112034-e0a907140a63/go.mod h1:ywTafNvPtgPgU+YSSU+tN7i2HRPjlcuQq3grH7ZO2kM= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7 h1:e38V5FYE7DA1JfKXeD5Buo/7lczALuVXlJ8YNTAUxcw= -github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -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= -github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:G5Sd/yzHWf26rQ+X0nG9E0buKPqRGPMJAfk2gwCzOOw= +github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= +github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= +github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= +github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= +github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:NSc7hgOQbXG3DAwkOdWnZzLTZENXSwDJ7Va1nBp0YU0= github.com/smartcontractkit/wsrpc v0.8.2 h1:XB/xcn/MMseHW+8JE8+a/rceA86ck7Ur6cEa9LiUC8M= github.com/smartcontractkit/wsrpc v0.8.2/go.mod h1:2u/wfnhl5R4RlSXseN4n6HHIWk8w1Am3AT6gWftQbNg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1509,8 +1509,9 @@ github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vl github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= diff --git a/integration-tests/solclient/ocr2.go b/integration-tests/solclient/ocr2.go index 747494645..2a343df89 100644 --- a/integration-tests/solclient/ocr2.go +++ b/integration-tests/solclient/ocr2.go @@ -10,10 +10,11 @@ import ( "github.com/gagliardetto/solana-go" "github.com/gagliardetto/solana-go/rpc" "github.com/rs/zerolog/log" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/libocr/offchainreporting2/confighelper" - ocr_2 "github.com/smartcontractkit/chainlink-solana/contracts/generated/ocr_2" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" + + "github.com/smartcontractkit/chainlink-solana/contracts/generated/ocr_2" "github.com/smartcontractkit/chainlink-solana/integration-tests/utils" ) @@ -254,6 +255,7 @@ func (m *OCRv2) Configure(cfg contracts.OffChainAggregatorV2Config) error { cfg.S, cfg.Oracles, cfg.ReportingPluginConfig, + nil, cfg.MaxDurationQuery.Duration(), cfg.MaxDurationObservation.Duration(), cfg.MaxDurationReport.Duration(), diff --git a/pkg/monitoring/source_envelope.go b/pkg/monitoring/source_envelope.go index 7a475bed7..631548523 100644 --- a/pkg/monitoring/source_envelope.go +++ b/pkg/monitoring/source_envelope.go @@ -83,7 +83,7 @@ func (s *envelopeSource) Fetch(ctx context.Context) (interface{}, error) { if err != nil { return nil, fmt.Errorf("failed to fetch state from on-chain: %w", err) } - contractConfig, err := pkgSolana.ConfigFromState(state) + contractConfig, err := pkgSolana.ConfigFromState(ctx, state) if err != nil { return nil, fmt.Errorf("failed to decode ContractConfig from on-chain state: %w", err) } diff --git a/pkg/solana/cmd/chainlink-solana/main.go b/pkg/solana/cmd/chainlink-solana/main.go index d65f6cbc9..09656cf87 100644 --- a/pkg/solana/cmd/chainlink-solana/main.go +++ b/pkg/solana/cmd/chainlink-solana/main.go @@ -72,7 +72,7 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore return nil, fmt.Errorf("failed to create chain: %w", err) } - ra := &loop.RelayerAdapter{Relayer: solana.NewRelayer(c.Logger, chain, capRegistry), RelayerExt: chain} + ra := solana.NewRelayer(c.Logger, chain, capRegistry) c.SubService(ra) diff --git a/pkg/solana/config_digester.go b/pkg/solana/config_digester.go index 289a20416..74884437b 100644 --- a/pkg/solana/config_digester.go +++ b/pkg/solana/config_digester.go @@ -1,6 +1,7 @@ package solana import ( + "context" "crypto/sha256" "encoding/binary" "fmt" @@ -20,7 +21,7 @@ type OffchainConfigDigester struct { } // ConfigDigest is meant to do the same thing as config_digest_from_data from the program. -func (d OffchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.ConfigDigest, error) { +func (d OffchainConfigDigester) ConfigDigest(ctx context.Context, cfg types.ContractConfig) (types.ConfigDigest, error) { digest := types.ConfigDigest{} buf := sha256.New() @@ -85,7 +86,7 @@ func (d OffchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co return digest, fmt.Errorf("incorrect hash size %d, expected %d", n, len(digest)) } - pre, err := d.ConfigDigestPrefix() + pre, err := d.ConfigDigestPrefix(ctx) if err != nil { return digest, err } @@ -95,6 +96,6 @@ func (d OffchainConfigDigester) ConfigDigest(cfg types.ContractConfig) (types.Co } // This should return the same constant value on every invocation -func (OffchainConfigDigester) ConfigDigestPrefix() (types.ConfigDigestPrefix, error) { +func (OffchainConfigDigester) ConfigDigestPrefix(ctx context.Context) (types.ConfigDigestPrefix, error) { return types.ConfigDigestPrefixSolana, nil } diff --git a/pkg/solana/config_digester_test.go b/pkg/solana/config_digester_test.go index 9719d627b..eaab12003 100644 --- a/pkg/solana/config_digester_test.go +++ b/pkg/solana/config_digester_test.go @@ -6,6 +6,8 @@ import ( bin "github.com/gagliardetto/binary" "github.com/gagliardetto/solana-go" "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestConfigDigester(t *testing.T) { @@ -22,10 +24,10 @@ func TestConfigDigester(t *testing.T) { var state State err = bin.NewBorshDecoder(mockState.Raw).Decode(&state) require.NoError(t, err) - config, err := ConfigFromState(state) + config, err := ConfigFromState(tests.Context(t), state) require.NoError(t, err) - actualDigest, err := digester.ConfigDigest(config) + actualDigest, err := digester.ConfigDigest(tests.Context(t), config) require.NoError(t, err) expectedDigest := mockState.ConfigDigestHex diff --git a/pkg/solana/config_tracker.go b/pkg/solana/config_tracker.go index 3287aa115..a04450edd 100644 --- a/pkg/solana/config_tracker.go +++ b/pkg/solana/config_tracker.go @@ -25,7 +25,7 @@ func (c *ConfigTracker) LatestConfigDetails(ctx context.Context) (changedInBlock return state.Config.LatestConfigBlockNumber, state.Config.LatestConfigDigest, err } -func ConfigFromState(state State) (types.ContractConfig, error) { +func ConfigFromState(ctx context.Context, state State) (types.ContractConfig, error) { pubKeys := []types.OnchainPublicKey{} accounts := []types.Account{} oracles, err := state.Oracles.Data() @@ -43,7 +43,7 @@ func ConfigFromState(state State) (types.ContractConfig, error) { Max: state.Config.MaxAnswer.BigInt(), } - onchainConfig, err := median.StandardOnchainConfigCodec{}.Encode(onchainConfigStruct) + onchainConfig, err := median.StandardOnchainConfigCodec{}.Encode(ctx, onchainConfigStruct) if err != nil { return types.ContractConfig{}, err } @@ -70,7 +70,7 @@ func (c *ConfigTracker) LatestConfig(ctx context.Context, changedInBlock uint64) if err != nil { return types.ContractConfig{}, err } - return ConfigFromState(state) + return ConfigFromState(ctx, state) } // LatestBlockHeight returns the height of the most recent block in the chain. diff --git a/pkg/solana/monitor/balance.go b/pkg/solana/monitor/balance.go index 00f873488..5c7c88f5d 100644 --- a/pkg/solana/monitor/balance.go +++ b/pkg/solana/monitor/balance.go @@ -64,14 +64,14 @@ func (b *balanceMonitor) Name() string { } func (b *balanceMonitor) Start(context.Context) error { - return b.StartOnce("SolanaBalanceMonitor", func() error { + return b.StartOnce("BalanceMonitor", func() error { go b.monitor() return nil }) } func (b *balanceMonitor) Close() error { - return b.StopOnce("SolanaBalanceMonitor", func() error { + return b.StopOnce("BalanceMonitor", func() error { close(b.stop) <-b.done return nil diff --git a/pkg/solana/relay.go b/pkg/solana/relay.go index ec7aec9f5..d53e7de47 100644 --- a/pkg/solana/relay.go +++ b/pkg/solana/relay.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "math/big" "github.com/gagliardetto/solana-go" @@ -36,11 +37,11 @@ type Relayer struct { } // Note: constructed in core -func NewRelayer(lggr logger.Logger, chain Chain, capabilitiesRegistry core.CapabilitiesRegistry) *Relayer { +func NewRelayer(lggr logger.Logger, chain Chain, _ core.CapabilitiesRegistry) *Relayer { return &Relayer{ - lggr: lggr, + lggr: logger.Named(lggr, "Relayer"), chain: chain, - stopCh: make(chan struct{}), + stopCh: make(services.StopChan), } } @@ -49,13 +50,13 @@ func (r *Relayer) Name() string { } // Start starts the relayer respecting the given context. -func (r *Relayer) Start(context.Context) error { +func (r *Relayer) Start(ctx context.Context) error { return r.StartOnce("SolanaRelayer", func() error { // No subservices started on relay start, but when the first job is started if r.chain == nil { return errors.New("Solana unavailable") } - return nil + return r.chain.Start(ctx) }) } @@ -63,7 +64,7 @@ func (r *Relayer) Start(context.Context) error { func (r *Relayer) Close() error { return r.StopOnce("SolanaRelayer", func() error { close(r.stopCh) - return nil + return r.chain.Close() }) } @@ -71,32 +72,47 @@ func (r *Relayer) Ready() error { return r.chain.Ready() } -// Healthy only if all subservices are healthy func (r *Relayer) Healthy() error { return nil } func (r *Relayer) HealthReport() map[string]error { - return map[string]error{r.Name(): r.Healthy()} + hp := map[string]error{r.Name(): r.Healthy()} + services.CopyHealth(hp, r.chain.HealthReport()) + return hp } -func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { +func (r *Relayer) LatestHead(ctx context.Context) (relaytypes.Head, error) { + return r.chain.LatestHead(ctx) +} + +func (r *Relayer) GetChainStatus(ctx context.Context) (relaytypes.ChainStatus, error) { + return r.chain.GetChainStatus(ctx) +} + +func (r *Relayer) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []relaytypes.NodeStatus, nextPageToken string, total int, err error) { + return r.chain.ListNodeStatuses(ctx, pageSize, pageToken) +} + +func (r *Relayer) Transact(ctx context.Context, from, to string, amount *big.Int, balanceCheck bool) error { + return r.chain.Transact(ctx, from, to, amount, balanceCheck) +} + +func (r *Relayer) NewMercuryProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { return nil, errors.New("mercury is not supported for solana") } -func (r *Relayer) NewLLOProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.LLOProvider, error) { +func (r *Relayer) NewLLOProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.LLOProvider, error) { return nil, errors.New("data streams is not supported for solana") } -func (r *Relayer) NewCCIPCommitProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPCommitProvider, error) { +func (r *Relayer) NewCCIPCommitProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPCommitProvider, error) { return nil, errors.New("ccip.commit is not supported for solana") } -func (r *Relayer) NewCCIPExecProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPExecProvider, error) { +func (r *Relayer) NewCCIPExecProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.CCIPExecProvider, error) { return nil, errors.New("ccip.exec is not supported for solana") } -func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { - ctx, cancel := r.stopCh.NewCtx() - defer cancel() +func (r *Relayer) NewConfigProvider(ctx context.Context, args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { configWatcher, err := newConfigProvider(ctx, r.lggr, r.chain, args) if err != nil { // Never return (*configProvider)(nil) @@ -109,13 +125,11 @@ func (r *Relayer) NewChainWriter(_ context.Context, _ []byte) (relaytypes.ChainW return nil, errors.New("chain writer is not supported for solana") } -func (r *Relayer) NewContractReader(_ []byte) (relaytypes.ContractReader, error) { +func (r *Relayer) NewContractReader(ctx context.Context, _ []byte) (relaytypes.ContractReader, error) { return nil, errors.New("contract reader is not supported for solana") } -func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { - ctx, cancel := r.stopCh.NewCtx() - defer cancel() +func (r *Relayer) NewMedianProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { lggr := logger.Named(r.lggr, "MedianProvider") configWatcher, err := newConfigProvider(ctx, lggr, r.chain, rargs) if err != nil { @@ -163,11 +177,11 @@ func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes }, nil } -func (r *Relayer) NewFunctionsProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { +func (r *Relayer) NewFunctionsProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { return nil, errors.New("functions are not supported for solana") } -func (r *Relayer) NewAutomationProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.AutomationProvider, error) { +func (r *Relayer) NewAutomationProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.AutomationProvider, error) { return nil, errors.New("automation is not supported for solana") } @@ -312,10 +326,10 @@ func (p *medianProvider) Codec() relaytypes.Codec { return nil } -func (r *Relayer) NewPluginProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.PluginProvider, error) { +func (r *Relayer) NewPluginProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.PluginProvider, error) { return nil, errors.New("plugin provider is not supported for solana") } -func (r *Relayer) NewOCR3CapabilityProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.OCR3CapabilityProvider, error) { +func (r *Relayer) NewOCR3CapabilityProvider(ctx context.Context, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.OCR3CapabilityProvider, error) { return nil, errors.New("ocr3 capability provider is not supported for solana") } diff --git a/pkg/solana/report.go b/pkg/solana/report.go index 35d384de7..c89af9fc7 100644 --- a/pkg/solana/report.go +++ b/pkg/solana/report.go @@ -1,6 +1,7 @@ package solana import ( + "context" "encoding/binary" "fmt" "math/big" @@ -15,7 +16,7 @@ var _ median.ReportCodec = (*ReportCodec)(nil) type ReportCodec struct{} -func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types.Report, error) { +func (c ReportCodec) BuildReport(ctx context.Context, oo []median.ParsedAttributedObservation) (types.Report, error) { n := len(oo) if n == 0 { return nil, fmt.Errorf("cannot build report from empty attributed observations") @@ -78,7 +79,7 @@ func (c ReportCodec) BuildReport(oo []median.ParsedAttributedObservation) (types return types.Report(report), nil } -func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { +func (c ReportCodec) MedianFromReport(ctx context.Context, report types.Report) (*big.Int, error) { // report should contain timestamp + observers + median + juels per eth if len(report) != int(ReportLen) { return nil, fmt.Errorf("report length mismatch: %d (received), %d (expected)", len(report), ReportLen) @@ -91,7 +92,7 @@ func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error) { return bigbigendian.DeserializeSigned(int(MedianLen), median) } -func (c ReportCodec) MaxReportLength(n int) (int, error) { +func (c ReportCodec) MaxReportLength(ctx context.Context, n int) (int, error) { return int(ReportLen), nil } diff --git a/pkg/solana/report_fuzz_test.go b/pkg/solana/report_fuzz_test.go index 5aaa1cb19..34027d476 100644 --- a/pkg/solana/report_fuzz_test.go +++ b/pkg/solana/report_fuzz_test.go @@ -11,13 +11,15 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) // Ensure your env is using go 1.18 then in pkg/solana: // go test -tags=go1.18 -fuzz ./... func FuzzReportCodecMedianFromReport(f *testing.F) { cdc := ReportCodec{} - report, err := cdc.BuildReport([]median.ParsedAttributedObservation{ + report, err := cdc.BuildReport(tests.Context(f), []median.ParsedAttributedObservation{ {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(10), JuelsPerFeeCoin: big.NewInt(100000)}, {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(10), JuelsPerFeeCoin: big.NewInt(200000)}, {Timestamp: uint32(time.Now().Unix()), Value: big.NewInt(11), JuelsPerFeeCoin: big.NewInt(300000)}}) @@ -26,11 +28,12 @@ func FuzzReportCodecMedianFromReport(f *testing.F) { // Seed with valid report f.Add([]byte(report)) f.Fuzz(func(t *testing.T, report []byte) { - med, err := cdc.MedianFromReport(report) + ctx := tests.Context(t) + med, err := cdc.MedianFromReport(ctx, report) if err == nil { // Should always be able to build a report from the medians extracted // Note however that juelsPerFeeCoin is only 8 bytes, so we can use the median for it - _, err = cdc.BuildReport([]median.ParsedAttributedObservation{{Timestamp: uint32(time.Now().Unix()), Value: med, JuelsPerFeeCoin: big.NewInt(100000)}}) + _, err = cdc.BuildReport(ctx, []median.ParsedAttributedObservation{{Timestamp: uint32(time.Now().Unix()), Value: med, JuelsPerFeeCoin: big.NewInt(100000)}}) require.NoError(t, err) } }) diff --git a/pkg/solana/report_test.go b/pkg/solana/report_test.go index 4f4b38bdd..84452dada 100644 --- a/pkg/solana/report_test.go +++ b/pkg/solana/report_test.go @@ -16,9 +16,11 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestBuildReport(t *testing.T) { + ctx := tests.Context(t) c := ReportCodec{} oo := []median.ParsedAttributedObservation{} @@ -40,7 +42,7 @@ func TestBuildReport(t *testing.T) { observers[i] = uint8(i) } - report, err := c.BuildReport(oo) + report, err := c.BuildReport(ctx, oo) assert.NoError(t, err) // validate length @@ -75,7 +77,7 @@ func TestMedianFromOnChainReport(t *testing.T) { 13, 224, 182, 179, 167, 100, 0, 0, // juels per luna (1 with 18 decimal places) } - res, err := c.MedianFromReport(report) + res, err := c.MedianFromReport(tests.Context(t), report) assert.NoError(t, err) assert.Equal(t, "1234567890", res.String()) } @@ -89,7 +91,7 @@ type medianTest struct { func TestMedianFromReport(t *testing.T) { cdc := ReportCodec{} // Requires at least one obs - _, err := cdc.BuildReport(nil) + _, err := cdc.BuildReport(tests.Context(t), nil) require.Error(t, err) var tt = []medianTest{ { @@ -143,6 +145,7 @@ func TestMedianFromReport(t *testing.T) { for _, tc := range tt { tc := tc t.Run(tc.name, func(t *testing.T) { + ctx := tests.Context(t) var pos []median.ParsedAttributedObservation for i, obs := range tc.obs { pos = append(pos, median.ParsedAttributedObservation{ @@ -151,12 +154,12 @@ func TestMedianFromReport(t *testing.T) { Observer: commontypes.OracleID(uint8(i))}, ) } - report, err := cdc.BuildReport(pos) + report, err := cdc.BuildReport(ctx, pos) require.NoError(t, err) - max, err := cdc.MaxReportLength(len(tc.obs)) + max, err := cdc.MaxReportLength(ctx, len(tc.obs)) require.NoError(t, err) assert.Equal(t, len(report), max) - med, err := cdc.MedianFromReport(report) + med, err := cdc.MedianFromReport(ctx, report) require.NoError(t, err) assert.Equal(t, tc.expectedMedian.String(), med.String()) count, err := cdc.ObserversCountFromReport(report) @@ -202,6 +205,7 @@ func TestHashReport(t *testing.T) { } func TestNegativeMedianValue(t *testing.T) { + ctx := tests.Context(t) c := ReportCodec{} oo := []median.ParsedAttributedObservation{ median.ParsedAttributedObservation{ @@ -213,7 +217,7 @@ func TestNegativeMedianValue(t *testing.T) { } // create report - report, err := c.BuildReport(oo) + report, err := c.BuildReport(ctx, oo) assert.NoError(t, err) // check report properly encoded negative number @@ -229,12 +233,13 @@ func TestNegativeMedianValue(t *testing.T) { assert.True(t, oo[0].Value.Cmp(medianFromRaw.BigInt()) == 0, "median observation in raw report does not match") // check report can be parsed properly with a negative number - res, err := c.MedianFromReport(report) + res, err := c.MedianFromReport(ctx, report) assert.NoError(t, err) assert.True(t, oo[0].Value.Cmp(res) == 0) } func TestReportHandleOverflow(t *testing.T) { + ctx := tests.Context(t) // too large observation should not cause panic c := ReportCodec{} oo := []median.ParsedAttributedObservation{ @@ -245,7 +250,7 @@ func TestReportHandleOverflow(t *testing.T) { Observer: commontypes.OracleID(0), }, } - _, err := c.BuildReport(oo) + _, err := c.BuildReport(ctx, oo) assert.Error(t, err) // too large juelsPerFeeCoin should not cause panic @@ -257,6 +262,6 @@ func TestReportHandleOverflow(t *testing.T) { Observer: commontypes.OracleID(0), }, } - _, err = c.BuildReport(oo) + _, err = c.BuildReport(ctx, oo) assert.Error(t, err) } diff --git a/pkg/solana/transmitter.go b/pkg/solana/transmitter.go index e524470d5..ca5a55dc9 100644 --- a/pkg/solana/transmitter.go +++ b/pkg/solana/transmitter.go @@ -101,6 +101,6 @@ func (c *Transmitter) LatestConfigDigestAndEpoch( return state.Config.LatestConfigDigest, state.Config.Epoch, err } -func (c *Transmitter) FromAccount() (types.Account, error) { +func (c *Transmitter) FromAccount(ctx context.Context) (types.Account, error) { return types.Account(c.transmissionSigner.String()), nil } diff --git a/pkg/solana/txm/txm.go b/pkg/solana/txm/txm.go index 87861fd83..3eceb8df3 100644 --- a/pkg/solana/txm/txm.go +++ b/pkg/solana/txm/txm.go @@ -41,17 +41,17 @@ var _ loop.Keystore = (SimpleKeystore)(nil) // Txm manages transactions for the solana blockchain. // simple implementation with no persistently stored txs type Txm struct { - starter services.StateMachine - lggr logger.Logger - chSend chan pendingTx - chSim chan pendingTx - chStop services.StopChan - done sync.WaitGroup - cfg config.Config - txs PendingTxContext - ks SimpleKeystore - client *utils.LazyLoad[client.ReaderWriter] - fee fees.Estimator + services.StateMachine + lggr logger.Logger + chSend chan pendingTx + chSim chan pendingTx + chStop services.StopChan + done sync.WaitGroup + cfg config.Config + txs PendingTxContext + ks SimpleKeystore + client *utils.LazyLoad[client.ReaderWriter] + fee fees.Estimator } type TxConfig struct { @@ -76,7 +76,7 @@ type pendingTx struct { // NewTxm creates a txm. Uses simulation so should only be used to send txes to trusted contracts i.e. OCR. func NewTxm(chainID string, tc func() (client.ReaderWriter, error), cfg config.Config, ks SimpleKeystore, lggr logger.Logger) *Txm { return &Txm{ - lggr: lggr, + lggr: logger.Named(lggr, "Txm"), chSend: make(chan pendingTx, MaxQueueLen), // queue can support 1000 pending txs chSim: make(chan pendingTx, MaxQueueLen), // queue can support 1000 pending txs chStop: make(chan struct{}), @@ -89,7 +89,7 @@ func NewTxm(chainID string, tc func() (client.ReaderWriter, error), cfg config.C // Start subscribes to queuing channel and processes them. func (txm *Txm) Start(ctx context.Context) error { - return txm.starter.StartOnce("solana_txm", func() error { + return txm.StartOnce("Txm", func() error { // determine estimator type var estimator fees.Estimator var err error @@ -574,23 +574,13 @@ func (txm *Txm) InflightTxs() int { // Close close service func (txm *Txm) Close() error { - return txm.starter.StopOnce("solanatxm", func() error { + return txm.StopOnce("Txm", func() error { close(txm.chStop) txm.done.Wait() return txm.fee.Close() }) } -func (txm *Txm) Name() string { return "solanatxm" } - -// Healthy service is healthy -func (txm *Txm) Healthy() error { - return nil -} - -// Ready service is ready -func (txm *Txm) Ready() error { - return txm.starter.Ready() -} +func (txm *Txm) Name() string { return txm.lggr.Name() } func (txm *Txm) HealthReport() map[string]error { return map[string]error{txm.Name(): txm.Healthy()} }