From 2266e55404120a54a13b390cdbd54985e1b767e3 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Mon, 22 Jan 2024 14:21:57 -0500 Subject: [PATCH 01/14] adjust for nil case --- go.mod | 18 +- go.sum | 37 ++- median/aggregated_attribute_observation.go | 7 + median/plugin.go | 2 +- median/report_codec_test.go | 281 +++++++++++---------- 5 files changed, 182 insertions(+), 163 deletions(-) diff --git a/go.mod b/go.mod index 38498dc..93fb066 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,12 @@ module github.com/smartcontractkit/chainlink-feeds go 1.21.3 +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d + require ( github.com/hashicorp/go-plugin v1.5.2 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240119014733-5ea50bbe81be - github.com/smartcontractkit/libocr v0.0.0-20231020123319-d255366a6545 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3 + github.com/smartcontractkit/libocr v0.0.0-20240112202000-6359502d2ff1 github.com/stretchr/testify v1.8.4 ) @@ -29,7 +31,7 @@ require ( github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mr-tron/base58 v1.2.0 // indirect @@ -53,11 +55,11 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/grpc v1.58.3 // indirect diff --git a/go.sum b/go.sum index bed5d10..e92bbe2 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d h1:L/EuiT9j88wX94xyqJN1/L6FSPZpKVDdj1aYHu7Fs5c= +github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= @@ -171,8 +173,9 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -202,16 +205,12 @@ github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240118144452-7fcb73fb88c8 h1:6pL+DzkEGLT4NTd1SoGk1vL0/cbkDuvBsV0DRUb4lrc= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240118144452-7fcb73fb88c8/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240119014733-5ea50bbe81be h1:ahwXHg5kImjhq85kWRxylXJBqClZpdrBvip9ApQJTP8= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240119014733-5ea50bbe81be/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3 h1:89S8aSuyg5UWScLPu+LvgA4aJEEyBnhHZXnKwt+m7wI= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3/go.mod h1:tvo6tjHKlL3rUor2VyPLqSXqPVe7MHyEIk5f49JvwRo= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20231020123319-d255366a6545 h1:qOsw2ETQD/Sb/W2xuYn2KPWjvvsWA0C+l19rWFq8iNg= -github.com/smartcontractkit/libocr v0.0.0-20231020123319-d255366a6545/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0= 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= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -261,8 +260,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -273,8 +272,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-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= -golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +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/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= @@ -326,8 +325,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -346,8 +345,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -386,8 +385,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -396,8 +395,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +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/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/median/aggregated_attribute_observation.go b/median/aggregated_attribute_observation.go index 681d541..18e2c0a 100644 --- a/median/aggregated_attribute_observation.go +++ b/median/aggregated_attribute_observation.go @@ -14,6 +14,7 @@ type aggregatedAttributedObservation struct { Observers [32]commontypes.OracleID Observations []*big.Int JuelsPerFeeCoin *big.Int + GasPriceSubunit *big.Int } func aggregate(observations []median.ParsedAttributedObservation) *aggregatedAttributedObservation { @@ -33,6 +34,12 @@ func aggregate(observations []median.ParsedAttributedObservation) *aggregatedAtt }) aggregated.JuelsPerFeeCoin = observations[n/2].JuelsPerFeeCoin + // compatible with nil case + slices.SortFunc(observations, func(a, b median.ParsedAttributedObservation) int { + return a.GasPrice.Cmp(b.GasPrice) + }) + aggregated.GasPriceSubunit = observations[n/2].GasPrice + slices.SortFunc(observations, func(a, b median.ParsedAttributedObservation) int { return a.Value.Cmp(b.Value) }) diff --git a/median/plugin.go b/median/plugin.go index 1780c60..97c17ac 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -26,7 +26,7 @@ func NewPlugin(lggr logger.Logger) *Plugin { return &Plugin{Plugin: loop.Plugin{Logger: lggr}, stop: make(services.StopChan)} } -func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) { +func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin, gasPrice median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) { var ctxVals loop.ContextValues ctxVals.SetValues(ctx) lggr := logger.With(p.Logger, ctxVals.Args()...) diff --git a/median/report_codec_test.go b/median/report_codec_test.go index ab7deaf..e8dfc6c 100644 --- a/median/report_codec_test.go +++ b/median/report_codec_test.go @@ -14,142 +14,153 @@ import ( ) func TestReportCodec(t *testing.T) { - anyReports := []median.ParsedAttributedObservation{ - { - Timestamp: 123, - Value: big.NewInt(300), - JuelsPerFeeCoin: big.NewInt(100), - Observer: 0, - }, - { - Timestamp: 125, - Value: big.NewInt(200), - JuelsPerFeeCoin: big.NewInt(110), - Observer: 1, - }, - { - Timestamp: 124, - Value: big.NewInt(250), - JuelsPerFeeCoin: big.NewInt(90), - Observer: 2, - }, + for _, tt := range []struct { + name string + gasPrice *big.Int + }{ + {"nil gas", nil}, + {"non-nil gas", big.NewInt(123)}, + } { + tt := tt + t.Run(tt.name, func(t *testing.T) { + anyReports := []median.ParsedAttributedObservation{ + { + Timestamp: 123, + Value: big.NewInt(300), + JuelsPerFeeCoin: big.NewInt(100), + Observer: 0, + }, + { + Timestamp: 125, + Value: big.NewInt(200), + JuelsPerFeeCoin: big.NewInt(110), + Observer: 1, + }, + { + Timestamp: 124, + Value: big.NewInt(250), + JuelsPerFeeCoin: big.NewInt(90), + Observer: 2, + }, + } + + aggReports := aggregatedAttributedObservation{ + Timestamp: 124, + Observers: [32]commontypes.OracleID{1, 2, 0}, + Observations: []*big.Int{ + big.NewInt(200), + big.NewInt(250), + big.NewInt(300), + }, + JuelsPerFeeCoin: big.NewInt(100), + } + + anyEncodedReport := []byte{5, 6, 7, 8} + + anyError := errors.New("nope not today") + + t.Run("BuildReport builds the type and delegates to generic codec", func(t *testing.T) { + rc := reportCodec{ + codec: &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + }, + } + + encoded, err := rc.BuildReport(anyReports) + require.NoError(t, err) + assert.Equal(t, types.Report(anyEncodedReport), encoded) + }) + + t.Run("BuildReport returns error if there are no reports", func(t *testing.T) { + rc := reportCodec{ + codec: &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + }, + } + + _, err := rc.BuildReport(nil) + assert.Error(t, err) + + _, err = rc.BuildReport([]median.ParsedAttributedObservation{}) + assert.Error(t, err) + }) + + t.Run("BuildReport returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + err: anyError, + }, + } + + _, err := rc.BuildReport(anyReports) + assert.Equal(t, anyError, err) + }) + + t.Run("MedianFromReport delegates to codec and gets the median", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyEncodedReport, + result: aggReports, + }, + } + + medianVal, err := rc.MedianFromReport(anyEncodedReport) + require.NoError(t, err) + assert.Equal(t, big.NewInt(250), medianVal) + }) + + t.Run("MedianFromReport returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyEncodedReport, + result: aggReports, + err: anyError, + }, + } + + _, err := rc.MedianFromReport(anyEncodedReport) + assert.Equal(t, anyError, err) + }) + + anyN := 10 + anyLen := 200 + t.Run("MaxReportLength delegates to codec", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyN, + result: anyLen, + }, + } + + length, err := rc.MaxReportLength(anyN) + require.NoError(t, err) + assert.Equal(t, anyLen, length) + }) + + t.Run("MaxReportLength returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{&testCodec{ + t: t, + expected: 10, + result: anyLen, + err: anyError, + }, + } + + _, err := rc.MaxReportLength(10) + assert.Equal(t, anyError, err) + }) + }) } - - aggReports := aggregatedAttributedObservation{ - Timestamp: 124, - Observers: [32]commontypes.OracleID{1, 2, 0}, - Observations: []*big.Int{ - big.NewInt(200), - big.NewInt(250), - big.NewInt(300), - }, - JuelsPerFeeCoin: big.NewInt(100), - } - - anyEncodedReport := []byte{5, 6, 7, 8} - - anyError := errors.New("nope not today") - - t.Run("BuildReport builds the type and delegates to generic codec", func(t *testing.T) { - rc := reportCodec{ - codec: &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - }, - } - - encoded, err := rc.BuildReport(anyReports) - require.NoError(t, err) - assert.Equal(t, types.Report(anyEncodedReport), encoded) - }) - - t.Run("BuildReport returns error if there are no reports", func(t *testing.T) { - rc := reportCodec{ - codec: &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - }, - } - - _, err := rc.BuildReport(nil) - assert.Error(t, err) - - _, err = rc.BuildReport([]median.ParsedAttributedObservation{}) - assert.Error(t, err) - }) - - t.Run("BuildReport returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - err: anyError, - }, - } - - _, err := rc.BuildReport(anyReports) - assert.Equal(t, anyError, err) - }) - - t.Run("MedianFromReport delegates to codec and gets the median", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyEncodedReport, - result: aggReports, - }, - } - - medianVal, err := rc.MedianFromReport(anyEncodedReport) - require.NoError(t, err) - assert.Equal(t, big.NewInt(250), medianVal) - }) - - t.Run("MedianFromReport returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyEncodedReport, - result: aggReports, - err: anyError, - }, - } - - _, err := rc.MedianFromReport(anyEncodedReport) - assert.Equal(t, anyError, err) - }) - - anyN := 10 - anyLen := 200 - t.Run("MaxReportLength delegates to codec", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyN, - result: anyLen, - }, - } - - length, err := rc.MaxReportLength(anyN) - require.NoError(t, err) - assert.Equal(t, anyLen, length) - }) - - t.Run("MaxReportLength returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{&testCodec{ - t: t, - expected: 10, - result: anyLen, - err: anyError, - }, - } - - _, err := rc.MaxReportLength(10) - assert.Equal(t, anyError, err) - }) } type testCodec struct { From 1fd1df86de72971e5e8ef7cd4519e47f667fc26f Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 21 Feb 2024 15:06:48 -0500 Subject: [PATCH 02/14] add gas price to test cases --- median/aggregated_attribute_observation.go | 1 - median/report_codec_test.go | 285 ++++++++++----------- 2 files changed, 139 insertions(+), 147 deletions(-) diff --git a/median/aggregated_attribute_observation.go b/median/aggregated_attribute_observation.go index 18e2c0a..170f8e8 100644 --- a/median/aggregated_attribute_observation.go +++ b/median/aggregated_attribute_observation.go @@ -34,7 +34,6 @@ func aggregate(observations []median.ParsedAttributedObservation) *aggregatedAtt }) aggregated.JuelsPerFeeCoin = observations[n/2].JuelsPerFeeCoin - // compatible with nil case slices.SortFunc(observations, func(a, b median.ParsedAttributedObservation) int { return a.GasPrice.Cmp(b.GasPrice) }) diff --git a/median/report_codec_test.go b/median/report_codec_test.go index e8dfc6c..bd2cad8 100644 --- a/median/report_codec_test.go +++ b/median/report_codec_test.go @@ -14,153 +14,146 @@ import ( ) func TestReportCodec(t *testing.T) { - for _, tt := range []struct { - name string - gasPrice *big.Int - }{ - {"nil gas", nil}, - {"non-nil gas", big.NewInt(123)}, - } { - tt := tt - t.Run(tt.name, func(t *testing.T) { - anyReports := []median.ParsedAttributedObservation{ - { - Timestamp: 123, - Value: big.NewInt(300), - JuelsPerFeeCoin: big.NewInt(100), - Observer: 0, - }, - { - Timestamp: 125, - Value: big.NewInt(200), - JuelsPerFeeCoin: big.NewInt(110), - Observer: 1, - }, - { - Timestamp: 124, - Value: big.NewInt(250), - JuelsPerFeeCoin: big.NewInt(90), - Observer: 2, - }, - } - - aggReports := aggregatedAttributedObservation{ - Timestamp: 124, - Observers: [32]commontypes.OracleID{1, 2, 0}, - Observations: []*big.Int{ - big.NewInt(200), - big.NewInt(250), - big.NewInt(300), - }, - JuelsPerFeeCoin: big.NewInt(100), - } - - anyEncodedReport := []byte{5, 6, 7, 8} - - anyError := errors.New("nope not today") - - t.Run("BuildReport builds the type and delegates to generic codec", func(t *testing.T) { - rc := reportCodec{ - codec: &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - }, - } - - encoded, err := rc.BuildReport(anyReports) - require.NoError(t, err) - assert.Equal(t, types.Report(anyEncodedReport), encoded) - }) - - t.Run("BuildReport returns error if there are no reports", func(t *testing.T) { - rc := reportCodec{ - codec: &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - }, - } - - _, err := rc.BuildReport(nil) - assert.Error(t, err) - - _, err = rc.BuildReport([]median.ParsedAttributedObservation{}) - assert.Error(t, err) - }) - - t.Run("BuildReport returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: &aggReports, - result: anyEncodedReport, - err: anyError, - }, - } - - _, err := rc.BuildReport(anyReports) - assert.Equal(t, anyError, err) - }) - - t.Run("MedianFromReport delegates to codec and gets the median", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyEncodedReport, - result: aggReports, - }, - } - - medianVal, err := rc.MedianFromReport(anyEncodedReport) - require.NoError(t, err) - assert.Equal(t, big.NewInt(250), medianVal) - }) - - t.Run("MedianFromReport returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyEncodedReport, - result: aggReports, - err: anyError, - }, - } - - _, err := rc.MedianFromReport(anyEncodedReport) - assert.Equal(t, anyError, err) - }) - - anyN := 10 - anyLen := 200 - t.Run("MaxReportLength delegates to codec", func(t *testing.T) { - rc := reportCodec{ - &testCodec{ - t: t, - expected: anyN, - result: anyLen, - }, - } - - length, err := rc.MaxReportLength(anyN) - require.NoError(t, err) - assert.Equal(t, anyLen, length) - }) - - t.Run("MaxReportLength returns error if codec returns error", func(t *testing.T) { - rc := reportCodec{&testCodec{ - t: t, - expected: 10, - result: anyLen, - err: anyError, - }, - } - - _, err := rc.MaxReportLength(10) - assert.Equal(t, anyError, err) - }) - }) + anyReports := []median.ParsedAttributedObservation{ + { + Timestamp: 123, + Value: big.NewInt(300), + JuelsPerFeeCoin: big.NewInt(100), + GasPrice: big.NewInt(1), + Observer: 0, + }, + { + Timestamp: 125, + Value: big.NewInt(200), + JuelsPerFeeCoin: big.NewInt(110), + GasPrice: big.NewInt(2), + Observer: 1, + }, + { + Timestamp: 124, + Value: big.NewInt(250), + JuelsPerFeeCoin: big.NewInt(90), + GasPrice: big.NewInt(3), + Observer: 2, + }, } + + aggReports := aggregatedAttributedObservation{ + Timestamp: 124, + Observers: [32]commontypes.OracleID{1, 2, 0}, + Observations: []*big.Int{ + big.NewInt(200), + big.NewInt(250), + big.NewInt(300), + }, + JuelsPerFeeCoin: big.NewInt(100), + GasPriceSubunit: big.NewInt(2), + } + + anyEncodedReport := []byte{5, 6, 7, 8} + + anyError := errors.New("nope not today") + + t.Run("BuildReport builds the type and delegates to generic codec", func(t *testing.T) { + rc := reportCodec{ + codec: &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + }, + } + + encoded, err := rc.BuildReport(anyReports) + require.NoError(t, err) + assert.Equal(t, types.Report(anyEncodedReport), encoded) + }) + + t.Run("BuildReport returns error if there are no reports", func(t *testing.T) { + rc := reportCodec{ + codec: &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + }, + } + + _, err := rc.BuildReport(nil) + assert.Error(t, err) + + _, err = rc.BuildReport([]median.ParsedAttributedObservation{}) + assert.Error(t, err) + }) + + t.Run("BuildReport returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: &aggReports, + result: anyEncodedReport, + err: anyError, + }, + } + + _, err := rc.BuildReport(anyReports) + assert.Equal(t, anyError, err) + }) + + t.Run("MedianFromReport delegates to codec and gets the median", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyEncodedReport, + result: aggReports, + }, + } + + medianVal, err := rc.MedianFromReport(anyEncodedReport) + require.NoError(t, err) + assert.Equal(t, big.NewInt(250), medianVal) + }) + + t.Run("MedianFromReport returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyEncodedReport, + result: aggReports, + err: anyError, + }, + } + + _, err := rc.MedianFromReport(anyEncodedReport) + assert.Equal(t, anyError, err) + }) + + anyN := 10 + anyLen := 200 + t.Run("MaxReportLength delegates to codec", func(t *testing.T) { + rc := reportCodec{ + &testCodec{ + t: t, + expected: anyN, + result: anyLen, + }, + } + + length, err := rc.MaxReportLength(anyN) + require.NoError(t, err) + assert.Equal(t, anyLen, length) + }) + + t.Run("MaxReportLength returns error if codec returns error", func(t *testing.T) { + rc := reportCodec{&testCodec{ + t: t, + expected: 10, + result: anyLen, + err: anyError, + }, + } + + _, err := rc.MaxReportLength(10) + assert.Equal(t, anyError, err) + }) } type testCodec struct { From d2ec49f05abb6c632dc05692bbaa9fa633d63e5a Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 10:42:33 -0500 Subject: [PATCH 03/14] update libocr and chainlink-common --- go.mod | 17 ++++++++++------- go.sum | 32 ++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 93fb066..cc92351 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,11 @@ module github.com/smartcontractkit/chainlink-feeds go 1.21.3 -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a require ( - github.com/hashicorp/go-plugin v1.5.2 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3 + github.com/hashicorp/go-plugin v1.6.0 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222153944-9346ac97af8f github.com/smartcontractkit/libocr v0.0.0-20240112202000-6359502d2ff1 github.com/stretchr/testify v1.8.4 ) @@ -28,12 +28,13 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect - github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect github.com/oklog/run v1.0.0 // indirect @@ -44,6 +45,7 @@ require ( github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.11.1 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect @@ -55,10 +57,11 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.18.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect diff --git a/go.sum b/go.sum index e92bbe2..bb5b699 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d h1:L/EuiT9j88wX94xyqJN1/L6FSPZpKVDdj1aYHu7Fs5c= -github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= +github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a h1:G+0vnO8YmDuHmys68k3vBn95XpdJM8H9pHNfyRP9hpo= +github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= @@ -150,8 +150,8 @@ github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= @@ -205,8 +205,10 @@ github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3 h1:89S8aSuyg5UWScLPu+LvgA4aJEEyBnhHZXnKwt+m7wI= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240122162044-7c8f64faebb3/go.mod h1:tvo6tjHKlL3rUor2VyPLqSXqPVe7MHyEIk5f49JvwRo= +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.20240222153944-9346ac97af8f h1:0EASufnXeL1seVvBzai86W2zzeEQsA9Zj0q6rdA5Pvs= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222153944-9346ac97af8f/go.mod h1:1Ek4TEwK5/y+xmT+6Ly3rjbqJ6hW/zzGh1LFu97qd9s= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= @@ -260,8 +262,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +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-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -295,6 +297,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -325,8 +329,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -345,8 +349,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -385,8 +389,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 12abd16ea777ebd58454a8cf01ff64670781592a Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 10:58:11 -0500 Subject: [PATCH 04/14] update libocr and chainlink-common --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index cc92351..5f3b2f1 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,11 @@ module github.com/smartcontractkit/chainlink-feeds go 1.21.3 -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 require ( github.com/hashicorp/go-plugin v1.6.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222153944-9346ac97af8f + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222155420-b6579c9a72fe github.com/smartcontractkit/libocr v0.0.0-20240112202000-6359502d2ff1 github.com/stretchr/testify v1.8.4 ) diff --git a/go.sum b/go.sum index bb5b699..e900561 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a h1:G+0vnO8YmDuHmys68k3vBn95XpdJM8H9pHNfyRP9hpo= -github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= +github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 h1:eXMkGNE9kfAYyAEBlzjL53ax4klanSS+v4zOhNfuE2M= +github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= @@ -207,8 +207,8 @@ 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/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.20240222153944-9346ac97af8f h1:0EASufnXeL1seVvBzai86W2zzeEQsA9Zj0q6rdA5Pvs= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222153944-9346ac97af8f/go.mod h1:1Ek4TEwK5/y+xmT+6Ly3rjbqJ6hW/zzGh1LFu97qd9s= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222155420-b6579c9a72fe h1:I3rlIsLJnXQikAJ6/TpQR8Z9YC7wrVNwT/oSmsulllE= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222155420-b6579c9a72fe/go.mod h1:/DPJQu8TqFVuydY2N/naL2Mf6319QS9U+AdnaRgOUDw= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= From 85f768e32429c944b2b8cf9caeeb743f0ba7cd14 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 11:11:39 -0500 Subject: [PATCH 05/14] update common again --- go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index e900561..dafae29 100644 --- a/go.sum +++ b/go.sum @@ -209,8 +209,8 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222155420-b6579c9a72fe h1:I3rlIsLJnXQikAJ6/TpQR8Z9YC7wrVNwT/oSmsulllE= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240222155420-b6579c9a72fe/go.mod h1:/DPJQu8TqFVuydY2N/naL2Mf6319QS9U+AdnaRgOUDw= -github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= -github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= +github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= +github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From 6420bd54840575fa86ab19083280dd1b38f97d35 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 15 May 2024 11:56:38 -0400 Subject: [PATCH 06/14] remove replace --- go.mod | 2 -- go.sum | 2 -- 2 files changed, 4 deletions(-) diff --git a/go.mod b/go.mod index ffead10..efb1308 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/smartcontractkit/chainlink-feeds go 1.21.3 -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 - require ( github.com/hashicorp/go-plugin v1.6.0 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240327133125-eed636b9a6df diff --git a/go.sum b/go.sum index 9b8508e..f7ac6eb 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 h1:eXMkGNE9kfAYyAEBlzjL53ax4klanSS+v4zOhNfuE2M= -github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= From 0dab6e3cc9b844e8d267468c8d229741a643b4aa Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 15 May 2024 12:07:20 -0400 Subject: [PATCH 07/14] update deps --- go.mod | 9 +++++- go.sum | 21 ++++++++++++-- median/aggregated_attribute_observation.go | 4 +-- median/report_codec_test.go | 32 +++++++++++----------- 4 files changed, 45 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index efb1308..3902f4e 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,16 @@ go 1.21.3 require ( github.com/hashicorp/go-plugin v1.6.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240327133125-eed636b9a6df + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240515160501-a375a7ccb29e github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/stretchr/testify v1.9.0 ) require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -21,13 +23,16 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.3.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect + github.com/invopop/jsonschema v0.12.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -43,7 +48,9 @@ require ( github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.11.1 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect diff --git a/go.sum b/go.sum index f7ac6eb..0e3fe11 100644 --- a/go.sum +++ b/go.sum @@ -38,10 +38,14 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -146,6 +150,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 h1:o95KDiV/b1xdkumY5 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3/go.mod h1:hTxjzRcX49ogbTGVJ1sM5mz5s+SSgiGIyL3jjPxl32E= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= +github.com/hashicorp/consul/sdk v0.16.0/go.mod h1:7pxqqhqoaPqnBnzXD1StKed62LqJeClzVsUEy85Zr0A= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -153,8 +159,11 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -167,6 +176,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -205,10 +216,12 @@ github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CMoggKnxNzxsVDMQ= +github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= 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.20240327133125-eed636b9a6df h1:AKjckaIV8R53dLJwoQ3VlUI56L34Ca+nkkzjR1784zY= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240327133125-eed636b9a6df/go.mod h1:u2XnvJHl7sQ9HMlRnVLsOKgV9ihk0RGIYywB12p9gQQ= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240515160501-a375a7ccb29e h1:Kzu8G6l4Ke7Jvq/qwLZpsOfNrAEJngLInsfVVQuCnfA= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240515160501-a375a7ccb29e/go.mod h1:WLCJQW1xRPL0kNQ2rl5DUnodrzxcbHzha3w46qaHIkg= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= @@ -218,6 +231,8 @@ github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c/go.mod h1: 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= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -227,6 +242,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/median/aggregated_attribute_observation.go b/median/aggregated_attribute_observation.go index 170f8e8..c487490 100644 --- a/median/aggregated_attribute_observation.go +++ b/median/aggregated_attribute_observation.go @@ -35,9 +35,9 @@ func aggregate(observations []median.ParsedAttributedObservation) *aggregatedAtt aggregated.JuelsPerFeeCoin = observations[n/2].JuelsPerFeeCoin slices.SortFunc(observations, func(a, b median.ParsedAttributedObservation) int { - return a.GasPrice.Cmp(b.GasPrice) + return a.GasPriceSubunits.Cmp(b.GasPriceSubunits) }) - aggregated.GasPriceSubunit = observations[n/2].GasPrice + aggregated.GasPriceSubunit = observations[n/2].GasPriceSubunits slices.SortFunc(observations, func(a, b median.ParsedAttributedObservation) int { return a.Value.Cmp(b.Value) diff --git a/median/report_codec_test.go b/median/report_codec_test.go index bd2cad8..ffe74d2 100644 --- a/median/report_codec_test.go +++ b/median/report_codec_test.go @@ -16,25 +16,25 @@ import ( func TestReportCodec(t *testing.T) { anyReports := []median.ParsedAttributedObservation{ { - Timestamp: 123, - Value: big.NewInt(300), - JuelsPerFeeCoin: big.NewInt(100), - GasPrice: big.NewInt(1), - Observer: 0, + Timestamp: 123, + Value: big.NewInt(300), + JuelsPerFeeCoin: big.NewInt(100), + GasPriceSubunits: big.NewInt(0), + Observer: 0, }, { - Timestamp: 125, - Value: big.NewInt(200), - JuelsPerFeeCoin: big.NewInt(110), - GasPrice: big.NewInt(2), - Observer: 1, + Timestamp: 125, + Value: big.NewInt(200), + JuelsPerFeeCoin: big.NewInt(110), + GasPriceSubunits: big.NewInt(1), + Observer: 1, }, { - Timestamp: 124, - Value: big.NewInt(250), - JuelsPerFeeCoin: big.NewInt(90), - GasPrice: big.NewInt(3), - Observer: 2, + Timestamp: 124, + Value: big.NewInt(250), + JuelsPerFeeCoin: big.NewInt(90), + GasPriceSubunits: big.NewInt(2), + Observer: 2, }, } @@ -47,7 +47,7 @@ func TestReportCodec(t *testing.T) { big.NewInt(300), }, JuelsPerFeeCoin: big.NewInt(100), - GasPriceSubunit: big.NewInt(2), + GasPriceSubunit: big.NewInt(1), } anyEncodedReport := []byte{5, 6, 7, 8} From 43edb6ca801d0a2471392f78cf0b4cb1231c4601 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 15 May 2024 12:14:43 -0400 Subject: [PATCH 08/14] update NewMedianFactory --- median/plugin.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/median/plugin.go b/median/plugin.go index 5227d0d..d0c5070 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -26,16 +26,30 @@ func NewPlugin(lggr logger.Logger) *Plugin { return &Plugin{Plugin: loop.Plugin{Logger: lggr}, stop: make(services.StopChan)} } -func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin, gasPrice median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) { +func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin, gasPriceSubunits median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) { var ctxVals loop.ContextValues ctxVals.SetValues(ctx) lggr := logger.With(p.Logger, ctxVals.Args()...) + // Setting includeGasPriceSubunitsInObservation properly ensures we do not break libocr codec + // by including gasPriceSubunits in the observation when not allowed + // Once all chainlink nodes in DONs have libocr version >= fd3cab206b2c + // this check and IncludeGasPriceSubunitsInObservation field can be removed + + _, ok := gasPriceSubunits.(*ZeroDataSource) + + var includeGasPriceSubunitsInObservation bool + if ok { + includeGasPriceSubunitsInObservation = false + } else { + includeGasPriceSubunitsInObservation = true + } + factory := median.NumericalMedianFactory{ DataSource: dataSource, JuelsPerFeeCoinDataSource: juelsPerFeeCoin, - GasPriceSubunitsDataSource: &ZeroDataSource{}, - IncludeGasPriceSubunitsInObservation: false, + GasPriceSubunitsDataSource: gasPriceSubunits, + IncludeGasPriceSubunitsInObservation: includeGasPriceSubunitsInObservation, Logger: logger.NewOCRWrapper(lggr, true, func(msg string) { ctx, cancelFn := p.stop.NewCtx() defer cancelFn() From 84b3f846eea77b5e2a5bc1648a34b3819c55206b Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 15 May 2024 12:15:38 -0400 Subject: [PATCH 09/14] update variable naming --- median/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/median/plugin.go b/median/plugin.go index d0c5070..016aa04 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -36,10 +36,10 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv // Once all chainlink nodes in DONs have libocr version >= fd3cab206b2c // this check and IncludeGasPriceSubunitsInObservation field can be removed - _, ok := gasPriceSubunits.(*ZeroDataSource) + _, isZeroDataSource := gasPriceSubunits.(*ZeroDataSource) var includeGasPriceSubunitsInObservation bool - if ok { + if isZeroDataSource { includeGasPriceSubunitsInObservation = false } else { includeGasPriceSubunitsInObservation = true From d5fc2d3163a15acbaf9b631de18928bd19c74cb8 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 16 May 2024 16:38:58 -0400 Subject: [PATCH 10/14] simplify logic --- median/plugin.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/median/plugin.go b/median/plugin.go index 016aa04..cbff349 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -38,12 +38,7 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv _, isZeroDataSource := gasPriceSubunits.(*ZeroDataSource) - var includeGasPriceSubunitsInObservation bool - if isZeroDataSource { - includeGasPriceSubunitsInObservation = false - } else { - includeGasPriceSubunitsInObservation = true - } + includeGasPriceSubunitsInObservation := !isZeroDataSource factory := median.NumericalMedianFactory{ DataSource: dataSource, From 6815f5f6749bb4230f070eda2cb1ba4118186b7b Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 16 May 2024 16:52:54 -0400 Subject: [PATCH 11/14] simplify comment --- median/plugin.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/median/plugin.go b/median/plugin.go index cbff349..54cef7f 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -31,10 +31,9 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv ctxVals.SetValues(ctx) lggr := logger.With(p.Logger, ctxVals.Args()...) - // Setting includeGasPriceSubunitsInObservation properly ensures we do not break libocr codec - // by including gasPriceSubunits in the observation when not allowed - // Once all chainlink nodes in DONs have libocr version >= fd3cab206b2c - // this check and IncludeGasPriceSubunitsInObservation field can be removed + // We may omit gas price in observation to maintain backwards compability in libocr (with older nodes). + // Once all chainlink nodes have updated to libocr version >= fd3cab206b2c + // the IncludeGasPriceSubunitsInObservation field can be removed _, isZeroDataSource := gasPriceSubunits.(*ZeroDataSource) From 0f2b6cd16ea028cc7fc7f2c2f2e07a1f44469e89 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 16 May 2024 16:53:45 -0400 Subject: [PATCH 12/14] comment --- median/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/median/plugin.go b/median/plugin.go index 54cef7f..a0db722 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -31,7 +31,7 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv ctxVals.SetValues(ctx) lggr := logger.With(p.Logger, ctxVals.Args()...) - // We may omit gas price in observation to maintain backwards compability in libocr (with older nodes). + // We omit gas price in observation to maintain backwards compability in libocr (with older nodes). // Once all chainlink nodes have updated to libocr version >= fd3cab206b2c // the IncludeGasPriceSubunitsInObservation field can be removed From 217297c665a9cfc88d6d599ab257b121b7a5d4f8 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 22 May 2024 16:35:46 -0400 Subject: [PATCH 13/14] update to chainlink-common master --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3902f4e..4d8cf45 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.3 require ( github.com/hashicorp/go-plugin v1.6.0 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20240515160501-a375a7ccb29e + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index 0e3fe11..dee4b9e 100644 --- a/go.sum +++ b/go.sum @@ -220,8 +220,8 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CM github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= 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.20240515160501-a375a7ccb29e h1:Kzu8G6l4Ke7Jvq/qwLZpsOfNrAEJngLInsfVVQuCnfA= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20240515160501-a375a7ccb29e/go.mod h1:WLCJQW1xRPL0kNQ2rl5DUnodrzxcbHzha3w46qaHIkg= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 h1:od+11B83s0mQwAMPP3lhtb0nYz63pIKpJEKddfFpu/M= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7/go.mod h1:cFHRblGbGn/rFYOOGsNbtLicMc1+5YdN0KoebYr93pk= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= From ebeeed53334150e1509db402028fc0fae1d84ed1 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 22 May 2024 17:35:28 -0400 Subject: [PATCH 14/14] typo --- median/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/median/plugin.go b/median/plugin.go index a0db722..7e1c242 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -31,7 +31,7 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv ctxVals.SetValues(ctx) lggr := logger.With(p.Logger, ctxVals.Args()...) - // We omit gas price in observation to maintain backwards compability in libocr (with older nodes). + // We omit gas price in observation to maintain backwards compatibility in libocr (with older nodes). // Once all chainlink nodes have updated to libocr version >= fd3cab206b2c // the IncludeGasPriceSubunitsInObservation field can be removed