From 1596073bbca934829d8cd8a93bd1754cbedb3183 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Wed, 5 Mar 2025 16:05:29 +0800 Subject: [PATCH 1/4] fix-bridge-history-block-hash-calculation --- bridge-history-api/go.mod | 4 ++-- bridge-history-api/go.sum | 8 ++++---- go.work.sum | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bridge-history-api/go.mod b/bridge-history-api/go.mod index cdd44f1d30..b940afdce5 100644 --- a/bridge-history-api/go.mod +++ b/bridge-history-api/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 github.com/pressly/goose/v3 v3.16.0 github.com/prometheus/client_golang v1.19.0 - github.com/scroll-tech/go-ethereum v1.10.14-0.20250225152658-bcfdb48dd939 + github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.25.7 golang.org/x/sync v0.7.0 @@ -88,7 +88,7 @@ require ( github.com/rjeczalik/notify v0.9.1 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/scroll-tech/da-codec v0.1.3-0.20250210041951-d028c537b995 // indirect + github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 // indirect github.com/scroll-tech/zktrie v0.8.4 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect diff --git a/bridge-history-api/go.sum b/bridge-history-api/go.sum index d414eac40d..48898ba23e 100644 --- a/bridge-history-api/go.sum +++ b/bridge-history-api/go.sum @@ -309,10 +309,10 @@ github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= 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/da-codec v0.1.3-0.20250210041951-d028c537b995 h1:Zo1p42CUS9pADSKoDD0ZoDxf4dQ3gttqWZlV+RSeImk= -github.com/scroll-tech/da-codec v0.1.3-0.20250210041951-d028c537b995/go.mod h1:UZhhjzqYsyEhcvY0Y+SP+oMdeOUqFn/UXpbAYuPGzg0= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250225152658-bcfdb48dd939 h1:KODmYD4s4BY/SBheCHqGbATnGPLQKzTJVuAElA8Eh+0= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250225152658-bcfdb48dd939/go.mod h1:AgU8JJxC7+nfs7R7ma35AU7dMAGW7wCw3dRZRefIKyQ= +github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4= +github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401 h1:WMphAYPkAhREnd4J2Bpvmkpi164XqzWEyjyKImxKaTc= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= 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/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= diff --git a/go.work.sum b/go.work.sum index 789439df5e..c2301bedcc 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1143,6 +1143,7 @@ github.com/scroll-tech/go-ethereum v1.10.14-0.20240607130425-e2becce6a1a4/go.mod github.com/scroll-tech/go-ethereum v1.10.14-0.20240821074444-b3fa00861e5e/go.mod h1:swB5NSp8pKNDuYsTxfR08bHS6L56i119PBx8fxvV8Cs= github.com/scroll-tech/go-ethereum v1.10.14-0.20241010064814-3d88e870ae22/go.mod h1:r9FwtxCtybMkTbWYCyBuevT9TW3zHmOTHqD082Uh+Oo= github.com/scroll-tech/go-ethereum v1.10.14-0.20250206083728-ea43834c198f/go.mod h1:Ik3OBLl7cJxPC+CFyCBYNXBPek4wpdzkWehn/y5qLM8= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250225152658-bcfdb48dd939/go.mod h1:AgU8JJxC7+nfs7R7ma35AU7dMAGW7wCw3dRZRefIKyQ= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0 h1:HtCSf6B4gN/87yc5qTl7WsxPKQIIGXLPPM1bMCPOsoY= @@ -1631,6 +1632,7 @@ gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v1.4.0 h1:BjtEgfuw8Qyd+jPvQz8CfoxiO/UjFEidWinwEXZiWv0= gotest.tools v1.4.0/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 2d9afa10acf05924211c0a6ef126478bbcc2ab77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 5 Mar 2025 09:14:10 +0100 Subject: [PATCH 2/4] bump version --- bridge-history-api/go.mod | 2 +- bridge-history-api/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bridge-history-api/go.mod b/bridge-history-api/go.mod index b940afdce5..987b431f40 100644 --- a/bridge-history-api/go.mod +++ b/bridge-history-api/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 github.com/pressly/goose/v3 v3.16.0 github.com/prometheus/client_golang v1.19.0 - github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401 + github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.25.7 golang.org/x/sync v0.7.0 diff --git a/bridge-history-api/go.sum b/bridge-history-api/go.sum index 48898ba23e..5f42bf377c 100644 --- a/bridge-history-api/go.sum +++ b/bridge-history-api/go.sum @@ -311,8 +311,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4= github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401 h1:WMphAYPkAhREnd4J2Bpvmkpi164XqzWEyjyKImxKaTc= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250305075318-e24712364401/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4 h1:KkA0WG3j7KkbYKP8YaBa/KcgiQlYhuLBP9EHvFThD7Y= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= 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/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= From f5b8420f9580cd405d985536c8f21db6e3a18c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 5 Mar 2025 09:26:12 +0100 Subject: [PATCH 3/4] use latest instead of pending --- rollup/internal/controller/sender/sender.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup/internal/controller/sender/sender.go b/rollup/internal/controller/sender/sender.go index 657e02238c..60dea367a0 100644 --- a/rollup/internal/controller/sender/sender.go +++ b/rollup/internal/controller/sender/sender.go @@ -663,7 +663,7 @@ func (s *Sender) getSenderMeta() *orm.SenderMeta { } func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64, uint64, uint64, error) { - header, err := s.client.HeaderByNumber(ctx, big.NewInt(rpc.PendingBlockNumber.Int64())) + header, err := s.client.HeaderByNumber(ctx, big.NewInt(rpc.LatestBlockNumber.Int64())) if err != nil { return 0, 0, 0, fmt.Errorf("failed to get header by number, err: %w", err) } @@ -677,8 +677,8 @@ func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64 if excess := header.ExcessBlobGas; excess != nil { blobBaseFee = misc.CalcBlobFee(*excess).Uint64() } - // header.Number.Uint64() returns the pendingBlockNumber, so we minus 1 to get the latestBlockNumber. - return header.Number.Uint64() - 1, baseFee, blobBaseFee, nil + + return header.Number.Uint64(), baseFee, blobBaseFee, nil } func makeSidecar(blob *kzg4844.Blob) (*gethTypes.BlobTxSidecar, error) { From d2a2706d5f604232b509ca7147b6179645aa1331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 5 Mar 2025 09:49:35 +0100 Subject: [PATCH 4/4] fix hash again --- bridge-history-api/go.mod | 2 +- bridge-history-api/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bridge-history-api/go.mod b/bridge-history-api/go.mod index 987b431f40..cfe861d386 100644 --- a/bridge-history-api/go.mod +++ b/bridge-history-api/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 github.com/pressly/goose/v3 v3.16.0 github.com/prometheus/client_golang v1.19.0 - github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4 + github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.25.7 golang.org/x/sync v0.7.0 diff --git a/bridge-history-api/go.sum b/bridge-history-api/go.sum index 5f42bf377c..95b6061966 100644 --- a/bridge-history-api/go.sum +++ b/bridge-history-api/go.sum @@ -311,8 +311,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4= github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4 h1:KkA0WG3j7KkbYKP8YaBa/KcgiQlYhuLBP9EHvFThD7Y= -github.com/scroll-tech/go-ethereum v1.10.14-0.20250305080757-f1e523a142b4/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950 h1:qfOaRflvH1vtnFWloB7BveKlP/VqYgMqLJ6e9TlBJ/8= +github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= 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/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=