diff --git a/go.mod b/go.mod index a48f7aa2..01b09580 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,23 @@ module github.com/smartcontractkit/chainlink-automation -go 1.21 +go 1.22 require ( github.com/Maldris/mathparse v0.0.0-20170508133428-f0d009a7a773 github.com/ethereum/go-ethereum v1.13.8 github.com/go-echarts/go-echarts/v2 v2.2.6 github.com/goccy/go-json v0.10.2 - github.com/google/uuid v1.3.1 + github.com/google/uuid v1.6.0 github.com/jedib0t/go-pretty/v6 v6.4.7 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.17.0 - github.com/shopspring/decimal v1.3.1 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240401172519-4bfc659b80bf - github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052 + github.com/shopspring/decimal v1.4.0 + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240830114552-135e7e8f7f4b + github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - golang.org/x/crypto v0.18.0 - gonum.org/v1/gonum v0.13.0 + golang.org/x/crypto v0.26.0 + gonum.org/v1/gonum v0.15.0 ) require ( @@ -25,8 +25,8 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect @@ -36,7 +36,7 @@ require ( github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect @@ -55,13 +55,13 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/tools v0.15.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/tools v0.24.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 821c7a22..199f79b2 100644 --- a/go.sum +++ b/go.sum @@ -12,12 +12,12 @@ github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsy github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= 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/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +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/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cinar/indicator v1.2.24/go.mod h1:5eX8f1PG9g3RKSoHsoQxKd8bIN97Cf/gbgxXjihROpI= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= @@ -70,19 +70,17 @@ github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14j github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= @@ -139,12 +137,12 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -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/smartcontractkit/chainlink-common v0.1.7-0.20240401172519-4bfc659b80bf h1:yW8rTFycozLVnXRyOgZWGktnmzoFLxSWh1xPJXsp7vg= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240401172519-4bfc659b80bf/go.mod h1:kstYjAGqBswdZpl7YkSPeXBDVwaY1VaR6tUMPWl8ykA= -github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052 h1:1WFjrrVrWoQ9UpVMh7Mx4jDpzhmo1h8hFUKd9awIhIU= -github.com/smartcontractkit/libocr v0.0.0-20240326191951-2bbe9382d052/go.mod h1:SJEZCHgMCAzzBvo9vMV2DQ9onfEcIJCYSViyP4JI6c4= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240830114552-135e7e8f7f4b h1:/K1m9fJcQT26lsqcJhbGV3sapIZJANSpe0M/WxFye5U= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240830114552-135e7e8f7f4b/go.mod h1:lVnsXS0IJPeD5AiXOO95oTgCYZjhRGw3zLMYfJt2Ezc= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac h1:jo3kFDcpF4/hfBLNMhLL7bvjdnJkEaUhbxXIFiC9lVs= +github.com/smartcontractkit/libocr v0.0.0-20240830084433-f4f9f401c0ac/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= @@ -170,39 +168,36 @@ github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2n github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.13.0 h1:a0T3bh+7fhRyqeNbiC3qVHYmkiQgit3wnNan/2c0HMM= -gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/v2/delegate_test.go b/pkg/v2/delegate_test.go index da5ea65b..46138e11 100644 --- a/pkg/v2/delegate_test.go +++ b/pkg/v2/delegate_test.go @@ -23,7 +23,7 @@ func TestStart(t *testing.T) { Logger: logger, }) - assert.Equal(t, err.Error(), "bad local config while creating new oracle: blockchain timeout must be between 1s and 20s, but is currently 0s; contract config tracker poll interval must be between 15s and 2m0s, but is currently 0s; contract transmitter transmit timeout must be between 1s and 1m0s, but is currently 0s; database timeout must be between 100ms and 10s, but is currently 0s; contract config block-depth confirmation threshold must be between 1 and 100, but is currently 0: failed to create new OCR oracle") + assert.Equal(t, "bad local config while creating new oracle: blockchain timeout must be between 1s and 20s, but is currently 0s; contract config tracker poll interval must be between 1s and 2m0s, but is currently 0s; contract config load timeout must be between 1s and 1h0m0s, but is currently 0s; contract transmitter transmit timeout must be between 1s and 1m0s, but is currently 0s; database timeout must be between 100ms and 10s, but is currently 0s; DefaultMaxDurationInitialization must be between 1s and 1h0m0s, but is currently 0s; contract config block-depth confirmation threshold must be between 1 and 100, but is currently 0: failed to create new OCR oracle", err.Error()) }) t.Run("creates the delegate with the provided config", func(t *testing.T) { @@ -33,7 +33,9 @@ func TestStart(t *testing.T) { _, err := NewDelegate(DelegateConfig{ Logger: logger, LocalConfig: types.LocalConfig{ + DefaultMaxDurationInitialization: 30 * time.Second, BlockchainTimeout: 1 * time.Second, + ContractConfigLoadTimeout: 1 * time.Second, ContractConfigTrackerPollInterval: 15 * time.Second, ContractTransmitterTransmitTimeout: 1 * time.Second, DatabaseTimeout: 100 * time.Millisecond, @@ -90,7 +92,9 @@ func TestClose(t *testing.T) { d, err := NewDelegate(DelegateConfig{ Logger: mockLogger, LocalConfig: types.LocalConfig{ + DefaultMaxDurationInitialization: 30 * time.Second, BlockchainTimeout: 1 * time.Second, + ContractConfigLoadTimeout: 1 * time.Second, ContractConfigTrackerPollInterval: 15 * time.Second, ContractTransmitterTransmitTimeout: 1 * time.Second, DatabaseTimeout: 100 * time.Millisecond, diff --git a/pkg/v2/factory.go b/pkg/v2/factory.go index 79cf8c23..b6221ba7 100644 --- a/pkg/v2/factory.go +++ b/pkg/v2/factory.go @@ -1,6 +1,7 @@ package ocr2keepers import ( + "context" "fmt" "log" @@ -58,7 +59,7 @@ type pluginFactory struct { logger *log.Logger } -func (f *pluginFactory) NewReportingPlugin(c types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { +func (f *pluginFactory) NewReportingPlugin(ctx context.Context, c types.ReportingPluginConfig) (types.ReportingPlugin, types.ReportingPluginInfo, error) { f.logger.Printf("creating new reporting plugin instance") offChainCfg, err := config.DecodeOffchainConfig(c.OffchainConfig) diff --git a/pkg/v3/plugin/factory.go b/pkg/v3/plugin/factory.go index 9d23280f..8a86873c 100644 --- a/pkg/v3/plugin/factory.go +++ b/pkg/v3/plugin/factory.go @@ -1,18 +1,20 @@ package plugin import ( + "context" "fmt" "log" "math" "math/cmplx" "strconv" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocr2keepers "github.com/smartcontractkit/chainlink-automation/pkg/v3" "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" "github.com/smartcontractkit/chainlink-automation/pkg/v3/runner" "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ) type pluginFactory struct { @@ -63,7 +65,7 @@ func NewReportingPluginFactory( } } -func (factory *pluginFactory) NewReportingPlugin(c ocr3types.ReportingPluginConfig) (ocr3types.ReportingPlugin[AutomationReportInfo], ocr3types.ReportingPluginInfo, error) { +func (factory *pluginFactory) NewReportingPlugin(ctx context.Context, c ocr3types.ReportingPluginConfig) (ocr3types.ReportingPlugin[AutomationReportInfo], ocr3types.ReportingPluginInfo, error) { info := ocr3types.ReportingPluginInfo{ Name: fmt.Sprintf("Oracle: %d: Automation Plugin Instance w/ Digest '%s'", c.OracleID, c.ConfigDigest), Limits: ocr3types.ReportingPluginLimits{ @@ -113,6 +115,7 @@ func (factory *pluginFactory) NewReportingPlugin(c ocr3types.ReportingPluginConf factory.runnable, factory.runnerConf, conf, + c.N, c.F, factory.logger, ) diff --git a/pkg/v3/plugin/ocr3.go b/pkg/v3/plugin/ocr3.go index e7324cb5..b44ed10d 100644 --- a/pkg/v3/plugin/ocr3.go +++ b/pkg/v3/plugin/ocr3.go @@ -6,9 +6,11 @@ import ( "fmt" "log" - ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocr2plustypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/libocr/quorumhelper" + + ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" ocr2keepersv3 "github.com/smartcontractkit/chainlink-automation/pkg/v3" "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" @@ -36,6 +38,7 @@ type ocr3Plugin struct { AddLogProposalsHook hooks.AddLogProposalsHook Services []service.Recoverable Config config.OffchainConfig + N int F int Logger *log.Logger } @@ -90,17 +93,17 @@ func (plugin *ocr3Plugin) Observation(ctx context.Context, outctx ocr3types.Outc return observation.Encode() } -func (plugin *ocr3Plugin) ObservationQuorum(outctx ocr3types.OutcomeContext, query ocr2plustypes.Query) (ocr3types.Quorum, error) { - return ocr3types.QuorumTwoFPlusOne, nil +func (plugin *ocr3Plugin) ObservationQuorum(ctx context.Context, outctx ocr3types.OutcomeContext, query ocr2plustypes.Query, aos []ocr2plustypes.AttributedObservation) (bool, error) { + return quorumhelper.ObservationCountReachesObservationQuorum(quorumhelper.QuorumTwoFPlusOne, plugin.N, plugin.F, aos), nil } -func (plugin *ocr3Plugin) ValidateObservation(outctx ocr3types.OutcomeContext, query ocr2plustypes.Query, ao ocr2plustypes.AttributedObservation) error { +func (plugin *ocr3Plugin) ValidateObservation(ctx context.Context, outctx ocr3types.OutcomeContext, query ocr2plustypes.Query, ao ocr2plustypes.AttributedObservation) error { plugin.Logger.Printf("inside ValidateObservation for seqNr %d", outctx.SeqNr) _, err := ocr2keepersv3.DecodeAutomationObservation(ao.Observation, plugin.UpkeepTypeGetter, plugin.WorkIDGenerator) return err } -func (plugin *ocr3Plugin) Outcome(outctx ocr3types.OutcomeContext, query ocr2plustypes.Query, attributedObservations []ocr2plustypes.AttributedObservation) (ocr3types.Outcome, error) { +func (plugin *ocr3Plugin) Outcome(ctx context.Context, outctx ocr3types.OutcomeContext, query ocr2plustypes.Query, attributedObservations []ocr2plustypes.AttributedObservation) (ocr3types.Outcome, error) { plugin.Logger.Printf("inside Outcome for seqNr %d", outctx.SeqNr) p := newPerformables(plugin.F+1, ocr2keepersv3.OutcomeAgreedPerformablesLimit, getRandomKeySource(plugin.ConfigDigest, outctx.SeqNr), plugin.Logger) c := newCoordinatedBlockProposals(plugin.F+1, ocr2keepersv3.OutcomeSurfacedProposalsRoundHistoryLimit, ocr2keepersv3.OutcomeSurfacedProposalsLimit, getRandomKeySource(plugin.ConfigDigest, outctx.SeqNr), plugin.Logger) @@ -148,10 +151,10 @@ func (plugin *ocr3Plugin) Outcome(outctx ocr3types.OutcomeContext, query ocr2plu return outcome.Encode() } -func (plugin *ocr3Plugin) Reports(seqNr uint64, raw ocr3types.Outcome) ([]ocr3types.ReportWithInfo[AutomationReportInfo], error) { +func (plugin *ocr3Plugin) Reports(ctx context.Context, seqNr uint64, raw ocr3types.Outcome) ([]ocr3types.ReportPlus[AutomationReportInfo], error) { plugin.Logger.Printf("inside Reports for seqNr %d", seqNr) var ( - reports []ocr3types.ReportWithInfo[AutomationReportInfo] + reports []ocr3types.ReportPlus[AutomationReportInfo] outcome ocr2keepersv3.AutomationOutcome err error ) @@ -180,7 +183,7 @@ func (plugin *ocr3Plugin) Reports(seqNr uint64, raw ocr3types.Outcome) ([]ocr3ty return reports, fmt.Errorf("error encountered while encoding: %w", err) } // append to reports and reset collection - reports = append(reports, report) + reports = append(reports, ocr3types.ReportPlus[AutomationReportInfo]{ReportWithInfo: report}) performablesAdded += len(toPerform) toPerform = []ocr2keepers.CheckResult{} gasUsed = 0 @@ -201,7 +204,7 @@ func (plugin *ocr3Plugin) Reports(seqNr uint64, raw ocr3types.Outcome) ([]ocr3ty prommetrics.AutomationPluginPerformables.WithLabelValues(prommetrics.PluginStepReports).Set(0) return reports, fmt.Errorf("error encountered while encoding: %w", err) } - reports = append(reports, report) + reports = append(reports, ocr3types.ReportPlus[AutomationReportInfo]{ReportWithInfo: report}) performablesAdded += len(toPerform) } diff --git a/pkg/v3/plugin/ocr3_test.go b/pkg/v3/plugin/ocr3_test.go index d7641072..688280de 100644 --- a/pkg/v3/plugin/ocr3_test.go +++ b/pkg/v3/plugin/ocr3_test.go @@ -13,14 +13,15 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/goccy/go-json" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocr2plustypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/stretchr/testify/assert" + ocr2keepers2 "github.com/smartcontractkit/chainlink-automation/pkg/v3" "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin/hooks" "github.com/smartcontractkit/chainlink-automation/pkg/v3/service" "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" - ocr2plustypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/stretchr/testify/assert" ) func TestOcr3Plugin_Query(t *testing.T) { @@ -991,7 +992,7 @@ func TestOcr3Plugin_ValidateObservation(t *testing.T) { UpkeepTypeGetter: mockUpkeepTypeGetter, WorkIDGenerator: tc.wg, } - err := plugin.ValidateObservation(ocr3types.OutcomeContext{}, nil, tc.observation) + err := plugin.ValidateObservation(context.Background(), ocr3types.OutcomeContext{}, nil, tc.observation) if tc.expectsErr { assert.Error(t, err) assert.Equal(t, err.Error(), tc.wantErr.Error()) @@ -1094,7 +1095,7 @@ func TestOcr3Plugin_Outcome(t *testing.T) { WorkIDGenerator: tc.wg, Logger: logger, } - outcome, err := plugin.Outcome(ocr3types.OutcomeContext{ + outcome, err := plugin.Outcome(context.Background(), ocr3types.OutcomeContext{ PreviousOutcome: tc.prevOutcome, }, nil, tc.observations) if tc.expectsErr { @@ -1115,7 +1116,7 @@ func TestOcr3Plugin_Reports(t *testing.T) { name string sequenceNumber uint64 outcome ocr3types.Outcome - wantReportsWithInfo []ocr3types.ReportWithInfo[AutomationReportInfo] + wantReportsWithInfo []ocr3types.ReportPlus[AutomationReportInfo] encoder ocr2keepers.Encoder utg types.UpkeepTypeGetter wg types.WorkIDGenerator @@ -1133,7 +1134,7 @@ func TestOcr3Plugin_Reports(t *testing.T) { name: "an empty json object generates a nil report", sequenceNumber: 5, outcome: ocr3types.Outcome([]byte(`{}`)), - wantReportsWithInfo: []ocr3types.ReportWithInfo[AutomationReportInfo](nil), + wantReportsWithInfo: []ocr3types.ReportPlus[AutomationReportInfo](nil), }, { name: "a well formed but invalid outcome returns an error", @@ -1198,13 +1199,13 @@ func TestOcr3Plugin_Reports(t *testing.T) { wg: func(identifier ocr2keepers.UpkeepIdentifier, trigger ocr2keepers.Trigger) string { return "workID1" }, - wantReportsWithInfo: []ocr3types.ReportWithInfo[AutomationReportInfo]{ - { + wantReportsWithInfo: []ocr3types.ReportPlus[AutomationReportInfo]{ + {ReportWithInfo: ocr3types.ReportWithInfo[AutomationReportInfo]{ Report: []byte(`[]`), - }, - { + }}, + {ReportWithInfo: ocr3types.ReportWithInfo[AutomationReportInfo]{ Report: []byte(`[{"PipelineExecutionState":0,"Retryable":false,"Eligible":true,"IneligibilityReason":0,"UpkeepID":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Trigger":{"BlockNumber":0,"BlockHash":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"LogTriggerExtension":null},"WorkID":"workID1","GasAllocated":1,"PerformData":null,"FastGasWei":1,"LinkNative":2}]`), - }, + }}, }, }, { @@ -1275,7 +1276,7 @@ func TestOcr3Plugin_Reports(t *testing.T) { UpkeepTypeGetter: tc.utg, WorkIDGenerator: tc.wg, } - reportsWithInfo, err := plugin.Reports(tc.sequenceNumber, tc.outcome) + reportsWithInfo, err := plugin.Reports(context.Background(), tc.sequenceNumber, tc.outcome) if tc.expectsErr { assert.Error(t, err) assert.Equal(t, err.Error(), tc.wantErr.Error()) diff --git a/pkg/v3/plugin/plugin.go b/pkg/v3/plugin/plugin.go index 6ebb74a1..f08cb8fd 100644 --- a/pkg/v3/plugin/plugin.go +++ b/pkg/v3/plugin/plugin.go @@ -4,6 +4,9 @@ import ( "fmt" "log" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + ocr2plustypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/config" "github.com/smartcontractkit/chainlink-automation/pkg/v3/coordinator" "github.com/smartcontractkit/chainlink-automation/pkg/v3/flows" @@ -14,8 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-automation/pkg/v3/telemetry" "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" - "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" - ocr2plustypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) func newPlugin( @@ -34,6 +35,7 @@ func newPlugin( runnable types.Runnable, rConf runner.RunnerConfig, conf config.OffchainConfig, + n int, f int, logger *log.Logger, ) (ocr3types.ReportingPlugin[AutomationReportInfo], error) { @@ -127,6 +129,7 @@ func newPlugin( AddLogProposalsHook: hooks.NewAddLogProposalsHook(metadataStore, coord, logger), Services: recoverSvcs, Config: conf, + N: n, F: f, Logger: log.New(logger.Writer(), fmt.Sprintf("[%s | plugin]", telemetry.ServiceName), telemetry.LogPkgStdFlags), } diff --git a/tools/simulator/node/add.go b/tools/simulator/node/add.go index f8e02ed5..1789dc69 100644 --- a/tools/simulator/node/add.go +++ b/tools/simulator/node/add.go @@ -72,7 +72,9 @@ func (g *Group) Add(conf config.Node) { BinaryNetworkEndpointFactory: simNet, V2Bootstrappers: []commontypes.BootstrapperLocator{}, LocalConfig: types.LocalConfig{ + DefaultMaxDurationInitialization: 30 * time.Second, BlockchainTimeout: time.Second, + ContractConfigLoadTimeout: time.Second, ContractConfigConfirmations: 1, SkipContractConfigConfirmations: false, ContractConfigTrackerPollInterval: 15 * time.Second, diff --git a/tools/simulator/simulate/loader/ocr3config.go b/tools/simulator/simulate/loader/ocr3config.go index 54dcbae2..5ee2e9d3 100644 --- a/tools/simulator/simulate/loader/ocr3config.go +++ b/tools/simulator/simulate/loader/ocr3config.go @@ -1,6 +1,7 @@ package loader import ( + "context" "log" "sync" @@ -27,7 +28,7 @@ type OffchainKeySourcer interface { } type Digester interface { - ConfigDigest(config types.ContractConfig) (types.ConfigDigest, error) + ConfigDigest(ctx context.Context, config types.ContractConfig) (types.ConfigDigest, error) } type ProgressTelemetry interface { @@ -79,7 +80,7 @@ func (l *OCR3ConfigLoader) Load(block *chain.Block) { // check if new block indicates a new config event should be loaded if evt, ok := l.events[block.Number.String()]; ok { - conf, err := buildConfig(evt, l.oracles, l.digest, l.count+1) + conf, err := buildConfig(context.Background(), evt, l.oracles, l.digest, l.count+1) if err != nil { l.logger.Printf("error building config: %s", err) @@ -117,7 +118,7 @@ func (l *OCR3ConfigLoader) AddSigner(id string, onKey KeySourcer, offKey Offchai l.oracles = append(l.oracles, newOracle) } -func buildConfig(conf config.OCR3ConfigEvent, oracles []ocr2config.OracleIdentityExtra, digester Digester, count uint64) (types.ContractConfig, error) { +func buildConfig(ctx context.Context, conf config.OCR3ConfigEvent, oracles []ocr2config.OracleIdentityExtra, digester Digester, count uint64) (types.ContractConfig, error) { // S is a slice of values that indicate the number of oracles involved // in attempting to transmit. For the simulator, all nodes will be involved // in transmit attempts. @@ -127,17 +128,18 @@ func buildConfig(conf config.OCR3ConfigEvent, oracles []ocr2config.OracleIdentit } signerOnchainPublicKeys, transmitterAccounts, f, onchainConfig, offchainConfigVersion, offchainConfig, err := ocr3confighelper.ContractSetConfigArgsForTests( - conf.DeltaProgress.Value(), // deltaProgress time.Duratioonfn, - conf.DeltaResend.Value(), // deltaResend time.Duration, - conf.DeltaInitial.Value(), // deltaInitial time.Duration - conf.DeltaRound.Value(), // deltaRound time.Duration, - conf.DeltaGrace.Value(), // deltaGrace time.Duration, - conf.DeltaRequest.Value(), // deltaCertifiedCommitRequest time.Duration - conf.DeltaStage.Value(), // deltaStage time.Duration - conf.Rmax, // rMax uint64 - S, // s []int, - oracles, // oracles []OracleIdentityExtra, - []byte(conf.Offchain), // reportingPluginConfig []byte, + conf.DeltaProgress.Value(), // deltaProgress time.Duratioonfn, + conf.DeltaResend.Value(), // deltaResend time.Duration, + conf.DeltaInitial.Value(), // deltaInitial time.Duration + conf.DeltaRound.Value(), // deltaRound time.Duration, + conf.DeltaGrace.Value(), // deltaGrace time.Duration, + conf.DeltaRequest.Value(), // deltaCertifiedCommitRequest time.Duration + conf.DeltaStage.Value(), // deltaStage time.Duration + conf.Rmax, // rMax uint64 + S, // s []int, + oracles, // oracles []OracleIdentityExtra, + []byte(conf.Offchain), // reportingPluginConfig []byte, + nil, conf.MaxQuery.Value(), // maxDurationQuery time.Duration, conf.MaxObservation.Value(), // maxDurationObservation time.Duration, conf.MaxAccept.Value(), // maxDurationShouldAcceptAttestedReport time.Duration @@ -159,7 +161,7 @@ func buildConfig(conf config.OCR3ConfigEvent, oracles []ocr2config.OracleIdentit OffchainConfig: offchainConfig, } - digest, _ := digester.ConfigDigest(contractConf) + digest, _ := digester.ConfigDigest(ctx, contractConf) contractConf.ConfigDigest = digest return contractConf, nil diff --git a/tools/simulator/simulate/loader/ocr3config_test.go b/tools/simulator/simulate/loader/ocr3config_test.go index fec4714b..091c5f3b 100644 --- a/tools/simulator/simulate/loader/ocr3config_test.go +++ b/tools/simulator/simulate/loader/ocr3config_test.go @@ -1,6 +1,7 @@ package loader_test import ( + "context" "crypto/rand" "crypto/sha256" "fmt" @@ -59,7 +60,7 @@ type mockDigester struct { mock.Mock } -func (_m *mockDigester) ConfigDigest(config types.ContractConfig) (types.ConfigDigest, error) { +func (_m *mockDigester) ConfigDigest(ctx context.Context, config types.ContractConfig) (types.ConfigDigest, error) { req := _m.Called(config) hash := sha256.Sum256([]byte(fmt.Sprintf("%+v", config))) diff --git a/tools/simulator/simulate/ocr/transmit.go b/tools/simulator/simulate/ocr/transmit.go index c6c78536..a0648c49 100644 --- a/tools/simulator/simulate/ocr/transmit.go +++ b/tools/simulator/simulate/ocr/transmit.go @@ -41,7 +41,7 @@ func (tr *OCR3Transmitter) Transmit( } // Account from which the transmitter invokes the contract -func (tr *OCR3Transmitter) FromAccount() (types.Account, error) { +func (tr *OCR3Transmitter) FromAccount(ctx context.Context) (types.Account, error) { tr.mu.RLock() defer tr.mu.RUnlock()