diff --git a/MakefileEc2.mk b/MakefileEc2.mk index 876f0d3f..92832247 100644 --- a/MakefileEc2.mk +++ b/MakefileEc2.mk @@ -22,7 +22,7 @@ build-bk-prod-morph-prod-mainnet-to-morph-tx-submitter: tar -czvf tx-submitter.tar.gz dist aws s3 cp tx-submitter.tar.gz s3://morph-0582-morph-technical-department-mainnet-data/morph-setup/tx-submitter.tar.gz - +# build for qanet build-bk-test-morph-test-qanet-to-morph-node-qanet: if [ ! -d dist ]; then mkdir -p dist; fi cd $(PWD)/node && make build @@ -38,7 +38,6 @@ build-bk-test-morph-test-qanet-to-morph-tx-submitter-qanet: tar -czvf tx-submitter.tar.gz dist aws s3 cp tx-submitter.tar.gz s3://morph-7637-morph-technical-department-qanet-data/morph-setup/tx-submitter.tar.gz - # build for hoodi build-bk-prod-morph-prod-testnet-to-morph-node-hoodi: if [ ! -d dist ]; then mkdir -p dist; fi @@ -54,4 +53,3 @@ build-bk-prod-morph-prod-testnet-to-morph-tx-submitter-hoodi: cp tx-submitter/tx-submitter dist/ tar -czvf tx-submitter.tar.gz dist aws s3 cp tx-submitter.tar.gz s3://morph-0582-morph-technical-department-testnet-data/testnet/hoodi/morph-setup/tx-submitter.tar.gz - diff --git a/MakefileEks.mk b/MakefileEks.mk index efef1510..03a8b39d 100644 --- a/MakefileEks.mk +++ b/MakefileEks.mk @@ -93,6 +93,36 @@ build-bk-test-morph-test-qanet-to-morph-staking-oracle-qanet: start-bk-test-morph-test-qanet-to-morph-staking-oracle-qanet: /data/secret-manager-wrapper ./staking-oracle +# qanet +build-bk-test-morph-test-qanet-to-morph-token-price-oracle: + if [ ! -d dist ]; then mkdir -p dist; fi + env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o token-price-oracle/token-price-oracle ./token-price-oracle/cmd + cp token-price-oracle/token-price-oracle dist/ + aws s3 cp s3://morph-7637-morph-technical-department-qanet-data/morph-setup/secret-manager-wrapper.tar.gz ./ + tar -xvzf secret-manager-wrapper.tar.gz + +start-bk-test-morph-test-qanet-to-morph-token-price-oracle: + /data/secret-manager-wrapper ./token-price-oracle + +build-bk-prod-morph-prod-testnet-to-morph-token-price-oracle-hoodi: + if [ ! -d dist ]; then mkdir -p dist; fi + env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o token-price-oracle/token-price-oracle ./token-price-oracle/cmd + cp token-price-oracle/token-price-oracle dist/ + + +start-bk-prod-morph-prod-testnet-to-morph-token-price-oracle-hoodi: + /data/secret-manager-wrapper ./token-price-oracle + + +build-bk-prod-morph-prod-mainnet-to-morph-token-price-oracle: + if [ ! -d dist ]; then mkdir -p dist; fi + env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o token-price-oracle/token-price-oracle ./token-price-oracle/cmd + cp token-price-oracle/token-price-oracle dist/ + + +start-bk-prod-morph-prod-mainnet-to-morph-token-price-oracle: + /data/secret-manager-wrapper ./token-price-oracle + # gas-oracle # testnet diff --git a/bindings/go.sum b/bindings/go.sum index 748be630..fe0add30 100644 --- a/bindings/go.sum +++ b/bindings/go.sum @@ -112,6 +112,7 @@ github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFV github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= diff --git a/contracts/go.sum b/contracts/go.sum index 291bdc00..ec6efedf 100644 --- a/contracts/go.sum +++ b/contracts/go.sum @@ -1,10 +1,12 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E= @@ -16,6 +18,9 @@ github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAhOs= github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= github.com/consensys/gnark-crypto v0.16.0 h1:8Dl4eYmUWK9WmlP1Bj6je688gBRJCJbT8Mw4KoTAawo= @@ -34,47 +39,64 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= +github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/hashicorp/go-bexpr v0.1.13 h1:HNwp7vZrMpRq8VZXj8VF90LbZpRjQQpim1oJF0DgSwg= +github.com/hashicorp/go-bexpr v0.1.13/go.mod h1:gN7hRKB3s7yT+YvTdnhZVLTENejvhlkZ8UE4YVBS+Q8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= @@ -82,10 +104,14 @@ github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXei github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk= github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -97,27 +123,41 @@ 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.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= +github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -125,69 +165,119 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= +github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= +github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= +github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE= github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/status-im/keycard-go v0.3.2 h1:YusIF/bHx6YZis8UTOJrpZFnTs4IkRBdmJXqdiXkpFE= +github.com/status-im/keycard-go v0.3.2/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +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.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 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= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/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.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/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.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= @@ -197,6 +287,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 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-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -210,6 +302,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/go.work b/go.work index 7b232d50..d29dbaad 100644 --- a/go.work +++ b/go.work @@ -7,5 +7,6 @@ use ( ./ops/l2-genesis ./ops/tools ./oracle + ./token-price-oracle ./tx-submitter ) diff --git a/go.work.sum b/go.work.sum index 1c7dd1c9..eda69060 100644 --- a/go.work.sum +++ b/go.work.sum @@ -289,6 +289,7 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -530,6 +531,7 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= @@ -569,6 +571,7 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -587,6 +590,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -699,6 +703,7 @@ github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= @@ -719,6 +724,7 @@ github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= @@ -743,6 +749,7 @@ github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUo github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -777,6 +784,7 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -951,7 +959,9 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= 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.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U= @@ -985,6 +995,7 @@ github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWe github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/profile v0.1.1 h1:jhDmAqPyebOsVDOCICJoINoLb/AnLBaUw58nFzxWS2w= github.com/moby/buildkit v0.13.0 h1:reVR1Y+rbNIUQ9jf0Q1YZVH5a/nhOixZsl+HJ9qQEGI= github.com/moby/buildkit v0.13.0/go.mod h1:aNmNQKLBFYAOFuzQjR3VA27/FijlvtBD1pjNwTSN37k= @@ -999,6 +1010,7 @@ github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EH github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/morph-l2/go-ethereum v1.10.14-0.20251120124625-16a606312846/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= @@ -1096,6 +1108,7 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -1107,6 +1120,7 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/quasilyte/go-ruleguard v0.3.17 h1:cDdoaSbQg11LXPDQqiCK54QmQXsEQQCTIgdcpeULGSI= github.com/quasilyte/go-ruleguard v0.3.17/go.mod h1:sST5PvaR7yb/Az5ksX8oc88usJ4EGjmJv7cK7y3jyig= github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5 h1:PDWGei+Rf2bBiuZIbZmM20J2ftEy9IeUCHA8HbQqed8= @@ -1118,10 +1132,12 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52 h1:RnWNS9Hlm8BIkjr6wx8li5abe0fr73jljLycdfemTp0= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= @@ -1194,6 +1210,7 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6 github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1208,6 +1225,7 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/sylvia7788/contextcheck v1.0.6 h1:o2EZgVPyMKE/Mtoqym61DInKEjwEbsmyoxg3VrmjNO4= github.com/sylvia7788/contextcheck v1.0.6/go.mod h1:9XDxwvxyuKD+8N+a7Gs7bfWLityh5t70g/GjdEt2N2M= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tdakkota/asciicheck v0.1.1 h1:PKzG7JUTUmVspQTDqtkX9eSiLGossXTybutHwTXuO0A= github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= @@ -1333,6 +1351,7 @@ golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ug golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d h1:+W8Qf4iJtMGKkyAygcKohjxTk4JPsL9DpzApJ22m5Ic= golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -1429,6 +1448,7 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/node/derivation/beacon_test.go b/node/derivation/beacon_test.go index 2f79aa0c..e1d4e1b0 100644 --- a/node/derivation/beacon_test.go +++ b/node/derivation/beacon_test.go @@ -1 +1,71 @@ package derivation + +import ( + "context" + "fmt" + "math/big" + "os" + "testing" + + "github.com/morph-l2/go-ethereum" + "github.com/morph-l2/go-ethereum/common" + eth "github.com/morph-l2/go-ethereum/core/types" + "github.com/morph-l2/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +func TestGetBlob(t *testing.T) { + url := os.Getenv("BLOB_URL") + if url == "" { + return + } + var ( + start uint64 = 1590159 + end uint64 = 1590159 + ) + baseHttp := NewBasicHTTPClient(url, nil) + // query blob + l1BeaconClient := NewL1BeaconClient(baseHttp) + l1Client, err := ethclient.Dial(url) + require.NoError(t, err) + logs, err := testTchRollupLog(l1Client, context.Background(), start, end) + require.NoError(t, err) + if len(logs) > 0 { + for _, lg := range logs { + txHash := lg.TxHash + block, err := l1Client.BlockByNumber(context.Background(), big.NewInt(int64(lg.BlockNumber))) + require.NoError(t, err) + tx, _, err := l1Client.TransactionByHash(context.Background(), txHash) + require.NoError(t, err) + indexedBlobHashes := dataAndHashesFromTxs(block.Transactions(), tx) + fmt.Println(indexedBlobHashes) + header, err := l1Client.HeaderByNumber(context.Background(), big.NewInt(int64(lg.BlockNumber))) + require.NoError(t, err) + var bts eth.BlobTxSidecar + if len(indexedBlobHashes) != 0 { + bts, err = l1BeaconClient.GetBlobSidecar(context.Background(), L1BlockRef{ + Time: header.Time, + }, indexedBlobHashes) + require.NoError(t, err) + } + t.Log(len(bts.Blobs)) + } + + } + +} + +func testTchRollupLog(l1Client *ethclient.Client, ctx context.Context, from, to uint64) ([]eth.Log, error) { + RollupContractAddress := common.HexToAddress("0x511d92b63ae7471fd5239bded29b76a446698a00") + query := ethereum.FilterQuery{ + FromBlock: big.NewInt(0).SetUint64(from), + ToBlock: big.NewInt(0).SetUint64(to), + Addresses: []common.Address{ + RollupContractAddress, + }, + Topics: [][]common.Hash{ + {RollupEventTopicHash}, + }, + } + return l1Client.FilterLogs(ctx, query) +} diff --git a/node/go.mod b/node/go.mod index 0fb37c2a..a14a5471 100644 --- a/node/go.mod +++ b/node/go.mod @@ -17,8 +17,8 @@ require ( github.com/stretchr/testify v1.10.0 github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a github.com/tendermint/tendermint v0.35.9 - github.com/urfave/cli v1.22.14 - golang.org/x/exp v0.0.0-20230206171751-46f607a40771 + github.com/urfave/cli v1.22.17 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -32,7 +32,7 @@ require ( github.com/consensys/bavard v0.1.27 // indirect github.com/consensys/gnark-crypto v0.16.0 // indirect github.com/cosmos/gogoproto v1.4.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect diff --git a/node/go.sum b/node/go.sum index 8af06ae8..f9673a5d 100644 --- a/node/go.sum +++ b/node/go.sum @@ -39,7 +39,7 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= @@ -111,9 +111,9 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXy github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -509,8 +509,8 @@ github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDgu github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -549,8 +549,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-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= 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= diff --git a/ops/docker/Dockerfile.token-price-oracle b/ops/docker/Dockerfile.token-price-oracle new file mode 100644 index 00000000..249ba422 --- /dev/null +++ b/ops/docker/Dockerfile.token-price-oracle @@ -0,0 +1,17 @@ +# Build token-price-oracle in a stock Go builder container +FROM ghcr.io/morph-l2/go-ubuntu-builder:go-1.24-ubuntu as builder + +COPY . /morph + +WORKDIR /morph/token-price-oracle + +RUN make build + +# Copy binary into a lightweight runtime container +FROM ghcr.io/morph-l2/go-ubuntu-builder:go-1.24-ubuntu + +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends ca-certificates +COPY --from=builder /morph/token-price-oracle/build/bin/token-price-oracle /usr/local/bin/ + +CMD ["token-price-oracle"] \ No newline at end of file diff --git a/ops/l2-genesis/go.mod b/ops/l2-genesis/go.mod index 63ab0445..592cfc32 100644 --- a/ops/l2-genesis/go.mod +++ b/ops/l2-genesis/go.mod @@ -8,7 +8,7 @@ require ( github.com/holiman/uint256 v1.2.4 github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 github.com/stretchr/testify v1.10.0 - github.com/urfave/cli v1.22.14 + github.com/urfave/cli v1.22.17 ) require ( @@ -18,7 +18,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/consensys/bavard v0.1.27 // indirect github.com/consensys/gnark-crypto v0.16.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect diff --git a/ops/l2-genesis/go.sum b/ops/l2-genesis/go.sum index 51bb4e23..880d32dd 100644 --- a/ops/l2-genesis/go.sum +++ b/ops/l2-genesis/go.sum @@ -1,4 +1,4 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= @@ -26,9 +26,8 @@ github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAh github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= github.com/consensys/gnark-crypto v0.16.0 h1:8Dl4eYmUWK9WmlP1Bj6je688gBRJCJbT8Mw4KoTAawo= github.com/consensys/gnark-crypto v0.16.0/go.mod h1:Ke3j06ndtPTVvo++PhGNgvm+lgpLvzbcE2MqljY7diU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -143,6 +142,7 @@ github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFV github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -199,6 +199,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/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/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -218,8 +219,8 @@ github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= diff --git a/ops/tools/go.sum b/ops/tools/go.sum index 26968a4c..5c2f8a89 100644 --- a/ops/tools/go.sum +++ b/ops/tools/go.sum @@ -164,6 +164,7 @@ github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFV github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/morph-l2/tendermint v0.3.2 h1:Gu6Uj2G6c3YP2NAKFi7A46JZaOCdD4zfZDKCjt0pDm8= github.com/morph-l2/tendermint v0.3.2/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/oracle/go.mod b/oracle/go.mod index eb3808d2..c596a244 100644 --- a/oracle/go.mod +++ b/oracle/go.mod @@ -11,7 +11,7 @@ require ( github.com/prometheus/client_golang v1.17.0 github.com/stretchr/testify v1.10.0 github.com/tendermint/tendermint v0.35.9 - github.com/urfave/cli v1.22.14 + github.com/urfave/cli v1.22.17 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -24,7 +24,7 @@ require ( github.com/consensys/bavard v0.1.27 // indirect github.com/consensys/gnark-crypto v0.16.0 // indirect github.com/cosmos/gogoproto v1.4.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect diff --git a/oracle/go.sum b/oracle/go.sum index 5edc1dae..fbf4afb5 100644 --- a/oracle/go.sum +++ b/oracle/go.sum @@ -1,4 +1,4 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -38,9 +38,8 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fj github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -176,6 +175,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/morph-l2/externalsign v0.3.1 h1:UYFDZFB0L85A4rDvuwLNBiGEi0kSmg9AZ2v8Q5O4dQo= github.com/morph-l2/externalsign v0.3.1/go.mod h1:b6NJ4GUiiG/gcSJsp3p8ExsIs4ZdphlrVALASnVoGJE= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/morph-l2/tendermint v0.3.2 h1:Gu6Uj2G6c3YP2NAKFi7A46JZaOCdD4zfZDKCjt0pDm8= github.com/morph-l2/tendermint v0.3.2/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -249,6 +249,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/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/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -268,8 +269,8 @@ github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= diff --git a/oracle/oracle/batch.go b/oracle/oracle/batch.go index 0c2d52f7..8e1eb9c2 100644 --- a/oracle/oracle/batch.go +++ b/oracle/oracle/batch.go @@ -192,7 +192,7 @@ func (o *Oracle) getBatchSubmissionByLogs(rLogs []types.Log, recordBatchSubmissi continue } if rollupCommitBatch.BatchIndex.Uint64() > batchIndex { - return fmt.Errorf(fmt.Sprintf("batch is incontinuity,expect %v,have %v", batchIndex, rollupCommitBatch.BatchIndex.Uint64())) + return fmt.Errorf("batch is incontinuity, expect %v, have %v", batchIndex, rollupCommitBatch.BatchIndex.Uint64()) } // set batchIndex to new batch index + 1 batchIndex = rollupCommitBatch.BatchIndex.Uint64() + 1 diff --git a/token-price-oracle/Dockerfile b/token-price-oracle/Dockerfile new file mode 100644 index 00000000..eeb2d7c7 --- /dev/null +++ b/token-price-oracle/Dockerfile @@ -0,0 +1,42 @@ +# Build stage +FROM golang:1.21-alpine AS builder + +# Install build dependencies +RUN apk add --no-cache git make gcc musl-dev + +WORKDIR /app + +# Copy dependency files +COPY go.mod go.sum ./ +RUN go mod download + +# Copy source code +COPY . . + +# Build binary +RUN make build + +# Runtime stage +FROM alpine:latest + +# Install ca-certificates for HTTPS requests +RUN apk --no-cache add ca-certificates + +WORKDIR /root/ + +# Copy binary from build stage +COPY --from=builder /app/build/bin/token-price-oracle . + +# Create log directory +RUN mkdir -p /data/logs/token-price-oracle + +# Expose metrics port +EXPOSE 6060 + +# Health check endpoint +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:6060/metrics || exit 1 + +# Run service +ENTRYPOINT ["./token-price-oracle"] + diff --git a/token-price-oracle/Makefile b/token-price-oracle/Makefile new file mode 100644 index 00000000..0e4e5b9f --- /dev/null +++ b/token-price-oracle/Makefile @@ -0,0 +1,44 @@ +.PHONY: all build test lint clean run docker-build help + +# Default target +all: build + +GITCOMMIT := $(shell git rev-parse HEAD) +GITDATE := $(shell git show -s --format='%ct') +VERSION := v0.1.0 + +LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT) +LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) +LDFLAGSSTRING +=-X main.GitVersion=$(VERSION) +LDFLAGS := -ldflags "$(LDFLAGSSTRING)" + +build: + if [ ! -d build/bin ]; then mkdir -p build/bin; fi + go mod download + env GO111MODULE=on CGO_ENABLED=1 CGO_LDFLAGS="-ldl" go build -o build/bin/token-price-oracle -v $(LDFLAGS) ./cmd +run: build + ./build/bin/token-price-oracle + +test: + go test -v ./... + +lint: + golangci-lint run ./... + +clean: + rm -rf build/ + +docker-build: + docker build -t morph/token-price-oracle:latest . + +help: + @echo "Available targets:" + @echo " all (default) - Build the token-price-oracle binary" + @echo " build - Build the token-price-oracle binary" + @echo " run - Build and run the service" + @echo " test - Run tests" + @echo " lint - Run linter" + @echo " clean - Clean build artifacts" + @echo " docker-build - Build Docker image" + @echo " help - Show this help message" + diff --git a/token-price-oracle/README.md b/token-price-oracle/README.md new file mode 100644 index 00000000..4c45911d --- /dev/null +++ b/token-price-oracle/README.md @@ -0,0 +1,173 @@ +# Gas Price Oracle + +Gas Price Oracle service monitors L1 gas prices and updates the GasPriceOracle contract on L2. + +## Features + +- **L1 Base Fee Update**: Monitors L1 base fee and blob base fee, updates to L2 +- **Scalar Update**: Calculates and updates commit scalar and blob scalar +- **Transaction Manager**: Serializes all contract updates to avoid nonce conflicts +- **Metrics Monitoring**: Exposes Prometheus metrics +- **Flags Configuration**: Uses `urfave/cli` for configuration management (supports both CLI flags and environment variables) + +## Configuration + +The service uses flags that can be set either via command line or environment variables (with `GAS_ORACLE_` prefix). + +### Required Flags + +| Flag | Env Var | Description | +| --------------------- | --------------------------- | ------------------------------- | +| `--l1-eth-rpc` | `GAS_ORACLE_L1_ETH_RPC` | L1 RPC endpoint | +| `--l2-eth-rpc` | `GAS_ORACLE_L2_ETH_RPC` | L2 RPC endpoint | +| `--l1-beacon-rpc` | `GAS_ORACLE_L1_BEACON_RPC` | L1 Beacon Chain API endpoint | +| `--l1-rollup-address` | `GAS_ORACLE_L1_ROLLUP` | L1 Rollup contract address | +| `--private-key` | `GAS_ORACLE_L2_PRIVATE_KEY` | Private key for L2 transactions | + +### Optional Flags + +| Flag | Env Var | Default | Description | +| ------------------------------- | ---------------------------------- | --------------- | --------------------------- | +| `--l2-gas-price-oracle-address` | `GAS_ORACLE_L2_GAS_PRICE_ORACLE` | `0x5300...0002` | L2 GasPriceOracle contract | +| `--gas-threshold` | `GAS_ORACLE_GAS_THRESHOLD` | `10` | Update threshold percentage | +| `--interval` | `GAS_ORACLE_INTERVAL` | `6s` | Base fee update interval | +| `--overhead-interval` | `GAS_ORACLE_OVERHEAD_INTERVAL` | `10` | Scalar update frequency | +| `--txn-per-batch` | `GAS_ORACLE_TXN_PER_BATCH` | `50` | Expected txs per batch | +| `--log-level` | `GAS_ORACLE_LOG_LEVEL` | `info` | Log level | +| `--log-filename` | `GAS_ORACLE_LOG_FILENAME` | - | Log file path | +| `--metrics-server-enable` | `GAS_ORACLE_METRICS_SERVER_ENABLE` | `false` | Enable metrics server | +| `--metrics-hostname` | `GAS_ORACLE_METRICS_HOSTNAME` | `0.0.0.0` | Metrics server host | +| `--metrics-port` | `GAS_ORACLE_METRICS_PORT` | `6060` | Metrics server port | + +## Usage + +### Command Line + +```bash +./bin/token-price-oracle \ + --l1-eth-rpc https://ethereum-rpc.com \ + --l2-eth-rpc https://morph-l2-rpc.com \ + --l1-beacon-rpc https://beacon-api.com \ + --l1-rollup-address 0x... \ + --private-key 0x... \ + --metrics-server-enable \ + --log-level debug +``` + +### Environment Variables + +```bash +export GAS_ORACLE_L1_ETH_RPC="https://ethereum-rpc.com" +export GAS_ORACLE_L2_ETH_RPC="https://morph-l2-rpc.com" +export GAS_ORACLE_L1_BEACON_RPC="https://beacon-api.com" +export GAS_ORACLE_L1_ROLLUP="0x..." +export GAS_ORACLE_L2_PRIVATE_KEY="0x..." +export GAS_ORACLE_METRICS_SERVER_ENABLE=true +export GAS_ORACLE_LOG_LEVEL=info + +./bin/token-price-oracle +``` + +## Build and Run + +**Note**: This project uses Go workspace and depends on `../bindings` module. + +```bash +# Build +make build + +# Run +make run + +# Test +make test + +# Test Bitget price feed (requires network) +go test ./client -run TestBitgetPriceFeed -v + +# Docker +make docker-build +docker run -d \ + -e GAS_ORACLE_L1_ETH_RPC="..." \ + -e GAS_ORACLE_L2_ETH_RPC="..." \ + -e GAS_ORACLE_L1_BEACON_RPC="..." \ + -e GAS_ORACLE_L1_ROLLUP="0x..." \ + -e GAS_ORACLE_L2_PRIVATE_KEY="0x..." \ + morph/token-price-oracle:latest +``` + +## Monitoring + +When metrics server is enabled, it exposes metrics at `:/metrics`: + +- `l1_base_fee` - L1 base fee (Gwei) +- `l1_base_fee_on_l2` - L1 base fee on L2 +- `l1_blob_base_fee_on_l2` - L1 blob base fee on L2 +- `commit_scalar` - Commit scalar value +- `blob_scalar` - Blob scalar value +- `txn_per_batch` - Transactions per batch +- `gas_oracle_owner_balance` - Oracle account balance +- `base_fee_update_count` - Total base fee updates +- `scalar_update_count` - Total scalar updates +- `update_errors_total` - Update errors by type + +Health check endpoint: `:/health` + +## Architecture + +``` +gas-price-oracle/ +├── cmd/ # Main entry point +├── flags/ # CLI flags definitions +├── config/ # Configuration from flags +├── updater/ # Update implementations +│ ├── basefee.go # Base fee updater +│ ├── scalar.go # Scalar updater +│ └── tx_manager.go # Transaction manager (prevents nonce conflicts) +├── client/ # Client wrappers +├── calc/ # Calculation logic +└── metrics/ # Prometheus metrics + +Uses: ../bindings/bindings (project root contract bindings) +``` + +## Key Components + +### Transaction Manager + +All contract updates are serialized through `TxManager` to prevent nonce conflicts: + +- Holds a mutex to ensure only one transaction is sent at a time +- Manages nonce retrieval and transaction confirmation +- Used by both `BaseFeeUpdater` and `ScalarUpdater` + +### Base Fee Updater + +- Runs on a fixed interval (default 6s) +- Fetches L1 base fee and blob base fee +- Updates L2 contract when threshold is exceeded + +### Scalar Updater + +- Runs every N base fee update cycles (default 10) +- Reads `CommitBatch` events from L1 Rollup +- Calculates commit and blob scalars +- Updates L2 contract when necessary + +### Blob Processing + +Blob data processing is partially implemented (interface defined in `calc/blob.go`). The actual blob parsing and L2 transaction extraction is deferred for future implementation. + +## Testing + +```bash +# Run all tests +go test ./... + +# Test Bitget price feed (requires network) +go test ./client -run TestBitgetPriceFeed -v + +# Skip integration tests +go test ./... -short +``` + diff --git a/token-price-oracle/client/bitget_sdk.go b/token-price-oracle/client/bitget_sdk.go new file mode 100644 index 00000000..6868672a --- /dev/null +++ b/token-price-oracle/client/bitget_sdk.go @@ -0,0 +1,264 @@ +package client + +import ( + "context" + "encoding/json" + "fmt" + "io" + "math/big" + "net/http" + "strconv" + "sync" + "time" + + "github.com/morph-l2/go-ethereum/log" +) + +const ( + bitgetTickerPath = "/api/v2/spot/market/tickers" +) + +// BitgetSDKPriceFeed uses Bitget REST API to fetch prices +// This type is safe for concurrent use by multiple goroutines +type BitgetSDKPriceFeed struct { + httpClient *http.Client + mu sync.RWMutex // protects tokenMap and ethPrice + tokenMap map[uint16]string // guarded by mu + ethPrice *big.Float // guarded by mu + log log.Logger + baseURL string +} + +// BitgetV2Response represents Bitget V2 API response +type BitgetV2Response struct { + Code string `json:"code"` + Msg string `json:"msg"` + RequestTime int64 `json:"requestTime"` + Data []BitgetV2Ticker `json:"data"` +} + +// BitgetV2Ticker represents V2 ticker data +type BitgetV2Ticker struct { + Symbol string `json:"symbol"` + LastPr string `json:"lastPr"` + High24h string `json:"high24h"` + Low24h string `json:"low24h"` + Change24h string `json:"change24h"` + BaseVolume string `json:"baseVolume"` + QuoteVolume string `json:"quoteVolume"` +} + +// NewBitgetSDKPriceFeed creates a new Bitget price feed using REST API +func NewBitgetSDKPriceFeed(tokenMap map[uint16]string, baseURL string) *BitgetSDKPriceFeed { + return &BitgetSDKPriceFeed{ + httpClient: &http.Client{ + Timeout: 10 * time.Second, + }, + tokenMap: tokenMap, + ethPrice: big.NewFloat(0), + log: log.New("component", "bitget_price_feed"), + baseURL: baseURL, + } +} + +// GetTokenPrice returns token price in USD +// Note: Caller should ensure ETH price is updated via GetBatchTokenPrices for batch operations +func (b *BitgetSDKPriceFeed) GetTokenPrice(ctx context.Context, tokenID uint16) (*TokenPrice, error) { + b.mu.RLock() + symbol, exists := b.tokenMap[tokenID] + ethPrice := new(big.Float).Copy(b.ethPrice) + b.mu.RUnlock() + + if !exists { + return nil, fmt.Errorf("token ID %d not mapped to trading pair", tokenID) + } + + // Fetch token price + tokenPrice, err := b.fetchPrice(ctx, symbol) + if err != nil { + return nil, fmt.Errorf("failed to fetch price for %s: %w", symbol, err) + } + + // Use cached ETH price (should be updated by GetBatchTokenPrices) + if ethPrice.Cmp(big.NewFloat(0)) == 0 { + return nil, fmt.Errorf("ETH price not initialized, please call GetBatchTokenPrices first") + } + + b.log.Info("Fetched price from Bitget", + "source", "bitget", + "token_id", tokenID, + "symbol", symbol, + "token_price_usd", tokenPrice.String(), + "eth_price_usd", ethPrice.String()) + + return &TokenPrice{ + TokenID: tokenID, + Symbol: symbol, + TokenPriceUSD: tokenPrice, + EthPriceUSD: ethPrice, + }, nil +} + +// GetBatchTokenPrices returns batch token prices in USD +func (b *BitgetSDKPriceFeed) GetBatchTokenPrices(ctx context.Context, tokenIDs []uint16) (map[uint16]*TokenPrice, error) { + // Update ETH price first (this will acquire write lock) + if err := b.updateETHPrice(ctx); err != nil { + return nil, fmt.Errorf("failed to update ETH price: %w", err) + } + + prices := make(map[uint16]*TokenPrice) + + for _, tokenID := range tokenIDs { + price, err := b.GetTokenPrice(ctx, tokenID) + if err != nil { + b.log.Warn("Failed to get price for token, skipping", + "token_id", tokenID, + "error", err) + continue + } + prices[tokenID] = price + } + + return prices, nil +} + +// updateETHPrice updates ETH price +func (b *BitgetSDKPriceFeed) updateETHPrice(ctx context.Context) error { + price, err := b.fetchPrice(ctx, "ETHUSDT") + if err != nil { + return fmt.Errorf("failed to fetch ETH price: %w", err) + } + + b.mu.Lock() + b.ethPrice = price + b.mu.Unlock() + + b.log.Info("Fetched ETH price from Bitget", + "source", "bitget", + "symbol", "ETHUSDT", + "eth_price_usd", price.String()) + + return nil +} + +// fetchPrice fetches price with retry +func (b *BitgetSDKPriceFeed) fetchPrice(ctx context.Context, symbol string) (*big.Float, error) { + maxRetries := 3 + var lastErr error + + for attempt := 0; attempt < maxRetries; attempt++ { + if attempt > 0 { + backoff := time.Duration(attempt) * time.Second + b.log.Debug("Retrying fetch price", + "symbol", symbol, + "attempt", attempt+1, + "backoff", backoff) + + select { + case <-time.After(backoff): + case <-ctx.Done(): + return nil, ctx.Err() + } + } + + price, err := b.fetchPriceOnce(ctx, symbol) + if err == nil { + return price, nil + } + + lastErr = err + b.log.Warn("Failed to fetch price, will retry", + "symbol", symbol, + "attempt", attempt+1, + "error", err) + } + + return nil, fmt.Errorf("failed after %d attempts: %w", maxRetries, lastErr) +} + +// fetchPriceOnce fetches price once using Bitget REST API +func (b *BitgetSDKPriceFeed) fetchPriceOnce(ctx context.Context, symbol string) (*big.Float, error) { + // Build request URL + url := fmt.Sprintf("%s%s?symbol=%s", b.baseURL, bitgetTickerPath, symbol) + + // Create HTTP request + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("failed to create request: %w", err) + } + + // Set headers + req.Header.Set("Content-Type", "application/json") + + // Send request + resp, err := b.httpClient.Do(req) + if err != nil { + return nil, fmt.Errorf("HTTP request failed: %w", err) + } + defer resp.Body.Close() + + // Read response body + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %w", err) + } + + // Parse JSON response + var apiResp BitgetV2Response + if err := json.Unmarshal(body, &apiResp); err != nil { + return nil, fmt.Errorf("failed to parse JSON response: %w", err) + } + + // Check API response code + if apiResp.Code != "00000" { + return nil, fmt.Errorf("API error: %s - %s", apiResp.Code, apiResp.Msg) + } + + // Check if data exists + if len(apiResp.Data) == 0 { + return nil, fmt.Errorf("no data returned for symbol %s", symbol) + } + + // Parse price + lastPriceStr := apiResp.Data[0].LastPr + if lastPriceStr == "" { + return nil, fmt.Errorf("no price data returned for symbol %s", symbol) + } + + lastPrice, err := strconv.ParseFloat(lastPriceStr, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse price '%s': %w", lastPriceStr, err) + } + + b.log.Debug("Fetched price from Bitget API", + "symbol", symbol, + "price", lastPrice) + + return big.NewFloat(lastPrice), nil +} + +// UpdateTokenMap updates token mapping +// This method is safe to call concurrently with other methods +// The input map is copied to prevent external modifications +func (b *BitgetSDKPriceFeed) UpdateTokenMap(tokenMap map[uint16]string) { + b.mu.Lock() + // Create a defensive copy to prevent external modifications + copied := make(map[uint16]string, len(tokenMap)) + for k, v := range tokenMap { + copied[k] = v + } + b.tokenMap = copied + b.mu.Unlock() + b.log.Info("Updated token map", "token_map", copied) +} + +// GetSupportedTokens returns list of supported token IDs +func (b *BitgetSDKPriceFeed) GetSupportedTokens() []uint16 { + b.mu.RLock() + tokenIDs := make([]uint16, 0, len(b.tokenMap)) + for tokenID := range b.tokenMap { + tokenIDs = append(tokenIDs, tokenID) + } + b.mu.RUnlock() + return tokenIDs +} diff --git a/token-price-oracle/client/bitget_sdk_test.go b/token-price-oracle/client/bitget_sdk_test.go new file mode 100644 index 00000000..3b15fa44 --- /dev/null +++ b/token-price-oracle/client/bitget_sdk_test.go @@ -0,0 +1,34 @@ +package client + +import ( + "context" + "math/big" + "testing" + "time" +) + +// TestBitgetSDK_FetchETHPrice tests fetching ETH price using official Bitget SDK +func TestBitgetSDK_FetchETHPrice(t *testing.T) { + feed := NewBitgetSDKPriceFeed(map[uint16]string{ + 1: "ETHUSDT", + }) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + + // Test fetching ETH price directly + price, err := feed.fetchPrice(ctx, "ETHUSDT") + if err != nil { + t.Fatalf("Failed to fetch ETH price: %v", err) + } + + if price == nil { + t.Fatal("Price is nil") + } + + if price.Cmp(big.NewFloat(0)) <= 0 { + t.Errorf("Expected positive price, got %v", price) + } + + t.Logf("ETH Price: %v USDT", price) +} diff --git a/token-price-oracle/client/l2_client.go b/token-price-oracle/client/l2_client.go new file mode 100644 index 00000000..25b1b7f6 --- /dev/null +++ b/token-price-oracle/client/l2_client.go @@ -0,0 +1,100 @@ +package client + +import ( + "context" + "fmt" + "math/big" + + "github.com/morph-l2/go-ethereum/accounts/abi/bind" + "github.com/morph-l2/go-ethereum/common" + "github.com/morph-l2/go-ethereum/crypto" + "github.com/morph-l2/go-ethereum/ethclient" +) + +// L2Client wraps L2 chain client +type L2Client struct { + client *ethclient.Client + chainID *big.Int + opts *bind.TransactOpts +} + +// NewL2Client creates new L2 client +func NewL2Client(rpcURL string, privateKey string) (*L2Client, error) { + client, err := ethclient.Dial(rpcURL) + if err != nil { + return nil, fmt.Errorf("failed to dial L2 RPC: %w", err) + } + + // Ensure client is closed if any subsequent step fails + defer func() { + if err != nil { + client.Close() + } + }() + + // Get chain ID + chainID, err := client.ChainID(context.Background()) + if err != nil { + return nil, fmt.Errorf("failed to get chain ID: %w", err) + } + + // Parse private key (remove 0x prefix if present) + privateKeyHex := privateKey + if len(privateKey) > 2 && privateKey[:2] == "0x" { + privateKeyHex = privateKey[2:] + } + key, err := crypto.HexToECDSA(privateKeyHex) + if err != nil { + return nil, fmt.Errorf("failed to parse private key: %w", err) + } + + // Create transaction options + opts, err := bind.NewKeyedTransactorWithChainID(key, chainID) + if err != nil { + return nil, fmt.Errorf("failed to create transactor: %w", err) + } + + return &L2Client{ + client: client, + chainID: chainID, + opts: opts, + }, nil +} + +// Close closes client connection +func (c *L2Client) Close() { + c.client.Close() +} + +// GetClient returns the underlying ethclient +func (c *L2Client) GetClient() *ethclient.Client { + return c.client +} + +// GetOpts returns a copy of transaction options +// Returns a new instance to prevent concurrent modification +func (c *L2Client) GetOpts() *bind.TransactOpts { + // Return a copy to prevent shared state issues + return &bind.TransactOpts{ + From: c.opts.From, + Nonce: c.opts.Nonce, + Signer: c.opts.Signer, + Value: c.opts.Value, + GasPrice: c.opts.GasPrice, + GasFeeCap: c.opts.GasFeeCap, + GasTipCap: c.opts.GasTipCap, + GasLimit: c.opts.GasLimit, + Context: c.opts.Context, + NoSend: c.opts.NoSend, + } +} + +// GetBalance returns account balance +func (c *L2Client) GetBalance(ctx context.Context, address common.Address) (*big.Int, error) { + return c.client.BalanceAt(ctx, address, nil) +} + +// WalletAddress returns wallet address +func (c *L2Client) WalletAddress() common.Address { + return c.opts.From +} diff --git a/token-price-oracle/client/price_feed.go b/token-price-oracle/client/price_feed.go new file mode 100644 index 00000000..b689f34e --- /dev/null +++ b/token-price-oracle/client/price_feed.go @@ -0,0 +1,137 @@ +package client + +import ( + "context" + "fmt" + "math/big" + + "github.com/morph-l2/go-ethereum/log" +) + +// TokenPrice represents token price information +type TokenPrice struct { + TokenID uint16 + Symbol string + TokenPriceUSD *big.Float // Token price in USD + EthPriceUSD *big.Float // ETH price in USD (for reference) +} + +// PriceFeed represents a price feed interface +type PriceFeed interface { + // GetTokenPrice returns token price in USD + GetTokenPrice(ctx context.Context, tokenID uint16) (*TokenPrice, error) + + // GetBatchTokenPrices returns token prices in USD for multiple tokens + GetBatchTokenPrices(ctx context.Context, tokenIDs []uint16) (map[uint16]*TokenPrice, error) +} + +// FallbackPriceFeed implements fallback mechanism for multiple price feeds +type FallbackPriceFeed struct { + feeds []PriceFeed + names []string // Feed names for logging + log log.Logger +} + +// NewFallbackPriceFeed creates a price feed with fallback support +// feeds: price feeds in priority order (first = highest priority) +// names: corresponding names for logging +func NewFallbackPriceFeed(feeds []PriceFeed, names []string) *FallbackPriceFeed { + return &FallbackPriceFeed{ + feeds: feeds, + names: names, + log: log.New("component", "fallback_price_feed"), + } +} + +// GetTokenPrice tries to get token price from feeds in priority order +func (f *FallbackPriceFeed) GetTokenPrice(ctx context.Context, tokenID uint16) (*TokenPrice, error) { + var lastErr error + + for i, feed := range f.feeds { + feedName := "unknown" + if i < len(f.names) { + feedName = f.names[i] + } + + price, err := feed.GetTokenPrice(ctx, tokenID) + if err == nil { + // Validate returned price to prevent nil pointer panics + if price == nil || price.TokenPriceUSD == nil || price.EthPriceUSD == nil { + f.log.Warn("Feed returned nil price or components, treating as failure", + "token_id", tokenID, + "feed", feedName, + "priority", i) + lastErr = fmt.Errorf("feed %s returned incomplete price for token %d", feedName, tokenID) + continue + } + + f.log.Info("Successfully fetched price from feed", + "source", feedName, + "token_id", tokenID, + "symbol", price.Symbol, + "priority", i, + "token_price_usd", price.TokenPriceUSD.String(), + "eth_price_usd", price.EthPriceUSD.String()) + return price, nil + } + + f.log.Warn("Failed to fetch price from feed, trying next", + "token_id", tokenID, + "feed", feedName, + "priority", i, + "error", err.Error()) + lastErr = err + } + + return nil, lastErr +} + +// GetBatchTokenPrices tries to get batch token prices from feeds in priority order +func (f *FallbackPriceFeed) GetBatchTokenPrices(ctx context.Context, tokenIDs []uint16) (map[uint16]*TokenPrice, error) { + var lastErr error + + for i, feed := range f.feeds { + feedName := "unknown" + if i < len(f.names) { + feedName = f.names[i] + } + + prices, err := feed.GetBatchTokenPrices(ctx, tokenIDs) + if err == nil { + // Validate all returned prices to prevent nil pointer panics + hasInvalidPrice := false + for tokenID, price := range prices { + if price == nil || price.TokenPriceUSD == nil || price.EthPriceUSD == nil { + f.log.Warn("Feed returned nil price or components for token, treating as failure", + "token_id", tokenID, + "feed", feedName, + "priority", i) + hasInvalidPrice = true + break + } + } + + if hasInvalidPrice { + lastErr = fmt.Errorf("feed %s returned incomplete prices", feedName) + continue + } + + f.log.Info("Successfully fetched batch prices from feed", + "token_count", len(prices), + "requested_count", len(tokenIDs), + "feed", feedName, + "priority", i) + return prices, nil + } + + f.log.Warn("Failed to fetch batch prices from feed, trying next", + "token_count", len(tokenIDs), + "feed", feedName, + "priority", i, + "error", err.Error()) + lastErr = err + } + + return nil, lastErr +} + diff --git a/token-price-oracle/cmd/main.go b/token-price-oracle/cmd/main.go new file mode 100644 index 00000000..f5cf155a --- /dev/null +++ b/token-price-oracle/cmd/main.go @@ -0,0 +1,155 @@ +package main + +import ( + "context" + "fmt" + "io" + "os" + "os/signal" + "path/filepath" + "syscall" + "time" + + "github.com/morph-l2/go-ethereum/log" + "github.com/urfave/cli" + "gopkg.in/natefinch/lumberjack.v2" + "morph-l2/token-price-oracle/client" + "morph-l2/token-price-oracle/config" + "morph-l2/token-price-oracle/flags" + "morph-l2/token-price-oracle/metrics" + "morph-l2/token-price-oracle/updater" +) + +var ( + GitVersion = "" + GitCommit = "" + GitDate = "" +) + +func main() { + app := cli.NewApp() + app.Flags = flags.Flags + app.Version = fmt.Sprintf("%s-%s-%s", GitVersion, GitCommit, GitDate) + app.Name = "token-price-oracle" + app.Usage = "Gas Price Oracle Service" + app.Description = "Service for monitoring L1 gas prices and updating L2 GasPriceOracle contract" + app.Action = Main + + if err := app.Run(os.Args); err != nil { + log.Crit("Application failed", "err", err) + } +} + +func Main(cliCtx *cli.Context) error { + // Load configuration + cfg, err := config.LoadConfig(cliCtx) + if err != nil { + return fmt.Errorf("failed to load config: %w", err) + } + + // Setup logging + var logHandler log.Handler + + output := io.Writer(os.Stderr) + if cfg.LogFilename != "" { + dir := filepath.Dir(cfg.LogFilename) // handles "dir/filename" correctly + if dir != "" && dir != "." { + if err := os.MkdirAll(dir, 0o755); err != nil { + return fmt.Errorf("create log directory %q failed: %v", dir, err) + } + } + f, err := os.OpenFile(cfg.LogFilename, os.O_CREATE|os.O_RDWR, os.FileMode(0600)) + if err != nil { + return fmt.Errorf("wrong log.filename set: %d", err) + } + f.Close() + + if cfg.LogFileMaxSize < 1 { + return fmt.Errorf("wrong log.maxsize set: %d", cfg.LogFileMaxSize) + } + + if cfg.LogFileMaxAge < 1 { + return fmt.Errorf("wrong log.maxage set: %d", cfg.LogFileMaxAge) + } + logFile := &lumberjack.Logger{ + Filename: cfg.LogFilename, + MaxSize: cfg.LogFileMaxSize, // megabytes + MaxAge: cfg.LogFileMaxAge, // days + Compress: cfg.LogCompress, + } + output = io.MultiWriter(output, logFile) + } + if cfg.LogTerminal { + logHandler = log.StreamHandler(os.Stdout, log.TerminalFormat(true)) + } else { + logHandler = log.StreamHandler(output, log.JSONFormat()) + } + logLevel, err := log.LvlFromString(cfg.LogLevel) + if err != nil { + return err + } + log.Root().SetHandler(log.LvlFilterHandler(logLevel, logHandler)) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // Initialize metrics if enabled + if cfg.MetricsServerEnable { + go func() { + if err := metrics.StartMetricsServer(cfg.MetricAddress()); err != nil { + log.Error("Metrics server failed", "err", err) + } + }() + log.Info("Metrics server started", "address", cfg.MetricAddress()) + } + + // Create L2 client + l2Client, err := client.NewL2Client(cfg.L2RPC, cfg.PrivateKey) + if err != nil { + return fmt.Errorf("failed to create L2 client: %w", err) + } + defer l2Client.Close() + + // Create transaction manager + txManager := updater.CreateTxManager(l2Client) + log.Info("Transaction manager initialized") + + priceUpdater, err := updater.CreatePriceUpdater(cfg, l2Client, txManager) + if err != nil { + return fmt.Errorf("failed to create price updater: %w", err) + } + + if priceUpdater == nil { + log.Warn("Price updater not created (no token IDs configured)") + } else { + log.Info("Price updater created", "updater", "price") + if err := priceUpdater.Start(ctx); err != nil { + return fmt.Errorf("failed to start updater: %w", err) + } + } + + // Wait for interrupt signal + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) + + select { + case <-sigCh: + log.Info("Received interrupt signal, shutting down...") + case <-ctx.Done(): + log.Info("Context cancelled, shutting down...") + } + + // Graceful shutdown + cancel() + + if priceUpdater != nil { + if err := priceUpdater.Stop(); err != nil { + log.Warn("Failed to stop updater", "error", err) + } + } + + time.Sleep(2 * time.Second) + + log.Info("Token price Oracle stopped") + return nil +} diff --git a/token-price-oracle/config/config.go b/token-price-oracle/config/config.go new file mode 100644 index 00000000..9420fbb7 --- /dev/null +++ b/token-price-oracle/config/config.go @@ -0,0 +1,217 @@ +package config + +import ( + "fmt" + "morph-l2/bindings/predeploys" + "strconv" + "strings" + "time" + + "github.com/morph-l2/go-ethereum/common" + "github.com/urfave/cli" + "morph-l2/token-price-oracle/flags" +) + +const ( + // MaxPriceThresholdBPS is the maximum allowed price threshold in basis points (100% = 10000 bps) + MaxPriceThresholdBPS = 10000 +) + +// PriceFeedType represents the type of price feed source +type PriceFeedType string + +const ( + PriceFeedTypeBitget PriceFeedType = "bitget" + PriceFeedTypeBinance PriceFeedType = "binance" +) + +// ValidPriceFeedTypes returns all valid price feed types +func ValidPriceFeedTypes() []PriceFeedType { + return []PriceFeedType{ + PriceFeedTypeBitget, + // PriceFeedTypeBinance, // TODO: Add back when Binance price feed is implemented + } +} + +// IsValidPriceFeedType checks if a string is a valid price feed type +func IsValidPriceFeedType(s string) bool { + feedType := PriceFeedType(s) + for _, valid := range ValidPriceFeedTypes() { + if feedType == valid { + return true + } + } + return false +} + +// String returns the string representation of PriceFeedType +func (p PriceFeedType) String() string { + return string(p) +} + +// Config contains all service configurations +type Config struct { + // RPC endpoints + L2RPC string + // Contract addresses + L2TokenRegistryAddr common.Address + // Private key + PrivateKey string + // Price update parameters + PriceUpdateInterval time.Duration // Price update interval + PriceThreshold uint64 // Price change threshold percentage to trigger update + PriceFeedPriority []PriceFeedType // Price feed types in priority order (fallback mechanism) + TokenMappings map[PriceFeedType]map[uint16]string // Token ID to trading pair mappings for each price feed type + BitgetAPIBaseURL string // Bitget API base URL + BinanceAPIBaseURL string // Binance API base URL + + // Metrics + MetricsServerEnable bool + MetricsHostname string + MetricsPort uint64 + + // Logging + LogLevel string + LogTerminal bool + LogFilename string + LogFileMaxSize int + LogFileMaxAge int + LogCompress bool +} + +// LoadConfig loads configuration from cli.Context +func LoadConfig(ctx *cli.Context) (*Config, error) { + cfg := &Config{ + L2RPC: ctx.String(flags.L2EthRPCFlag.Name), + PrivateKey: ctx.String(flags.PrivateKeyFlag.Name), + + MetricsServerEnable: ctx.Bool(flags.MetricsServerEnableFlag.Name), + MetricsHostname: ctx.String(flags.MetricsHostnameFlag.Name), + MetricsPort: ctx.Uint64(flags.MetricsPortFlag.Name), + + LogLevel: ctx.String(flags.LogLevelFlag.Name), + LogFilename: ctx.String(flags.LogFilenameFlag.Name), + LogFileMaxSize: ctx.Int(flags.LogFileMaxSizeFlag.Name), + LogFileMaxAge: ctx.Int(flags.LogFileMaxAgeFlag.Name), + LogCompress: ctx.Bool(flags.LogCompressFlag.Name), + } + + // Parse token registry address (optional) + cfg.L2TokenRegistryAddr = predeploys.L2TokenRegistryAddr + + // Parse price update interval + cfg.PriceUpdateInterval = ctx.Duration(flags.PriceUpdateIntervalFlag.Name) + + cfg.PriceThreshold = ctx.Uint64(flags.PriceThresholdFlag.Name) + + // Validate price threshold is reasonable (basis points should be 0-MaxPriceThresholdBPS) + if cfg.PriceThreshold > MaxPriceThresholdBPS { + return nil, fmt.Errorf("price threshold %d is too large (should be 0-%d basis points, where %d bps = 100%%)", + cfg.PriceThreshold, MaxPriceThresholdBPS, MaxPriceThresholdBPS) + } + + // Parse and validate price feed priority list + priorityStr := ctx.String(flags.PriceFeedPriorityFlag.Name) + if priorityStr == "" { + return nil, fmt.Errorf("price feed priority list cannot be empty") + } + + priorityParts := strings.Split(priorityStr, ",") + cfg.PriceFeedPriority = make([]PriceFeedType, 0, len(priorityParts)) + seenTypes := make(map[PriceFeedType]bool) + + for _, part := range priorityParts { + part = strings.TrimSpace(part) + if part == "" { + continue + } + if !IsValidPriceFeedType(part) { + validTypes := make([]string, len(ValidPriceFeedTypes())) + for i, t := range ValidPriceFeedTypes() { + validTypes[i] = t.String() + } + return nil, fmt.Errorf("invalid price feed type '%s' in priority list (must be one of: %s)", part, strings.Join(validTypes, ", ")) + } + feedType := PriceFeedType(part) + if seenTypes[feedType] { + return nil, fmt.Errorf("duplicate price feed type '%s' in priority list", part) + } + seenTypes[feedType] = true + cfg.PriceFeedPriority = append(cfg.PriceFeedPriority, feedType) + } + + if len(cfg.PriceFeedPriority) == 0 { + return nil, fmt.Errorf("price feed priority list cannot be empty after parsing") + } + + // Helper function to parse token mapping + parseTokenMapping := func(mappingStr string) (map[uint16]string, error) { + mapping := make(map[uint16]string) + if mappingStr == "" { + return mapping, nil + } + pairs := strings.Split(mappingStr, ",") + for _, pair := range pairs { + pair = strings.TrimSpace(pair) + if pair == "" { + continue + } + parts := strings.Split(pair, ":") + if len(parts) != 2 { + return nil, fmt.Errorf("invalid token mapping pair '%s' (expected format: tokenID:symbol)", pair) + } + tokenID, err := strconv.ParseUint(strings.TrimSpace(parts[0]), 10, 16) + if err != nil { + return nil, fmt.Errorf("invalid token ID in mapping '%s': %w", parts[0], err) + } + symbol := strings.TrimSpace(parts[1]) + mapping[uint16(tokenID)] = symbol + } + return mapping, nil + } + + // Parse all token mappings for different price feed types + cfg.TokenMappings = make(map[PriceFeedType]map[uint16]string) + + bitgetMapping, err := parseTokenMapping(ctx.String(flags.TokenMappingBitgetFlag.Name)) + if err != nil { + return nil, fmt.Errorf("failed to parse bitget token mapping: %w", err) + } + if len(bitgetMapping) > 0 { + cfg.TokenMappings[PriceFeedTypeBitget] = bitgetMapping + } + + binanceMapping, err := parseTokenMapping(ctx.String(flags.TokenMappingBinanceFlag.Name)) + if err != nil { + return nil, fmt.Errorf("failed to parse binance token mapping: %w", err) + } + if len(binanceMapping) > 0 { + cfg.TokenMappings[PriceFeedTypeBinance] = binanceMapping + } + + // Parse API base URLs + cfg.BitgetAPIBaseURL = ctx.String(flags.BitgetAPIBaseURLFlag.Name) + cfg.BinanceAPIBaseURL = ctx.String(flags.BinanceAPIBaseURLFlag.Name) + + // Validate API URLs for configured feeds (non-empty check only) + for _, feedType := range cfg.PriceFeedPriority { + switch feedType { + case PriceFeedTypeBitget: + if cfg.BitgetAPIBaseURL == "" { + return nil, fmt.Errorf("bitget feed is configured but --bitget-api-base-url is not set") + } + + case PriceFeedTypeBinance: + if cfg.BinanceAPIBaseURL == "" { + return nil, fmt.Errorf("binance feed is configured but --binance-api-base-url is not set") + } + } + } + + return cfg, nil +} + +// MetricAddress returns the metrics server address +func (c *Config) MetricAddress() string { + return fmt.Sprintf("%s:%d", c.MetricsHostname, c.MetricsPort) +} diff --git a/token-price-oracle/docker-compose.yml b/token-price-oracle/docker-compose.yml new file mode 100644 index 00000000..389f0945 --- /dev/null +++ b/token-price-oracle/docker-compose.yml @@ -0,0 +1,51 @@ +version: '3.8' + +services: + token-price-oracle: + build: + context: . + dockerfile: Dockerfile + container_name: morph-token-price-oracle + restart: unless-stopped + environment: + # L2 RPC endpoint + TOKEN_PRICE_ORACLE_L2_ETH_RPC: ${TOKEN_PRICE_ORACLE_L2_ETH_RPC:-http://host.docker.internal:8545} + + # Private key for signing transactions + TOKEN_PRICE_ORACLE_PRIVATE_KEY: ${TOKEN_PRICE_ORACLE_PRIVATE_KEY} + + # Price update configuration + TOKEN_PRICE_ORACLE_PRICE_UPDATE_INTERVAL: ${TOKEN_PRICE_ORACLE_PRICE_UPDATE_INTERVAL:-30s} + TOKEN_PRICE_ORACLE_PRICE_THRESHOLD: ${TOKEN_PRICE_ORACLE_PRICE_THRESHOLD:-5} # percentage (%) + + # Price feed configuration + TOKEN_PRICE_ORACLE_PRICE_FEED_PRIORITY: ${TOKEN_PRICE_ORACLE_PRICE_FEED_PRIORITY:-bitget} + TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BITGET: ${TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BITGET} + TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BINANCE: ${TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BINANCE} + + # Token IDs to monitor (optional, will fetch from contract if not set) + TOKEN_PRICE_ORACLE_TOKEN_IDS: ${TOKEN_PRICE_ORACLE_TOKEN_IDS} + + # Metrics server + TOKEN_PRICE_ORACLE_METRICS_SERVER_ENABLE: ${TOKEN_PRICE_ORACLE_METRICS_SERVER_ENABLE:-true} + TOKEN_PRICE_ORACLE_METRICS_HOSTNAME: ${TOKEN_PRICE_ORACLE_METRICS_HOSTNAME:-0.0.0.0} + TOKEN_PRICE_ORACLE_METRICS_PORT: ${TOKEN_PRICE_ORACLE_METRICS_PORT:-6060} + + # Logging + TOKEN_PRICE_ORACLE_LOG_LEVEL: ${TOKEN_PRICE_ORACLE_LOG_LEVEL:-info} + ports: + - "${METRICS_PORT:-6060}:6060" # Metrics endpoint + volumes: + - oracle-logs:/data/logs/morph-gas-oracle + networks: + - morph-network + extra_hosts: + - "host.docker.internal:host-gateway" + +volumes: + oracle-logs: + driver: local + +networks: + morph-network: + driver: bridge diff --git a/token-price-oracle/env.example b/token-price-oracle/env.example new file mode 100644 index 00000000..ec081737 --- /dev/null +++ b/token-price-oracle/env.example @@ -0,0 +1,41 @@ +# Token Price Oracle Configuration Example +# Copy this file to .env and fill in your values + +# L2 RPC endpoint +TOKEN_PRICE_ORACLE_L2_ETH_RPC=http://localhost:8545 + +# L2 Token Registry contract address +TOKEN_PRICE_ORACLE_L2_TOKEN_REGISTRY_ADDRESS=0x5300000000000000000000000000000000000021 + +# Private key for signing transactions (without 0x prefix in env var) +TOKEN_PRICE_ORACLE_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + +# Price update configuration +TOKEN_PRICE_ORACLE_PRICE_UPDATE_INTERVAL=30s +TOKEN_PRICE_ORACLE_PRICE_THRESHOLD=100 # basis points (bps), e.g. 100 means 1% (100 bps), 10 means 0.1%, 1 means 0.01% + +# Price feed priority (comma-separated: bitget,binance) +TOKEN_PRICE_ORACLE_PRICE_FEED_PRIORITY=bitget + +# Token mapping for Bitget (tokenID:tradingPair,tokenID:tradingPair) +TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BITGET=1:BGBUSDT,2:BTCUSDT + +# Token mapping for Binance (optional) +# TOKEN_PRICE_ORACLE_TOKEN_MAPPING_BINANCE=1:BGBUSDT,2:BTCUSDT + +# API base URLs (optional, defaults provided) +TOKEN_PRICE_ORACLE_BITGET_API_BASE_URL=https://api.bitget.com +# TOKEN_PRICE_ORACLE_BINANCE_API_BASE_URL=https://api.binance.com + +# Token IDs to monitor (optional, will fetch from contract if not set) +TOKEN_PRICE_ORACLE_TOKEN_IDS=1,2 + +# Metrics server configuration +TOKEN_PRICE_ORACLE_METRICS_SERVER_ENABLE=true +TOKEN_PRICE_ORACLE_METRICS_HOSTNAME=0.0.0.0 +TOKEN_PRICE_ORACLE_METRICS_PORT=6060 + +# Logging +TOKEN_PRICE_ORACLE_LOG_LEVEL=info + + diff --git a/token-price-oracle/flags/flags.go b/token-price-oracle/flags/flags.go new file mode 100644 index 00000000..5cd59853 --- /dev/null +++ b/token-price-oracle/flags/flags.go @@ -0,0 +1,172 @@ +package flags + +import ( + "time" + + "github.com/urfave/cli" +) + +const envVarPrefix = "TOKEN_PRICE_ORACLE_" + +func prefixEnvVar(name string) string { + return envVarPrefix + name +} + +var ( + /* Required Flags */ + L2EthRPCFlag = cli.StringFlag{ + Name: "l2-eth-rpc", + Usage: "HTTP provider URL for L2", + Required: true, + EnvVar: prefixEnvVar("L2_ETH_RPC"), + } + + PrivateKeyFlag = cli.StringFlag{ + Name: "private-key", + Usage: "The private key to use for sending transactions to L2", + Required: true, + EnvVar: prefixEnvVar("PRIVATE_KEY"), + } + + /* Optional Flags */ + + TxnPerBatchFlag = cli.Uint64Flag{ + Name: "txn-per-batch", + Usage: "Expected transactions per batch", + Value: 50, + EnvVar: prefixEnvVar("TXN_PER_BATCH"), + } + + PriceUpdateIntervalFlag = cli.DurationFlag{ + Name: "price-update-interval", + Usage: "Token price update interval", + Value: 60 * time.Second, + EnvVar: prefixEnvVar("PRICE_UPDATE_INTERVAL"), + } + + PriceThresholdFlag = cli.Uint64Flag{ + Name: "price-threshold", + Usage: "Price change threshold in basis points (bps) to trigger update (e.g. 100 for 1%, 10 for 0.1%, 1 for 0.01%)", + Value: 0, + EnvVar: prefixEnvVar("PRICE_THRESHOLD"), + } + + PriceFeedPriorityFlag = cli.StringFlag{ + Name: "price-feed-priority", + Usage: "Comma-separated list of price feed types in priority order (e.g. \"bitget,binance\")", + Value: "bitget", + EnvVar: prefixEnvVar("PRICE_FEED_PRIORITY"), + } + + TokenMappingBitgetFlag = cli.StringFlag{ + Name: "token-mapping-bitget", + Usage: "Token ID to Bitget trading pair mapping (e.g. \"1:BTCUSDT,2:ETHUSDT\")", + Value: "", + EnvVar: prefixEnvVar("TOKEN_MAPPING_BITGET"), + } + + TokenMappingBinanceFlag = cli.StringFlag{ + Name: "token-mapping-binance", + Usage: "Token ID to Binance trading pair mapping (e.g. \"1:BTCUSDT,2:ETHUSDT\")", + Value: "", + EnvVar: prefixEnvVar("TOKEN_MAPPING_BINANCE"), + } + + BitgetAPIBaseURLFlag = cli.StringFlag{ + Name: "bitget-api-base-url", + Usage: "Bitget API base URL (required if bitget feed is enabled)", + Value: "", + EnvVar: prefixEnvVar("BITGET_API_BASE_URL"), + } + + BinanceAPIBaseURLFlag = cli.StringFlag{ + Name: "binance-api-base-url", + Usage: "Binance API base URL (required if binance feed is enabled)", + Value: "", + EnvVar: prefixEnvVar("BINANCE_API_BASE_URL"), + } + + // Logging flags + LogLevelFlag = cli.StringFlag{ + Name: "log-level", + Usage: "The lowest log level that will be output", + Value: "info", + EnvVar: prefixEnvVar("LOG_LEVEL"), + } + + LogFilenameFlag = cli.StringFlag{ + Name: "log-filename", + Usage: "The target file for writing logs", + EnvVar: prefixEnvVar("LOG_FILENAME"), + } + + LogFileMaxSizeFlag = cli.IntFlag{ + Name: "log-file-max-size", + Usage: "The maximum size in megabytes of the log file before it gets rotated", + Value: 100, + EnvVar: prefixEnvVar("LOG_FILE_MAX_SIZE"), + } + + LogFileMaxAgeFlag = cli.IntFlag{ + Name: "log-file-max-age", + Usage: "The maximum number of days to retain old log files", + Value: 30, + EnvVar: prefixEnvVar("LOG_FILE_MAX_AGE"), + } + + LogCompressFlag = cli.BoolFlag{ + Name: "log-compress", + Usage: "Whether to compress rotated log files using gzip", + EnvVar: prefixEnvVar("LOG_COMPRESS"), + } + + // Metrics flags + MetricsServerEnableFlag = cli.BoolFlag{ + Name: "metrics-server-enable", + Usage: "Whether or not to run the embedded metrics server", + EnvVar: prefixEnvVar("METRICS_SERVER_ENABLE"), + } + + MetricsHostnameFlag = cli.StringFlag{ + Name: "metrics-hostname", + Usage: "The hostname of the metrics server", + Value: "0.0.0.0", + EnvVar: prefixEnvVar("METRICS_HOSTNAME"), + } + + MetricsPortFlag = cli.Uint64Flag{ + Name: "metrics-port", + Usage: "The port of the metrics server", + Value: 6060, + EnvVar: prefixEnvVar("METRICS_PORT"), + } +) + +var requiredFlags = []cli.Flag{ + L2EthRPCFlag, + PrivateKeyFlag, +} + +var optionalFlags = []cli.Flag{ + TxnPerBatchFlag, + PriceUpdateIntervalFlag, + PriceThresholdFlag, + PriceFeedPriorityFlag, + TokenMappingBitgetFlag, + TokenMappingBinanceFlag, + BitgetAPIBaseURLFlag, + BinanceAPIBaseURLFlag, + + LogLevelFlag, + LogFilenameFlag, + LogFileMaxSizeFlag, + LogFileMaxAgeFlag, + LogCompressFlag, + + MetricsServerEnableFlag, + MetricsHostnameFlag, + MetricsPortFlag, +} + +// Flags contains the list of configuration options available to the binary. +var Flags = append(requiredFlags, optionalFlags...) diff --git a/token-price-oracle/go.mod b/token-price-oracle/go.mod new file mode 100644 index 00000000..5ae5e7aa --- /dev/null +++ b/token-price-oracle/go.mod @@ -0,0 +1,88 @@ +module morph-l2/token-price-oracle + +go 1.24.0 + +replace ( + github.com/VictoriaMetrics/fastcache => github.com/VictoriaMetrics/fastcache v1.12.2 + golang.org/x/sys => golang.org/x/sys v0.30.0 +) + +require ( + github.com/morph-l2/go-ethereum v1.10.14-0.20251125061742-69718a9dcab9 + github.com/prometheus/client_golang v1.17.0 + github.com/sirupsen/logrus v1.9.3 + github.com/urfave/cli v1.22.17 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 +) + +require ( + github.com/VictoriaMetrics/fastcache v1.12.2 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bits-and-blooms/bitset v1.20.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/consensys/bavard v0.1.27 // indirect + github.com/consensys/gnark-crypto v0.16.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect + github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/deckarep/golang-set v1.8.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/edsrzf/mmap-go v1.1.0 // indirect + github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect + github.com/ethereum/go-ethereum v1.10.26 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect + github.com/go-kit/kit v0.12.0 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.1 // indirect + github.com/hashicorp/go-bexpr v0.1.13 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/holiman/uint256 v1.2.4 // indirect + github.com/huin/goupnp v1.3.0 // indirect + github.com/iden3/go-iden3-crypto v0.0.16 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/pointerstructure v1.2.1 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/tsdb v0.10.0 // indirect + github.com/rivo/uniseg v0.4.3 // indirect + github.com/rjeczalik/notify v0.9.3 // indirect + github.com/rs/cors v1.11.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/scroll-tech/zktrie v0.8.4 // indirect + github.com/shirou/gopsutil v3.21.11+incompatible // indirect + github.com/status-im/keycard-go v0.3.2 // indirect + github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect + github.com/tklauser/go-sysconf v0.3.13 // indirect + github.com/tklauser/numcpus v0.7.0 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/urfave/cli.v1 v1.20.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect +) diff --git a/token-price-oracle/go.sum b/token-price-oracle/go.sum new file mode 100644 index 00000000..71897b87 --- /dev/null +++ b/token-price-oracle/go.sum @@ -0,0 +1,315 @@ +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +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/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= +github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E= +github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAhOs= +github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= +github.com/consensys/gnark-crypto v0.16.0 h1:8Dl4eYmUWK9WmlP1Bj6je688gBRJCJbT8Mw4KoTAawo= +github.com/consensys/gnark-crypto v0.16.0/go.mod h1:Ke3j06ndtPTVvo++PhGNgvm+lgpLvzbcE2MqljY7diU= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= +github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= +github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= +github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= +github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= +github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= +github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/hashicorp/go-bexpr v0.1.13 h1:HNwp7vZrMpRq8VZXj8VF90LbZpRjQQpim1oJF0DgSwg= +github.com/hashicorp/go-bexpr v0.1.13/go.mod h1:gN7hRKB3s7yT+YvTdnhZVLTENejvhlkZ8UE4YVBS+Q8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk= +github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4= +github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= +github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morph-l2/go-ethereum v1.10.14-0.20251125061742-69718a9dcab9 h1:IiOGoNPhICkQdLjwodT5lp4Vd9Zzfwl6cyk+HPwAeyA= +github.com/morph-l2/go-ethereum v1.10.14-0.20251125061742-69718a9dcab9/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= +github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= +github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= +github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE= +github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/status-im/keycard-go v0.3.2 h1:YusIF/bHx6YZis8UTOJrpZFnTs4IkRBdmJXqdiXkpFE= +github.com/status-im/keycard-go v0.3.2/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/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/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +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= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw= +github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= +github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= +github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= +github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= +github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +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.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +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= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/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.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/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.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/token-price-oracle/local.sh b/token-price-oracle/local.sh new file mode 100644 index 00000000..8de108da --- /dev/null +++ b/token-price-oracle/local.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Local development startup script for token-price-oracle + +./build/bin/token-price-oracle \ + --l2-eth-rpc http://localhost:8545 \ + --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + --price-update-interval 30s \ + --price-threshold 100 \ + --price-feed-priority bitget \ + --token-mapping-bitget "1:BGBUSDT,2:BTCUSDT" \ + --bitget-api-base-url https://api.bitget.com \ + --log-level info \ + --metrics-server-enable + +# Price threshold examples (in basis points): +# 1 bps = 0.01%, 10 bps = 0.1%, 100 bps = 1%, 500 bps = 5%, 1000 bps = 10% + diff --git a/token-price-oracle/metrics/metrics.go b/token-price-oracle/metrics/metrics.go new file mode 100644 index 00000000..4f42c415 --- /dev/null +++ b/token-price-oracle/metrics/metrics.go @@ -0,0 +1,49 @@ +package metrics + +import ( + "net/http" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/sirupsen/logrus" +) + +var ( + // UpdateErrors update error count + UpdateErrors = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "update_errors_total", + Help: "Total number of update errors", + }, + []string{"type"}, // error type: basefee, scalar, price + ) + + // AccountBalance tracks account balance in ETH + AccountBalance = prometheus.NewGauge( + prometheus.GaugeOpts{ + Name: "account_balance_eth", + Help: "Account balance in ETH", + }, + ) +) + +// init registers all metrics +func init() { + prometheus.MustRegister(UpdateErrors) + prometheus.MustRegister(AccountBalance) +} + +// StartMetricsServer starts metrics HTTP server +func StartMetricsServer(address string) error { + logrus.WithField("address", address).Info("Starting metrics server") + + http.Handle("/metrics", promhttp.Handler()) + + // Health check endpoint + http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Write([]byte("OK")) + }) + + return http.ListenAndServe(address, nil) +} diff --git a/token-price-oracle/updater/factory.go b/token-price-oracle/updater/factory.go new file mode 100644 index 00000000..18a54c20 --- /dev/null +++ b/token-price-oracle/updater/factory.go @@ -0,0 +1,134 @@ +package updater + +import ( + "fmt" + + "github.com/morph-l2/go-ethereum/common" + "github.com/morph-l2/go-ethereum/log" + "morph-l2/bindings/bindings" + "morph-l2/token-price-oracle/client" + "morph-l2/token-price-oracle/config" +) + +// CreatePriceUpdater creates price updater if conditions are met +func CreatePriceUpdater( + cfg *config.Config, + l2Client *client.L2Client, + txManager *TxManager, +) (*PriceUpdater, error) { + if cfg.L2TokenRegistryAddr == (common.Address{}) { + return nil, fmt.Errorf("price update enabled but token registry address not set") + } + + // Create registry contract + registryContract, err := bindings.NewL2TokenRegistry(cfg.L2TokenRegistryAddr, l2Client.GetClient()) + if err != nil { + return nil, fmt.Errorf("failed to create TokenRegistry contract: %w", err) + } + log.Info("TokenRegistry contract bound", "address", cfg.L2TokenRegistryAddr.Hex()) + + // Create price feeds with fallback support + priceFeed, err := createFallbackPriceFeed(cfg) + if err != nil { + return nil, fmt.Errorf("failed to create price feed: %w", err) + } + + // Collect all token mappings from configured feeds + allTokenMappings := make(map[uint16]string) + for _, feedType := range cfg.PriceFeedPriority { + if mapping, exists := cfg.TokenMappings[feedType]; exists { + for tokenID, symbol := range mapping { + // Use first mapping found (highest priority) + if _, alreadyMapped := allTokenMappings[tokenID]; !alreadyMapped { + allTokenMappings[tokenID] = symbol + } + } + } + } + + // Create price updater + priceUpdater := NewPriceUpdater( + l2Client, + registryContract, + priceFeed, + txManager, + allTokenMappings, + cfg.PriceUpdateInterval, + cfg.PriceThreshold, + ) + + log.Info("Price updater configured", + "price_feed_priority", cfg.PriceFeedPriority, + "token_mappings", allTokenMappings, + "interval", cfg.PriceUpdateInterval, + "threshold", cfg.PriceThreshold) + + return priceUpdater, nil +} + +// createFallbackPriceFeed creates price feed with fallback support +func createFallbackPriceFeed(cfg *config.Config) (client.PriceFeed, error) { + if len(cfg.PriceFeedPriority) == 0 { + return nil, fmt.Errorf("no price feeds configured in priority list") + } + + var feeds []client.PriceFeed + var feedNames []string + + for _, feedType := range cfg.PriceFeedPriority { + feed, name, err := createSinglePriceFeed(feedType, cfg) + if err != nil { + log.Warn("Failed to create price feed, skipping", + "feed_type", feedType, + "error", err.Error()) + continue + } + feeds = append(feeds, feed) + feedNames = append(feedNames, name) + } + + if len(feeds) == 0 { + return nil, fmt.Errorf("no valid price feeds could be created") + } + + if len(feeds) == 1 { + log.Info("Single price feed configured (no fallback)", "feed", feedNames[0]) + return feeds[0], nil + } + + log.Info("Fallback price feed configured with multiple sources", + "feeds", feedNames, + "priority", "first to last") + + return client.NewFallbackPriceFeed(feeds, feedNames), nil +} + +// createSinglePriceFeed creates a single price feed instance +func createSinglePriceFeed(feedType config.PriceFeedType, cfg *config.Config) (client.PriceFeed, string, error) { + switch feedType { + case config.PriceFeedTypeBitget: + mapping, exists := cfg.TokenMappings[config.PriceFeedTypeBitget] + if !exists || len(mapping) == 0 { + return nil, "", fmt.Errorf("bitget price feed requires token mapping, please configure --token-mapping-bitget") + } + feed := client.NewBitgetSDKPriceFeed(mapping, cfg.BitgetAPIBaseURL) + log.Info("Bitget price feed created", + "type", "bitget", + "base_url", cfg.BitgetAPIBaseURL, + "mapping", mapping) + return feed, "bitget", nil + + case config.PriceFeedTypeBinance: + // Binance price feed is not yet implemented + // This case should not be reached since Binance is not in ValidPriceFeedTypes + return nil, "", fmt.Errorf("binance price feed is not supported yet") + + default: + return nil, "", fmt.Errorf("unsupported price feed type: %s", feedType) + } +} + +// CreateTxManager creates transaction manager +func CreateTxManager(l2Client *client.L2Client) *TxManager { + return NewTxManager(l2Client) +} diff --git a/token-price-oracle/updater/token_price.go b/token-price-oracle/updater/token_price.go new file mode 100644 index 00000000..2f55d431 --- /dev/null +++ b/token-price-oracle/updater/token_price.go @@ -0,0 +1,397 @@ +package updater + +import ( + "context" + "fmt" + "math/big" + "sync" + "time" + + "github.com/morph-l2/go-ethereum/accounts/abi/bind" + "github.com/morph-l2/go-ethereum/core/types" + "github.com/morph-l2/go-ethereum/log" + "morph-l2/bindings/bindings" + "morph-l2/token-price-oracle/client" + "morph-l2/token-price-oracle/config" + "morph-l2/token-price-oracle/metrics" +) + +// PriceUpdater handles token price updates +type PriceUpdater struct { + l2Client *client.L2Client + registryContract *bindings.L2TokenRegistry + priceFeed client.PriceFeed + txManager *TxManager + tokenMapping map[uint16]string // tokenID -> trading pair (e.g. 1 -> "BTCUSDT") + interval time.Duration + priceThreshold uint64 + stopChan chan struct{} + stopOnce sync.Once // ensures stopChan is closed only once +} + +// NewPriceUpdater creates a new price updater +func NewPriceUpdater( + l2Client *client.L2Client, + registryContract *bindings.L2TokenRegistry, + priceFeed client.PriceFeed, + txManager *TxManager, + tokenMapping map[uint16]string, + interval time.Duration, + priceThreshold uint64, +) *PriceUpdater { + return &PriceUpdater{ + l2Client: l2Client, + registryContract: registryContract, + priceFeed: priceFeed, + txManager: txManager, + tokenMapping: tokenMapping, + interval: interval, + priceThreshold: priceThreshold, + stopChan: make(chan struct{}), + } +} + +// Start starts the price updater +func (u *PriceUpdater) Start(ctx context.Context) error { + go func() { + log.Info("Price updater starting", "interval", u.interval) + ticker := time.NewTicker(u.interval) + defer ticker.Stop() + + if err := u.update(ctx); err != nil { + log.Error("Initial price update failed") + } + + for { + select { + case <-ctx.Done(): + log.Info("Price updater stopped by context") + return + case <-u.stopChan: + log.Info("Price updater stopped") + return + case <-ticker.C: + if err := u.update(ctx); err != nil { + log.Error("Failed to update prices") + metrics.UpdateErrors.WithLabelValues("price").Inc() + } + } + } + }() + return nil +} + +// Stop gracefully stops the updater +// This method is safe to call multiple times +func (u *PriceUpdater) Stop() error { + u.stopOnce.Do(func() { + close(u.stopChan) + log.Info("Price updater stop requested") + }) + return nil +} + +// update performs one price update +func (u *PriceUpdater) update(ctx context.Context) error { + defer func() { + if err := u.updateBalanceMetrics(ctx); err != nil { + log.Warn("Failed to update balance metrics", "error", err) + } + }() + + // Fetch token IDs from contract if not configured + tokenIDs, err := u.fetchTokenIDsFromContract(ctx) + if err != nil { + log.Error("Failed to fetch tokenIDs from contract, price updater will not start") + return err + } + + if len(tokenIDs) == 0 { + log.Warn("No tokens to update, skipping price update cycle") + return nil + } + + // Step 1: Fetch new prices from feed (USD prices) + tokenPrices, err := u.priceFeed.GetBatchTokenPrices(ctx, tokenIDs) + if err != nil { + return fmt.Errorf("failed to fetch token prices: %w", err) + } + + // Step 2: Calculate price ratios using tokenInfo from contract + newPriceRatios := make(map[uint16]*big.Int) + for tokenID, tokenPrice := range tokenPrices { + priceRatio, err := u.calculatePriceRatio(ctx, tokenID, tokenPrice) + if err != nil { + log.Warn("Failed to calculate price ratio, skipping", + "token_id", tokenID, + "error", err) + continue + } + newPriceRatios[tokenID] = priceRatio + } + + // Step 3: Fetch current prices from contract and filter prices that need updating + var tokenIDsToUpdate []uint16 + var pricesToUpdate []*big.Int + + callOpts := &bind.CallOpts{Context: ctx} + for tokenID, newPrice := range newPriceRatios { + if newPrice == nil || newPrice.Sign() == 0 { + log.Warn("Skipping zero price", + "token_id", tokenID) + continue + } + + // Fetch current price from contract (not from cache) + lastPrice, err := u.registryContract.GetTokenPrice(callOpts, tokenID) + if err != nil { + log.Warn("Failed to get current price from contract, will update anyway", + "token_id", tokenID, + "error", err) + tokenIDsToUpdate = append(tokenIDsToUpdate, tokenID) + pricesToUpdate = append(pricesToUpdate, newPrice) + continue + } + + // Check if price changed significantly + if lastPrice.Sign() > 0 { + // Calculate if price change exceeds threshold + if !u.shouldUpdatePrice(lastPrice, newPrice) { + log.Debug("Price change below threshold, skipping update", + "token_id", tokenID, + "last_price", lastPrice.String(), + "new_price", newPrice.String(), + "threshold", u.priceThreshold) + continue + } + + log.Info("Price change exceeds threshold, will update", + "token_id", tokenID, + "last_price", lastPrice.String(), + "new_price", newPrice.String()) + } else { + log.Info("First time update for token (no price in contract)", + "token_id", tokenID, + "new_price", newPrice.String()) + } + + tokenIDsToUpdate = append(tokenIDsToUpdate, tokenID) + pricesToUpdate = append(pricesToUpdate, newPrice) + } + + if len(tokenIDsToUpdate) == 0 { + log.Debug("No prices need updating (all changes below threshold)") + return nil + } + + log.Info("Updating token prices", + "token_count", len(tokenIDsToUpdate), + "token_ids", tokenIDsToUpdate, + "total_tokens", len(tokenIDs)) + + // Step 3: Update prices on L2 + receipt, err := u.txManager.SendTransaction(ctx, func(auth *bind.TransactOpts) (*types.Transaction, error) { + return u.registryContract.BatchUpdatePrices(auth, tokenIDsToUpdate, pricesToUpdate) + }) + + if err != nil { + log.Error("Failed to send transaction", "error", err) + return fmt.Errorf("failed to send batch update prices transaction: %w", err) + } + + if receipt == nil { + log.Error("Received nil receipt") + return fmt.Errorf("received nil receipt") + } + + if receipt.Status != types.ReceiptStatusSuccessful { + log.Error("Transaction failed on-chain", + "tx_hash", receipt.TxHash.Hex(), + "status", receipt.Status, + "gas_used", receipt.GasUsed) + return fmt.Errorf("transaction failed on-chain: %s", receipt.TxHash.Hex()) + } + + log.Info("Successfully updated token prices", + "tx_hash", receipt.TxHash.Hex(), + "gas_used", receipt.GasUsed, + "token_count", len(tokenIDsToUpdate)) + + // Step 5: Update metrics + for i, tokenID := range tokenIDsToUpdate { + log.Debug("Price updated", + "token_id", tokenID, + "price_ratio", pricesToUpdate[i].String()) + } + + return nil +} + +// calculatePriceRatio calculates the price ratio for a token +// Formula: priceRatio = tokenScale * tokenPriceUSD * 10^(18 - tokenDecimals) / ethPriceUSD +// We do multiplications first, then division at the end to avoid precision loss +func (u *PriceUpdater) calculatePriceRatio(ctx context.Context, tokenID uint16, tokenPrice *client.TokenPrice) (*big.Int, error) { + // Validate input price data to prevent nil pointer panics + if tokenPrice == nil || tokenPrice.TokenPriceUSD == nil || tokenPrice.EthPriceUSD == nil { + return nil, fmt.Errorf("token price data missing for token %d", tokenID) + } + + // Fetch token info from contract + tokenInfo, err := u.registryContract.GetTokenInfo(&bind.CallOpts{ + Context: ctx, + }, tokenID) + if err != nil { + return nil, fmt.Errorf("failed to get token info from contract: %w", err) + } + + // Check if token is active + if !tokenInfo.IsActive { + return nil, fmt.Errorf("token %d is not active", tokenID) + } + + tokenScale := tokenInfo.Scale + tokenDecimals := tokenInfo.Decimals + + log.Debug("Token info from contract", + "token_id", tokenID, + "address", tokenInfo.TokenAddress.Hex(), + "decimals", tokenDecimals, + "token_scale", tokenScale.String(), + "active", tokenInfo.IsActive) + + // Validate token decimals (must be <= 18 for our formula to work) + if tokenDecimals > 18 { + return nil, fmt.Errorf("unsupported token decimals %d (>18) for token %d", tokenDecimals, tokenID) + } + + // Check ETH price is not zero + if tokenPrice.EthPriceUSD.Cmp(big.NewFloat(0)) == 0 { + return nil, fmt.Errorf("ETH price is zero") + } + + // Check token price is not zero or negative + if tokenPrice.TokenPriceUSD.Cmp(big.NewFloat(0)) <= 0 { + return nil, fmt.Errorf("invalid token price %s for token %d", tokenPrice.TokenPriceUSD.String(), tokenID) + } + + // Step 1: Start with tokenPriceUSD + priceRatio := new(big.Float).Set(tokenPrice.TokenPriceUSD) + + // Step 2: Multiply by tokenScale + tokenScaleFloat := new(big.Float).SetInt(tokenScale) + priceRatio.Mul(priceRatio, tokenScaleFloat) + + // Step 3: Multiply by 10^(18 - tokenDecimals) + // ETH has 18 decimals, so we need to adjust for token decimals + decimalAdjustment := new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(18-tokenDecimals)), nil) + decimalAdjustmentFloat := new(big.Float).SetInt(decimalAdjustment) + priceRatio.Mul(priceRatio, decimalAdjustmentFloat) + + // Step 4: Finally divide by ethPriceUSD + priceRatio.Quo(priceRatio, tokenPrice.EthPriceUSD) + + // Convert to big.Int with precision check + priceRatioInt, accuracy := priceRatio.Int(nil) + if accuracy != big.Exact { + log.Warn("Price ratio conversion lost precision", + "token_id", tokenID, + "symbol", tokenPrice.Symbol, + "accuracy", accuracy.String(), + "float_value", priceRatio.String(), + "int_value", priceRatioInt.String()) + } + + log.Info("Calculated price ratio", + "token_id", tokenID, + "symbol", tokenPrice.Symbol, + "token_price_usd", tokenPrice.TokenPriceUSD.String(), + "eth_price_usd", tokenPrice.EthPriceUSD.String(), + "decimals", tokenDecimals, + "token_scale", tokenScale.String(), + "price_ratio", priceRatioInt.String()) + + return priceRatioInt, nil +} + +// updateBalanceMetrics queries and updates balance metrics +func (u *PriceUpdater) updateBalanceMetrics(ctx context.Context) error { + // Get account address + account := u.l2Client.WalletAddress() + + // Query ETH balance + ethBalance, err := u.l2Client.GetClient().BalanceAt(ctx, account, nil) + if err != nil { + return fmt.Errorf("failed to get ETH balance: %w", err) + } + + // Convert to ETH (wei to ETH) + ethBalanceFloat := new(big.Float).SetInt(ethBalance) + ethBalanceFloat.Quo(ethBalanceFloat, big.NewFloat(1e18)) + ethBalanceEth, _ := ethBalanceFloat.Float64() + + // Update ETH balance metric + metrics.AccountBalance.Set(ethBalanceEth) + + log.Info("Updated balance metrics", + "account", account.Hex(), + "eth_balance", ethBalanceEth) + + return nil +} + +// shouldUpdatePrice checks if the price change exceeds the threshold +// Formula: |newPrice - lastPrice| / lastPrice * 10000 >= threshold +// Threshold is in basis points (bps): 1 bps = 0.01%, 100 bps = 1%, 10000 bps = 100% +// Example: if threshold is 100 (bps), price must change by at least 1% to trigger update +func (u *PriceUpdater) shouldUpdatePrice(lastPrice, newPrice *big.Int) bool { + // Validate inputs + if lastPrice == nil || newPrice == nil { + log.Warn("shouldUpdatePrice called with nil price") + return false + } + + if lastPrice.Sign() == 0 { + return true // Always update if no previous price + } + + // Validate threshold is reasonable (should be <= MaxPriceThresholdBPS) + // If threshold is unreasonably large, log warning and cap at 100% + threshold := u.priceThreshold + if threshold > config.MaxPriceThresholdBPS { + log.Warn("Price threshold is unusually large, capping at 100%", + "configured_threshold", threshold, + "capped_threshold", config.MaxPriceThresholdBPS, + "max_bps", config.MaxPriceThresholdBPS) + threshold = config.MaxPriceThresholdBPS + } + + // Calculate absolute difference: |newPrice - lastPrice| + diff := new(big.Int).Sub(newPrice, lastPrice) + diff.Abs(diff) + + // Calculate change in basis points: diff * MaxPriceThresholdBPS / lastPrice + // This gives us the change in bps (e.g., 100 for 1%, 10 for 0.1%, 1 for 0.01%) + bps := new(big.Int).Mul(diff, big.NewInt(int64(config.MaxPriceThresholdBPS))) + bps.Div(bps, lastPrice) + + // Compare with threshold (both are in basis points) + thresholdBig := big.NewInt(int64(threshold)) + shouldUpdate := bps.Cmp(thresholdBig) >= 0 + + log.Debug("Price change check", + "last_price", lastPrice.String(), + "new_price", newPrice.String(), + "change_bps", bps.String(), + "threshold_bps", threshold, + "should_update", shouldUpdate) + + return shouldUpdate +} + +// fetchTokenIDsFromContract fetches supported token IDs from L2TokenRegistry contract +func (u *PriceUpdater) fetchTokenIDsFromContract(ctx context.Context) ([]uint16, error) { + callOpts := &bind.CallOpts{Context: ctx} + + // Call getSupportedIDList() on the contract + return u.registryContract.GetSupportedIDList(callOpts) +} diff --git a/token-price-oracle/updater/tx_manager.go b/token-price-oracle/updater/tx_manager.go new file mode 100644 index 00000000..6a6012a7 --- /dev/null +++ b/token-price-oracle/updater/tx_manager.go @@ -0,0 +1,116 @@ +package updater + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/morph-l2/go-ethereum/accounts/abi/bind" + "github.com/morph-l2/go-ethereum/common" + "github.com/morph-l2/go-ethereum/core/types" + "github.com/morph-l2/go-ethereum/log" + "morph-l2/token-price-oracle/client" +) + +// TxManager manages transaction sending to avoid nonce conflicts +type TxManager struct { + l2Client *client.L2Client + mu sync.Mutex +} + +// NewTxManager creates a new transaction manager +func NewTxManager(l2Client *client.L2Client) *TxManager { + return &TxManager{ + l2Client: l2Client, + } +} + +// SendTransaction sends a transaction in a thread-safe manner +// It ensures only one transaction is sent at a time to avoid nonce conflicts +func (m *TxManager) SendTransaction(ctx context.Context, txFunc func(*bind.TransactOpts) (*types.Transaction, error)) (*types.Receipt, error) { + m.mu.Lock() + defer m.mu.Unlock() + + // Get transaction options (returns a copy) + auth := m.l2Client.GetOpts() + auth.Context = ctx + + // First, estimate gas with GasLimit = 0 + auth.GasLimit = 0 + auth.NoSend = true + tx, err := txFunc(auth) + if err != nil { + return nil, fmt.Errorf("failed to estimate gas: %w", err) + } + + // Use 1.5x of estimated gas as the actual gas limit + estimatedGas := tx.Gas() + auth.GasLimit = estimatedGas * 3 / 2 + log.Info("Gas estimation completed", "estimated", estimatedGas, "actual_limit", auth.GasLimit) + + // Now send the actual transaction + auth.NoSend = false + tx, err = txFunc(auth) + if err != nil { + return nil, err + } + + log.Info("Transaction sent", + "tx_hash", tx.Hash().Hex(), + "gas_limit", tx.Gas()) + + // Wait for transaction to be mined with custom timeout and retry logic + receipt, err := m.waitForReceipt(ctx, tx.Hash(), 60*time.Second, 2*time.Second) + if err != nil { + log.Error("Failed to wait for transaction receipt", + "tx_hash", tx.Hash().Hex(), + "error", err) + return nil, err + } + return receipt, nil +} + +// waitForReceipt waits for a transaction receipt with timeout and custom polling interval +func (m *TxManager) waitForReceipt(ctx context.Context, txHash common.Hash, timeout, pollInterval time.Duration) (*types.Receipt, error) { + deadline := time.Now().Add(timeout) + ticker := time.NewTicker(pollInterval) + defer ticker.Stop() + + log.Debug("Waiting for transaction receipt", + "tx_hash", txHash.Hex(), + "timeout", timeout, + "poll_interval", pollInterval) + + for { + // Check if we've exceeded the timeout + if time.Now().After(deadline) { + return nil, fmt.Errorf("timeout waiting for transaction %s after %v", txHash.Hex(), timeout) + } + + // Try to get the receipt + receipt, err := m.l2Client.GetClient().TransactionReceipt(ctx, txHash) + if err == nil && receipt != nil { + log.Debug("Receipt received", + "tx_hash", txHash.Hex(), + "status", receipt.Status, + "gas_used", receipt.GasUsed, + "block_number", receipt.BlockNumber) + return receipt, nil + } + + if err != nil { + log.Trace("Receipt retrieval failed, will retry", + "tx_hash", txHash.Hex(), + "error", err) + } + + // Wait for next poll or context cancellation + select { + case <-ctx.Done(): + return nil, fmt.Errorf("context cancelled while waiting for transaction %s: %w", txHash.Hex(), ctx.Err()) + case <-ticker.C: + // Continue to next iteration + } + } +} diff --git a/tx-submitter/go.mod b/tx-submitter/go.mod index d086006a..aad78cb4 100644 --- a/tx-submitter/go.mod +++ b/tx-submitter/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a github.com/tendermint/tendermint v0.35.9 - github.com/urfave/cli v1.22.14 + github.com/urfave/cli v1.22.17 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -26,7 +26,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/consensys/bavard v0.1.27 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect diff --git a/tx-submitter/go.sum b/tx-submitter/go.sum index 61f8029a..e5cecfea 100644 --- a/tx-submitter/go.sum +++ b/tx-submitter/go.sum @@ -1,4 +1,4 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= @@ -36,9 +36,8 @@ github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAh github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= github.com/consensys/gnark-crypto v0.16.0 h1:8Dl4eYmUWK9WmlP1Bj6je688gBRJCJbT8Mw4KoTAawo= github.com/consensys/gnark-crypto v0.16.0/go.mod h1:Ke3j06ndtPTVvo++PhGNgvm+lgpLvzbcE2MqljY7diU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg= github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -165,6 +164,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/morph-l2/externalsign v0.3.1 h1:UYFDZFB0L85A4rDvuwLNBiGEi0kSmg9AZ2v8Q5O4dQo= github.com/morph-l2/externalsign v0.3.1/go.mod h1:b6NJ4GUiiG/gcSJsp3p8ExsIs4ZdphlrVALASnVoGJE= github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53 h1:8+qaUTn1/eyS8er4RkibhHMFC/L4IgqIXLtORakBDkI= +github.com/morph-l2/go-ethereum v1.10.14-0.20251119080508-d085f8c79a53/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= github.com/morph-l2/tendermint v0.3.2 h1:Gu6Uj2G6c3YP2NAKFi7A46JZaOCdD4zfZDKCjt0pDm8= github.com/morph-l2/tendermint v0.3.2/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -259,8 +259,8 @@ github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ= +github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=