From b9c54d77ce31e11e103ccc1caeb9388bb829215a Mon Sep 17 00:00:00 2001 From: Takeshi Arabiki Date: Fri, 18 Apr 2025 18:03:51 +0900 Subject: [PATCH 1/2] Use tracing bridges Signed-off-by: Takeshi Arabiki --- go.mod | 59 +++++---- go.sum | 122 +++++++++++------- module/chain.go | 17 +-- module/config.go | 12 +- module/fork_spec_test.go | 2 +- module/header_query_test.go | 6 +- module/prover_test.go | 4 +- module/setup_test.go | 2 +- module/tracer.go | 7 + tests/prover_network_test.go | 4 +- tool/testdata/internal/common.go | 2 +- .../internal/membership/verify_membership.go | 2 +- tool/testdata/internal/misbehavior.go | 2 +- tool/testdata/main.go | 2 +- 14 files changed, 148 insertions(+), 95 deletions(-) create mode 100644 module/tracer.go diff --git a/go.mod b/go.mod index bee7d843..5262bd3d 100644 --- a/go.mod +++ b/go.mod @@ -11,15 +11,16 @@ require ( github.com/datachainlab/ibc-hd-signer v0.1.2 github.com/ethereum/go-ethereum v1.15.0 github.com/holiman/uint256 v1.3.2 - github.com/hyperledger-labs/yui-relayer v0.5.11 + github.com/hyperledger-labs/yui-relayer v0.5.15 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 - google.golang.org/protobuf v1.35.2 + go.opentelemetry.io/otel v1.35.0 + google.golang.org/protobuf v1.36.5 ) require ( cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/api v0.7.3 // indirect @@ -50,7 +51,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect @@ -102,13 +103,13 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect @@ -119,6 +120,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.1 // indirect @@ -175,6 +177,8 @@ require ( github.com/rs/zerolog v1.32.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/samber/lo v1.49.1 // indirect + github.com/samber/slog-multi v1.4.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -196,29 +200,39 @@ require ( go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/bridges/otelslog v0.10.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.55.0 // indirect - go.opentelemetry.io/otel/metric v1.33.0 // indirect - go.opentelemetry.io/otel/sdk v1.33.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.33.0 // indirect - go.opentelemetry.io/otel/trace v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.11.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 // indirect + go.opentelemetry.io/otel/log v0.11.0 // indirect + go.opentelemetry.io/otel/metric v1.35.0 // indirect + go.opentelemetry.io/otel/sdk v1.35.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.11.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect + go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.32.0 // indirect + golang.org/x/crypto v0.33.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/oauth2 v0.24.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/term v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/oauth2 v0.26.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/grpc v1.71.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -228,6 +242,3 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) - -// See https://github.com/prysmaticlabs/grpc-gateway/issues/2 -replace github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 diff --git a/go.sum b/go.sum index aca16d0d..feb52fba 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -310,8 +310,8 @@ github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -344,8 +344,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -474,8 +474,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.15.0 h1:LLb2jCPsbJZcB4INw+E/MgzUX5wlR6SdwXcv09/1ME4= @@ -572,8 +572,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -634,8 +634,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -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/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -710,6 +710,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= @@ -776,8 +778,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/hyperledger-labs/yui-relayer v0.5.11 h1:tBDWJa96jQhxL9zLDbB94VvSgw0f8Xk9tqPuKMT3ARw= -github.com/hyperledger-labs/yui-relayer v0.5.11/go.mod h1:kJvSmuagdDsSlvbnHtEHbhmkUlAS43/ArLDwukOKSlo= +github.com/hyperledger-labs/yui-relayer v0.5.15 h1:kNJeUV9NJx51Txe9Y4ud6WNWQPMnWXvsReTBjQfp1jg= +github.com/hyperledger-labs/yui-relayer v0.5.15/go.mod h1:fyY5rY+lqyAAlr1AsWXsB22Qj5phbw/oszgZBL9UeEM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1061,6 +1063,10 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samber/lo v1.49.1 h1:4BIFyVfuQSEpluc7Fua+j1NolZHiEHEpaSEKdsH0tew= +github.com/samber/lo v1.49.1/go.mod h1:dO6KHFzUKXgP8LDhU0oI8d2hekjXnGOu0DB8Jecxd6o= +github.com/samber/slog-multi v1.4.0 h1:pwlPMIE7PrbTHQyKWDU+RIoxP1+HKTNOujk3/kdkbdg= +github.com/samber/slog-multi v1.4.0/go.mod h1:FsQ4Uv2L+E/8TZt+/BVgYZ1LoDWCbfCU21wVIoMMrO8= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -1187,28 +1193,52 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/bridges/otelslog v0.10.0 h1:lRKWBp9nWoBe1HKXzc3ovkro7YZSb72X2+3zYNxfXiU= +go.opentelemetry.io/contrib/bridges/otelslog v0.10.0/go.mod h1:D+iyUv/Wxbw5LUDO5oh7x744ypftIryiWjoj42I6EKs= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= +go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= +go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 h1:HMUytBT3uGhPKYY/u/G5MR9itrlSO2SMOsSD3Tk3k7A= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0/go.mod h1:hdDXsiNLmdW/9BF2jQpnHHlhFajpWCEYfM6e5m2OAZg= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 h1:QcFwRrZLc82r8wODjvyCbP7Ifp3UANaBSmhDSFjnqSc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0/go.mod h1:CXIWhUomyWBG/oY2/r/kLp6K/cmx9e/7DLpBuuGdLCA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo= go.opentelemetry.io/otel/exporters/prometheus v0.55.0 h1:sSPw658Lk2NWAv74lkD3B/RSDb+xRFx46GjkrL3VUZo= go.opentelemetry.io/otel/exporters/prometheus v0.55.0/go.mod h1:nC00vyCmQixoeaxF6KNyP42II/RHa9UdruK02qBmHvI= -go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= -go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= -go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM= -go.opentelemetry.io/otel/sdk/metric v1.33.0 h1:Gs5VK9/WUJhNXZgn8MR6ITatvAmKeIuCtNbsP3JkNqU= -go.opentelemetry.io/otel/sdk/metric v1.33.0/go.mod h1:dL5ykHZmm1B1nVRk9dDjChwDmt81MjVp3gLkQRwKf/Q= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.11.0 h1:k6KdfZk72tVW/QVZf60xlDziDvYAePj5QHwoQvrB2m8= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.11.0/go.mod h1:5Y3ZJLqzi/x/kYtrSrPSx7TFI/SGsL7q2kME027tH6I= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 h1:PB3Zrjs1sG1GBX51SXyTSoOTqcDglmsk7nT6tkKPb/k= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0/go.mod h1:U2R3XyVPzn0WX7wOIypPuptulsMcPDPs/oiSVOMVnHY= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 h1:T0Ec2E+3YZf5bgTNQVet8iTDW7oIk03tXHq+wkwIDnE= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0/go.mod h1:30v2gqH+vYGJsesLWFov8u47EpYTcIQcBjKpI6pJThg= +go.opentelemetry.io/otel/log v0.11.0 h1:c24Hrlk5WJ8JWcwbQxdBqxZdOK7PcP/LFtOtwpDTe3Y= +go.opentelemetry.io/otel/log v0.11.0/go.mod h1:U/sxQ83FPmT29trrifhQg+Zj2lo1/IPN1PF6RTFqdwc= +go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= +go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk/log v0.11.0 h1:7bAOpjpGglWhdEzP8z0VXc4jObOiDEwr3IYbhBnjk2c= +go.opentelemetry.io/otel/sdk/log v0.11.0/go.mod h1:dndLTxZbwBstZoqsJB3kGsRPkpAgaJrWfQg3lhlHFFY= +go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= +go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= +go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= +go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +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.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -1230,8 +1260,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= 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= @@ -1332,8 +1362,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= @@ -1359,8 +1389,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= +golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1375,8 +1405,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1479,13 +1509,13 @@ 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.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1496,8 +1526,8 @@ 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.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= @@ -1743,10 +1773,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1788,8 +1818,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1806,8 +1836,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= -google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= diff --git a/module/chain.go b/module/chain.go index 5bc09409..7a56ebce 100644 --- a/module/chain.go +++ b/module/chain.go @@ -5,7 +5,6 @@ import ( "math/big" "github.com/datachainlab/ethereum-ibc-relay-chain/pkg/client" - "github.com/datachainlab/ethereum-ibc-relay-chain/pkg/relay/ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/hyperledger-labs/yui-relayer/core" @@ -20,15 +19,17 @@ type Chain interface { } type ethChain struct { - *ethereum.Chain + core.Chain + ibcAddress common.Address + client *client.ETHClient } -func NewChain(chain *ethereum.Chain) Chain { - return ðChain{Chain: chain} +func NewChain(chain core.Chain, ibcAddress common.Address, client *client.ETHClient) Chain { + return ðChain{Chain: chain, ibcAddress: ibcAddress, client: client} } func (c *ethChain) Header(ctx context.Context, height uint64) (*types.Header, error) { - block, err := c.Client().BlockByNumber(ctx, big.NewInt(int64(height))) + block, err := c.client.BlockByNumber(ctx, big.NewInt(int64(height))) if err != nil { return nil, err } @@ -36,11 +37,11 @@ func (c *ethChain) Header(ctx context.Context, height uint64) (*types.Header, er } func (c *ethChain) IBCAddress() common.Address { - return c.Config().IBCAddress() + return c.ibcAddress } func (c *ethChain) CanonicalChainID(ctx context.Context) (uint64, error) { - chainID, err := c.Client().ChainID(ctx) + chainID, err := c.client.ChainID(ctx) if err != nil { return 0, err } @@ -48,5 +49,5 @@ func (c *ethChain) CanonicalChainID(ctx context.Context) (uint64, error) { } func (c *ethChain) GetProof(ctx context.Context, address common.Address, storageKeys [][]byte, blockNumber *big.Int) (*client.StateProof, error) { - return c.Client().GetProof(ctx, address, storageKeys, blockNumber) + return c.client.GetProof(ctx, address, storageKeys, blockNumber) } diff --git a/module/config.go b/module/config.go index 511e8131..af484600 100644 --- a/module/config.go +++ b/module/config.go @@ -2,18 +2,22 @@ package module import ( "fmt" + "github.com/datachainlab/ethereum-ibc-relay-chain/pkg/relay/ethereum" "github.com/hyperledger-labs/yui-relayer/core" + "github.com/hyperledger-labs/yui-relayer/coreutil" + "github.com/hyperledger-labs/yui-relayer/otelcore" ) var _ core.ProverConfig = (*ProverConfig)(nil) func (c *ProverConfig) Build(chain core.Chain) (core.Prover, error) { - chain_, ok := chain.(*ethereum.Chain) - if !ok { - return nil, fmt.Errorf("chain type must be %T, not %T", ðereum.Chain{}, chain) + chain_, err := coreutil.UnwrapChain[*ethereum.Chain](chain) + if err != nil { + return nil, err } - return NewProver(NewChain(chain_), c), nil + // Use chain, not chain_, for the case where the chain is wrapped by another struct that implements core.Chain (e.g. tracing bridge) + return otelcore.NewProver(NewProver(NewChain(chain, chain_.Config().IBCAddress(), chain_.Client()), c), chain.ChainID(), tracer), nil } func (c *ProverConfig) Validate() error { diff --git a/module/fork_spec_test.go b/module/fork_spec_test.go index 6fee38ed..e5ef6676 100644 --- a/module/fork_spec_test.go +++ b/module/fork_spec_test.go @@ -19,7 +19,7 @@ func TestForkSpecTestSuite(t *testing.T) { } func (ts *ForkSpecTestSuite) SetupTest() { - _ = log.InitLogger("DEBUG", "text", "stdout") + _ = log.InitLogger("DEBUG", "text", "stdout", false) boundaryHeightCache = make(map[uint64]uint64) } diff --git a/module/header_query_test.go b/module/header_query_test.go index 90530d37..ff841985 100644 --- a/module/header_query_test.go +++ b/module/header_query_test.go @@ -21,12 +21,12 @@ func TestHeaderQueryTestSuite(t *testing.T) { } func (ts *HeaderQueryTestSuite) SetupTest() { - err := log.InitLogger("DEBUG", "text", "stdout") + err := log.InitLogger("DEBUG", "text", "stdout", false) ts.Require().NoError(err) } func (ts *HeaderQueryTestSuite) TestErrorQueryFinalizedHeader() { - ts.Require().NoError(log.InitLogger("INFO", "json", "stdout")) + ts.Require().NoError(log.InitLogger("INFO", "json", "stdout", false)) fn := func(ctx context.Context, height uint64) (*types.Header, error) { return &types.Header{ Number: big.NewInt(int64(height)), @@ -52,7 +52,7 @@ func (ts *HeaderQueryTestSuite) TestErrorQueryFinalizedHeader() { } func (ts *HeaderQueryTestSuite) TestSuccessQueryFinalizedHeader() { - ts.Require().NoError(log.InitLogger("INFO", "json", "stdout")) + ts.Require().NoError(log.InitLogger("INFO", "json", "stdout", false)) fn := func(ctx context.Context, height uint64) (*types.Header, error) { h := headerByHeight(int64(height)) if h != nil { diff --git a/module/prover_test.go b/module/prover_test.go index 39933ffc..9b927031 100644 --- a/module/prover_test.go +++ b/module/prover_test.go @@ -96,7 +96,7 @@ func TestProverTestSuite(t *testing.T) { } func (ts *ProverTestSuite) SetupTest() { - err := log.InitLogger("DEBUG", "text", "stdout") + err := log.InitLogger("DEBUG", "text", "stdout", false) ts.Require().NoError(err) signerConfig := &hd.SignerConfig{ @@ -135,7 +135,7 @@ func (ts *ProverTestSuite) SetupTest() { Network: string(Localnet), } ts.chain = &mockChain{ - Chain: NewChain(chain), + Chain: NewChain(chain, chain.Config().IBCAddress(), chain.Client()), consensusStateTimestamp: make(map[exported.Height]uint64), chainTimestamp: make(map[exported.Height]uint64), latestHeight: 0, diff --git a/module/setup_test.go b/module/setup_test.go index 5860a0db..201a0521 100644 --- a/module/setup_test.go +++ b/module/setup_test.go @@ -22,7 +22,7 @@ func TestSetupTestSuite(t *testing.T) { } func (ts *SetupTestSuite) SetupTest() { - err := log.InitLogger("DEBUG", "text", "stdout") + err := log.InitLogger("DEBUG", "text", "stdout", false) ts.Require().NoError(err) } diff --git a/module/tracer.go b/module/tracer.go new file mode 100644 index 00000000..f8ba3487 --- /dev/null +++ b/module/tracer.go @@ -0,0 +1,7 @@ +package module + +import "go.opentelemetry.io/otel" + +var ( + tracer = otel.Tracer("github.com/datachainlab/ibc-parlia-relay/module") +) diff --git a/tests/prover_network_test.go b/tests/prover_network_test.go index a7a1e6eb..f19b2b50 100644 --- a/tests/prover_network_test.go +++ b/tests/prover_network_test.go @@ -37,7 +37,7 @@ func TestProverNetworkTestSuite(t *testing.T) { } func (ts *ProverNetworkTestSuite) SetupTest() { - err := log.InitLogger("DEBUG", "text", "stdout") + err := log.InitLogger("DEBUG", "text", "stdout", false) ts.Require().NoError(err) chain := ts.makeChain("http://localhost:8545", "ibc1") @@ -142,7 +142,7 @@ func (ts *ProverNetworkTestSuite) makeChain(rpcAddr string, ibcChainID string) m Order: "UNORDERED", }, nil, nil) ts.Require().NoError(err) - return module.NewChain(chain) + return module.NewChain(chain, chain.Config().IBCAddress(), chain.Client()) } func (ts *ProverNetworkTestSuite) makeProver(chain module.Chain) *module.Prover { diff --git a/tool/testdata/internal/common.go b/tool/testdata/internal/common.go index 69efab48..668a8f80 100644 --- a/tool/testdata/internal/common.go +++ b/tool/testdata/internal/common.go @@ -58,6 +58,6 @@ func createProver(ctx context.Context) (*module.Prover, module.Chain, error) { MaxClockDrift: 1 * time.Millisecond, Network: string(module.Localnet), } - ec := module.NewChain(chain) + ec := module.NewChain(chain, chain.Config().IBCAddress(), chain.Client()) return module.NewProver(ec, &config).(*module.Prover), ec, nil } diff --git a/tool/testdata/internal/membership/verify_membership.go b/tool/testdata/internal/membership/verify_membership.go index c81b706e..d62ef906 100644 --- a/tool/testdata/internal/membership/verify_membership.go +++ b/tool/testdata/internal/membership/verify_membership.go @@ -80,7 +80,7 @@ func (m *verifyMembershipModule) proveState(ctx context.Context, chainID uint64, return common.Hash{}, nil, types.Height{}, err } config := module.ProverConfig{} - prover := module.NewProver(module.NewChain(chain), &config).(*module.Prover) + prover := module.NewProver(module.NewChain(chain, chain.Config().IBCAddress(), chain.Client()), &config).(*module.Prover) queryCtx := core.NewQueryContext(ctx, latest) diff --git a/tool/testdata/internal/misbehavior.go b/tool/testdata/internal/misbehavior.go index 6c537d88..a75e635c 100644 --- a/tool/testdata/internal/misbehavior.go +++ b/tool/testdata/internal/misbehavior.go @@ -142,7 +142,7 @@ func (m *misbehaviorModule) getLocalHeader(ctx context.Context, chainID uint64, targetHeight = latest.GetRevisionHeight() - 1 } config := module.ProverConfig{} - prover := module.NewProver(module.NewChain(chain), &config).(*module.Prover) + prover := module.NewProver(module.NewChain(chain, chain.Config().IBCAddress(), chain.Client()), &config).(*module.Prover) // Get Finalized header latestHeight := types.NewHeight(0, targetHeight) diff --git a/tool/testdata/main.go b/tool/testdata/main.go index e0ac24c9..e701a1f7 100644 --- a/tool/testdata/main.go +++ b/tool/testdata/main.go @@ -14,7 +14,7 @@ func main() { cobra.EnableCommandSorting = false viper.AutomaticEnv() - if err := ylog.InitLogger("DEBUG", "text", "stdout"); err != nil { + if err := ylog.InitLogger("DEBUG", "text", "stdout", false); err != nil { log.Panicf("Failed to run command : %+v", err) return } From 4838ca3de6c712ce7f911769c5af8800f855e0df Mon Sep 17 00:00:00 2001 From: Takeshi Arabiki Date: Mon, 21 Apr 2025 17:08:58 +0900 Subject: [PATCH 2/2] Use logger methods with context Signed-off-by: Takeshi Arabiki --- module/fork_spec.go | 10 +++++----- module/fork_spec_test.go | 12 ++++++------ module/header_query.go | 6 +++--- module/proof.go | 8 ++++---- module/prover.go | 6 +++--- module/setup.go | 31 ++++++++++++++++--------------- tests/prover_network_test.go | 2 +- 7 files changed, 38 insertions(+), 37 deletions(-) diff --git a/module/fork_spec.go b/module/fork_spec.go index 1959c14d..a082624e 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -209,7 +209,7 @@ func FindTargetForkSpec(forkSpecs []*ForkSpec, height uint64, timestamp uint64) var boundaryHeightCache = make(map[uint64]uint64) -func GetBoundaryHeight(headerFn getHeaderFn, currentHeight uint64, currentForkSpec ForkSpec) (*BoundaryHeight, error) { +func GetBoundaryHeight(ctx context.Context, headerFn getHeaderFn, currentHeight uint64, currentForkSpec ForkSpec) (*BoundaryHeight, error) { logger := log.GetLogger() boundaryHeight := uint64(0) if condition, ok := currentForkSpec.GetHeightOrTimestamp().(*ForkSpec_Height); ok { @@ -219,20 +219,20 @@ func GetBoundaryHeight(headerFn getHeaderFn, currentHeight uint64, currentForkSp if v, ok := boundaryHeightCache[ts]; ok { boundaryHeight = v } else { - logger.Debug("seek fork height", "currentHeight", currentHeight, "ts", ts) + logger.DebugContext(ctx, "seek fork height", "currentHeight", currentHeight, "ts", ts) for i := int64(currentHeight); i >= 0; i-- { - h, err := headerFn(context.Background(), uint64(i)) + h, err := headerFn(ctx, uint64(i)) if err != nil { return nil, err } if MilliTimestamp(h) == ts { boundaryHeight = h.Number.Uint64() - logger.Debug("seek fork height found", "currentHeight", currentHeight, "ts", ts, "boundaryHeight", boundaryHeight) + logger.DebugContext(ctx, "seek fork height found", "currentHeight", currentHeight, "ts", ts, "boundaryHeight", boundaryHeight) boundaryHeightCache[ts] = boundaryHeight break } else if MilliTimestamp(h) < ts { boundaryHeight = h.Number.Uint64() + 1 - logger.Debug("seek fork height found", "currentHeight", currentHeight, "ts", ts, "boundaryHeight", boundaryHeight) + logger.DebugContext(ctx, "seek fork height found", "currentHeight", currentHeight, "ts", ts, "boundaryHeight", boundaryHeight) boundaryHeightCache[ts] = boundaryHeight break } diff --git a/module/fork_spec_test.go b/module/fork_spec_test.go index e5ef6676..fa8ec0ea 100644 --- a/module/fork_spec_test.go +++ b/module/fork_spec_test.go @@ -132,7 +132,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_ValidHeight() { currentHeight := uint64(100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Height{Height: 50}} - boundaryHeight, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.NoError(err) ts.Equal(uint64(50), boundaryHeight.Height) @@ -145,7 +145,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_ValidTimestamp() { currentHeight := uint64(100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Timestamp{Timestamp: 1000 * 1000}} // msec - boundaryHeight, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.NoError(err) ts.Equal(uint64(100), boundaryHeight.Height) @@ -158,7 +158,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_ValidTimestampMultiHeader() currentHeight := uint64(1100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Timestamp{Timestamp: 1000_000}} // msec - boundaryHeight, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.NoError(err) ts.Equal(uint64(1000), boundaryHeight.Height) @@ -171,7 +171,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_ValidTimestampMultiHeaderNot currentHeight := uint64(1100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Timestamp{Timestamp: 999_999}} // msec - boundaryHeight, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.NoError(err) ts.Equal(uint64(1000), boundaryHeight.Height) @@ -184,7 +184,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_TimestampNotFound() { currentHeight := uint64(100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Timestamp{Timestamp: 1000}} - boundaryHeight, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.NoError(err) ts.Equal(uint64(0), boundaryHeight.Height) @@ -197,7 +197,7 @@ func (ts *ForkSpecTestSuite) Test_GetBoundaryHeight_HeaderFnError() { currentHeight := uint64(100) currentForkSpec := ForkSpec{HeightOrTimestamp: &ForkSpec_Timestamp{Timestamp: 1000}} - _, err := GetBoundaryHeight(headerFn, currentHeight, currentForkSpec) + _, err := GetBoundaryHeight(context.Background(), headerFn, currentHeight, currentForkSpec) ts.Error(err) } diff --git a/module/header_query.go b/module/header_query.go index 723d303c..fc998fff 100644 --- a/module/header_query.go +++ b/module/header_query.go @@ -27,7 +27,7 @@ func queryLatestFinalizedHeader(ctx context.Context, getHeader getHeaderFn, late } probablyFinalized := vote.Data.SourceNumber - logger.Debug("Try to seek verifying headers to finalize", "probablyFinalized", probablyFinalized, "latest", latestBlockNumber) + logger.DebugContext(ctx, "Try to seek verifying headers to finalize", "probablyFinalized", probablyFinalized, "latest", latestBlockNumber) headers, err := queryFinalizedHeader(ctx, getHeader, probablyFinalized, latestBlockNumber) if err != nil { @@ -36,7 +36,7 @@ func queryLatestFinalizedHeader(ctx context.Context, getHeader getHeaderFn, late if headers != nil { return probablyFinalized, headers, nil } - logger.Debug("Failed to seek verifying headers to finalize. So seek previous finalized header.", "probablyFinalized", probablyFinalized, "latest", latestBlockNumber) + logger.DebugContext(ctx, "Failed to seek verifying headers to finalize. So seek previous finalized header.", "probablyFinalized", probablyFinalized, "latest", latestBlockNumber) } return 0, nil, fmt.Errorf("no finalized header found: %d", latestBlockNumber) } @@ -67,7 +67,7 @@ func queryFinalizedHeader(ctx context.Context, fn getHeaderFn, height uint64, li } return append(ethHeaders, targetETHHeader, childETHHeader, grandChildETHHeader), nil } - log.GetLogger().Debug("Insufficient verifying headers to finalize", "height", height, "limit", limitHeight) + log.GetLogger().DebugContext(ctx, "Insufficient verifying headers to finalize", "height", height, "limit", limitHeight) return nil, nil } diff --git a/module/proof.go b/module/proof.go index 9e33e933..3cb64ad1 100644 --- a/module/proof.go +++ b/module/proof.go @@ -188,19 +188,19 @@ func withValidators(ctx context.Context, headerFn getHeaderFn, height uint64, et if err != nil { return nil, err } - log.GetLogger().Debug("target fork spec", "currentForkSpec", currentForkSpec, "prevForkSpec", prevForkSpec) + log.GetLogger().DebugContext(ctx, "target fork spec", "currentForkSpec", currentForkSpec, "prevForkSpec", prevForkSpec) - boundaryHeight, err := GetBoundaryHeight(headerFn, height, *currentForkSpec) + boundaryHeight, err := GetBoundaryHeight(ctx, headerFn, height, *currentForkSpec) if err != nil { return nil, err } - log.GetLogger().Debug("get boundary height by ", "height", height, "boundaryHeight", boundaryHeight) + log.GetLogger().DebugContext(ctx, "get boundary height by ", "height", height, "boundaryHeight", boundaryHeight) boundaryEpochs, err := boundaryHeight.GetBoundaryEpochs(*prevForkSpec) if err != nil { return nil, err } - log.GetLogger().Debug("boundary epoch", "prevLast", boundaryEpochs.PrevLast, "currentFirst", boundaryEpochs.CurrentFirst, "intermediates", boundaryEpochs.Intermediates) + log.GetLogger().DebugContext(ctx, "boundary epoch", "prevLast", boundaryEpochs.PrevLast, "currentFirst", boundaryEpochs.CurrentFirst, "intermediates", boundaryEpochs.Intermediates) // Get validator set for verify headers currentEpoch := boundaryEpochs.CurrentEpochBlockNumber(height) diff --git a/module/prover.go b/module/prover.go index 87bd06fb..c1cf07fb 100644 --- a/module/prover.go +++ b/module/prover.go @@ -83,7 +83,7 @@ func (pr *Prover) GetLatestFinalizedHeader(ctx context.Context) (out core.Header if err != nil { return nil, err } - log.GetLogger().Debug("GetLatestFinalizedHeader", "finalized", header.GetHeight(), "latest", latestHeight) + log.GetLogger().DebugContext(ctx, "GetLatestFinalizedHeader", "finalized", header.GetHeight(), "latest", latestHeight) return header, err } @@ -207,7 +207,7 @@ func (pr *Prover) CheckRefreshRequired(ctx context.Context, counterparty core.Ch } threshold := durationMulByFraction(pr.config.GetTrustingPeriod(), pr.config.GetRefreshThresholdRate()) if elapsedTime > threshold { - log.GetLogger().Debug("needs refresh", "elapsedTime", elapsedTime, "threshold", threshold) + log.GetLogger().DebugContext(ctx, "needs refresh", "elapsedTime", elapsedTime, "threshold", threshold) return true, nil } @@ -218,7 +218,7 @@ func (pr *Prover) CheckRefreshRequired(ctx context.Context, counterparty core.Ch } blockDiff := selfQueryHeight.GetRevisionHeight() - cs.GetLatestHeight().GetRevisionHeight() if blockDiff > blockDiffThreshold { - log.GetLogger().Debug("needs refresh due to block diff", + log.GetLogger().DebugContext(ctx, "needs refresh due to block diff", "chain", cpQueryHeight.GetRevisionHeight(), "cs", cs.GetLatestHeight().GetRevisionHeight(), "threshold", blockDiffThreshold) diff --git a/module/setup.go b/module/setup.go index b7279900..c03c00c0 100644 --- a/module/setup.go +++ b/module/setup.go @@ -16,16 +16,17 @@ const skip = 100 type queryVerifiableNeighboringEpochHeaderFn = func(context.Context, uint64, uint64) (core.Header, error) func shouldSubmitBoundaryTimestampHeader( + ctx context.Context, getHeader getHeaderFn, trustedBlockNumber uint64, latestFinalizedBlockNumber uint64, forkSpecs []*ForkSpec) (*uint64, uint64, error) { - trustedBlock, err := getHeader(context.Background(), trustedBlockNumber) + trustedBlock, err := getHeader(ctx, trustedBlockNumber) if err != nil { return nil, 0, err } - latestFinalizedBlock, err := getHeader(context.Background(), latestFinalizedBlockNumber) + latestFinalizedBlock, err := getHeader(ctx, latestFinalizedBlockNumber) if err != nil { return nil, 0, err } @@ -34,7 +35,7 @@ func shouldSubmitBoundaryTimestampHeader( latestCondition := latestForkSpec.GetHeightOrTimestamp() if x, ok := latestCondition.(*ForkSpec_Timestamp); ok { if MilliTimestamp(trustedBlock) < x.Timestamp && x.Timestamp < MilliTimestamp(latestFinalizedBlock) { - boundaryHeight, err := GetBoundaryHeight(getHeader, latestFinalizedBlock.Number.Uint64(), *latestForkSpec) + boundaryHeight, err := GetBoundaryHeight(ctx, getHeader, latestFinalizedBlock.Number.Uint64(), *latestForkSpec) if err != nil { return nil, 0, err } @@ -44,7 +45,7 @@ func shouldSubmitBoundaryTimestampHeader( } nextForkBoundaryHeightMinus1 := uint64(boundaryHeight.Height) - 1 - log.GetLogger().Info("ForkSpec height required", "ts", x.Timestamp, "height", boundaryHeight, "nextForkBoundaryHeightMinus1", nextForkBoundaryHeightMinus1) + log.GetLogger().InfoContext(ctx, "ForkSpec height required", "ts", x.Timestamp, "height", boundaryHeight, "nextForkBoundaryHeightMinus1", nextForkBoundaryHeightMinus1) return &x.Timestamp, nextForkBoundaryHeightMinus1, nil } } @@ -61,7 +62,7 @@ func setupHeadersForUpdate( forkSpecs []*ForkSpec, ) ([]core.Header, error) { logger := log.GetLogger() - logger.Debug("setupHeadersForUpdate start", "target", latestFinalizedHeader.GetHeight().GetRevisionHeight()) + logger.DebugContext(ctx, "setupHeadersForUpdate start", "target", latestFinalizedHeader.GetHeight().GetRevisionHeight()) targetHeaders := make([]core.Header, 0) // Needless to update already saved state @@ -70,7 +71,7 @@ func setupHeadersForUpdate( } savedLatestHeight := clientStateLatestHeight.GetRevisionHeight() - trustedBlock, err := getHeader(context.Background(), savedLatestHeight) + trustedBlock, err := getHeader(ctx, savedLatestHeight) if err != nil { return nil, err } @@ -79,7 +80,7 @@ func setupHeadersForUpdate( if err != nil { return nil, err } - trustedBoundaryHeight, err := GetBoundaryHeight(getHeader, savedLatestHeight, *trustedCurrentForkSpec) + trustedBoundaryHeight, err := GetBoundaryHeight(ctx, getHeader, savedLatestHeight, *trustedCurrentForkSpec) if err != nil { return nil, err } @@ -92,7 +93,7 @@ func setupHeadersForUpdate( latestFinalizedHeight := latestFinalizedHeader.GetHeight().GetRevisionHeight() // If the condition is timestamp. we must submit the header with the timestamp - nextForkBoundaryTs, nextForkBoundaryHeightMinus1, err := shouldSubmitBoundaryTimestampHeader(getHeader, savedLatestHeight, latestFinalizedHeader.GetHeight().GetRevisionHeight(), forkSpecs) + nextForkBoundaryTs, nextForkBoundaryHeightMinus1, err := shouldSubmitBoundaryTimestampHeader(ctx, getHeader, savedLatestHeight, latestFinalizedHeader.GetHeight().GetRevisionHeight(), forkSpecs) if err != nil { return nil, err } @@ -103,7 +104,7 @@ func setupHeadersForUpdate( } submittingHeights := makeSubmittingHeights(latestFinalizedHeight, savedLatestHeight, firstUnsaved, nextForkBoundaryTs, nextForkBoundaryHeightMinus1) - logger.Debug("submitting heights", "heights", submittingHeights, "trusted height", savedLatestHeight, "trusted epoch", trustedEpochHeight, "first unsaved", firstUnsaved) + logger.DebugContext(ctx, "submitting heights", "heights", submittingHeights, "trusted height", savedLatestHeight, "trusted epoch", trustedEpochHeight, "first unsaved", firstUnsaved) trustedHeight := clientStateLatestHeight.GetRevisionHeight() for _, submittingHeight := range submittingHeights { @@ -112,14 +113,14 @@ func setupHeadersForUpdate( return nil, err } if verifiableHeader == nil { - logger.Error("[FastFinalityError]", fmt.Errorf("insufficient vote attestation: submittingHeight=%d, trusted=%d", submittingHeight, trustedHeight)) - return withTrustedHeight(targetHeaders, clientStateLatestHeight), nil + logger.ErrorContext(ctx, "[FastFinalityError]", fmt.Errorf("insufficient vote attestation: submittingHeight=%d, trusted=%d", submittingHeight, trustedHeight)) + return withTrustedHeight(ctx, targetHeaders, clientStateLatestHeight), nil } targetHeaders = append(targetHeaders, verifiableHeader) trustedHeight = submittingHeight - logger.Debug("setup epoch header", "trusted", trustedHeight, "height", submittingHeight) + logger.DebugContext(ctx, "setup epoch header", "trusted", trustedHeight, "height", submittingHeight) } - return withTrustedHeight(append(targetHeaders, latestFinalizedHeader), clientStateLatestHeight), nil + return withTrustedHeight(ctx, append(targetHeaders, latestFinalizedHeader), clientStateLatestHeight), nil } // Get verifiable headers. This method must be executed at block intervals that do not miss any epochs. @@ -132,7 +133,7 @@ func setupIntermediateHeader( return queryVerifiableHeader(ctx, submittingHeight, minUint64(submittingHeight+skip, latestHeight.GetRevisionHeight())) } -func withTrustedHeight(targetHeaders []core.Header, clientStateLatestHeight exported.Height) []core.Header { +func withTrustedHeight(ctx context.Context, targetHeaders []core.Header, clientStateLatestHeight exported.Height) []core.Header { logger := log.GetLogger() for i, h := range targetHeaders { var trustedHeight clienttypes.Height @@ -143,7 +144,7 @@ func withTrustedHeight(targetHeaders []core.Header, clientStateLatestHeight expo } h.(*Header).TrustedHeight = &trustedHeight - logger.Debug("setupHeadersForUpdate end", "target", h.GetHeight(), "trusted", trustedHeight, "headerSize", len(h.(*Header).Headers)) + logger.DebugContext(ctx, "setupHeadersForUpdate end", "target", h.GetHeight(), "trusted", trustedHeight, "headerSize", len(h.(*Header).Headers)) } return targetHeaders } diff --git a/tests/prover_network_test.go b/tests/prover_network_test.go index f19b2b50..171e60d6 100644 --- a/tests/prover_network_test.go +++ b/tests/prover_network_test.go @@ -95,7 +95,7 @@ func (ts *ProverNetworkTestSuite) TestSuccessCreateInitialLightClientState() { forkParams := module.GetForkParameters(module.Localnet) currentForkSpec, prevForkSpec, err := module.FindTargetForkSpec(forkParams, header.Number.Uint64(), module.MilliTimestamp(header)) ts.Require().NoError(err) - bs, err := module.GetBoundaryHeight(ts.chain.Header, header.Number.Uint64(), *currentForkSpec) + bs, err := module.GetBoundaryHeight(ctx, ts.chain.Header, header.Number.Uint64(), *currentForkSpec) ts.Require().NoError(err) be, err := bs.GetBoundaryEpochs(*prevForkSpec) ts.Require().NoError(err)