Skip to content

Commit 64a3b43

Browse files
authored
submitter: add blob config set for blob fee calc (#798)
1 parent eeb106c commit 64a3b43

File tree

5 files changed

+542
-3
lines changed

5 files changed

+542
-3
lines changed

go.work.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ cloud.google.com/go/dataform v0.9.1/go.mod h1:pWTg+zGQ7i16pyn0bS1ruqIE91SdL2FDMv
4444
cloud.google.com/go/datafusion v1.7.4/go.mod h1:BBs78WTOLYkT4GVZIXQCZT3GFpkpDN4aBY4NDX/jVlM=
4545
cloud.google.com/go/datalabeling v0.8.4/go.mod h1:Z1z3E6LHtffBGrNUkKwbwbDxTiXEApLzIgmymj8A3S8=
4646
cloud.google.com/go/dataplex v1.14.0/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c=
47+
cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4=
4748
cloud.google.com/go/dataproc/v2 v2.3.0/go.mod h1:G5R6GBc9r36SXv/RtZIVfB8SipI+xVn0bX5SxUzVYbY=
4849
cloud.google.com/go/dataqna v0.8.4/go.mod h1:mySRKjKg5Lz784P6sCov3p1QD+RZQONRMRjzGNcFd0c=
4950
cloud.google.com/go/datastore v1.15.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8=
@@ -66,6 +67,7 @@ cloud.google.com/go/gkebackup v1.3.4/go.mod h1:gLVlbM8h/nHIs09ns1qx3q3eaXcGSELgN
6667
cloud.google.com/go/gkeconnect v0.8.4/go.mod h1:84hZz4UMlDCKl8ifVW8layK4WHlMAFeq8vbzjU0yJkw=
6768
cloud.google.com/go/gkehub v0.14.4/go.mod h1:Xispfu2MqnnFt8rV/2/3o73SK1snL8s9dYJ9G2oQMfc=
6869
cloud.google.com/go/gkemulticloud v1.1.0/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0=
70+
cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8=
6971
cloud.google.com/go/gsuiteaddons v1.6.4/go.mod h1:rxtstw7Fx22uLOXBpsvb9DUbC+fiXs7rF4U29KHM/pE=
7072
cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8=
7173
cloud.google.com/go/iap v1.9.3/go.mod h1:DTdutSZBqkkOm2HEOTBzhZxh2mwwxshfD/h3yofAiCw=
@@ -167,7 +169,10 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V
167169
github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE=
168170
github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I=
169171
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
172+
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
170173
github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
174+
github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw=
175+
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
171176
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
172177
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
173178
github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
@@ -348,10 +353,12 @@ github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPP
348353
github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs=
349354
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
350355
github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
356+
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
351357
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
352358
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
353359
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
354360
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
361+
github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY=
355362
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
356363
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
357364
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -380,6 +387,7 @@ github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW
380387
github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
381388
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
382389
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
390+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
383391
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
384392
github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
385393
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
@@ -423,6 +431,7 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
423431
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
424432
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
425433
github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo=
434+
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
426435
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
427436
github.com/ianlancetaylor/demangle v0.0.0-20220517205856-0058ec4f073c/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
428437
github.com/iden3/go-iden3-crypto v0.0.12/go.mod h1:swXIv0HFbJKobbQBtsB50G7IHr6PbTowutSew/iBEoo=
@@ -462,11 +471,13 @@ github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F
462471
github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
463472
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
464473
github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw=
474+
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
465475
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
466476
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
467477
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
468478
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
469479
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
480+
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
470481
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
471482
github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
472483
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
@@ -481,9 +492,11 @@ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4F
481492
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
482493
github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0=
483494
github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88=
495+
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
484496
github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY=
485497
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
486498
github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM=
499+
github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk=
487500
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
488501
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
489502
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@@ -520,6 +533,8 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N
520533
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
521534
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
522535
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
536+
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
537+
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
523538
github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
524539
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
525540
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
@@ -574,6 +589,7 @@ github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7
574589
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
575590
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
576591
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
592+
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
577593
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
578594
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
579595
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
@@ -681,6 +697,7 @@ github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqri
681697
github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
682698
github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
683699
github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
700+
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
684701
github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY=
685702
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
686703
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
@@ -693,6 +710,7 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsr
693710
github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk=
694711
github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA=
695712
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
713+
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
696714
gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE=
697715
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
698716
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
@@ -711,6 +729,7 @@ go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znn
711729
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
712730
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
713731
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
732+
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
714733
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
715734
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
716735
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
@@ -779,6 +798,7 @@ golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2
779798
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
780799
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
781800
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
801+
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
782802
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
783803
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
784804
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

tx-submitter/services/rollup.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ type Rollup struct {
8282
bm *l1checker.BlockMonitor
8383
eventInfoStorage *event.EventInfoStorage
8484
reorgDetector iface.IReorgDetector
85+
86+
ChainConfigMap types.ChainBlobConfigs
8587
}
8688

8789
func NewRollup(
@@ -126,6 +128,7 @@ func NewRollup(
126128
bm: bm,
127129
eventInfoStorage: eventInfoStorage,
128130
reorgDetector: reorgDetector,
131+
ChainConfigMap: types.ChainConfigMap,
129132
}
130133
return r
131134
}
@@ -298,7 +301,7 @@ func (r *Rollup) ProcessTx() error {
298301
// Helper function to detect reorgs with retry
299302
func (r *Rollup) detectReorgWithRetry() (bool, uint64, error) {
300303
var lastErr error
301-
for i := range 3 { // Try up to 3 times
304+
for i := 0; i < 3; i++ { // Try up to 3 times
302305
hasReorg, depth, err := r.reorgDetector.DetectReorg(r.ctx)
303306
if err == nil {
304307
return hasReorg, depth, nil
@@ -1240,7 +1243,6 @@ func (r *Rollup) buildSignatureInput(batch *eth.RPCRollupBatch) (*bindings.IRoll
12401243
}
12411244

12421245
func (r *Rollup) GetGasTipAndCap() (*big.Int, *big.Int, *big.Int, error) {
1243-
12441246
head, err := r.L1Client.HeaderByNumber(context.Background(), nil)
12451247
if err != nil {
12461248
return nil, nil, nil, err
@@ -1279,7 +1281,13 @@ func (r *Rollup) GetGasTipAndCap() (*big.Int, *big.Int, *big.Int, error) {
12791281
// calc blob fee cap
12801282
var blobFee *big.Int
12811283
if head.ExcessBlobGas != nil {
1282-
blobFee = eip4844.CalcBlobFee(*head.ExcessBlobGas, params.BlobTxBlobGaspriceUpdateFraction)
1284+
log.Info("market blob fee info", "excess blob gas", *head.ExcessBlobGas)
1285+
blobConfig, exist := r.ChainConfigMap[r.chainId.Uint64()]
1286+
if !exist {
1287+
blobConfig = types.DefaultBlobConfig
1288+
}
1289+
blobFeeDenominator := types.GetBlobFeeDenominator(blobConfig, head.Time)
1290+
blobFee = eip4844.CalcBlobFee(*head.ExcessBlobGas, blobFeeDenominator.Uint64())
12831291
// Set to 3x to handle blob market congestion
12841292
blobFee = new(big.Int).Mul(blobFee, big.NewInt(3))
12851293
}

tx-submitter/types/blob_config.go

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
package types
2+
3+
import (
4+
"math/big"
5+
6+
"github.com/morph-l2/go-ethereum/log"
7+
)
8+
9+
// BlobFeeConfig is used to configure blob fee calculation parameters.
10+
type BlobFeeConfig struct {
11+
ChainID *big.Int
12+
13+
// LondonBlock is the London block number (used for time determination).
14+
LondonBlock *big.Int
15+
16+
// Timestamps for each EIP upgrade (Unix timestamp, seconds).
17+
CancunTime *uint64 // EIP-4844 (Cancun)
18+
PragueTime *uint64 // Prague
19+
OsakaTime *uint64 // Osaka
20+
BPO1Time *uint64 // BPO1
21+
BPO2Time *uint64 // BPO2
22+
BPO3Time *uint64 // BPO3
23+
BPO4Time *uint64 // BPO4
24+
BPO5Time *uint64 // BPO5
25+
26+
// BlobConfig corresponding to each EIP.
27+
Cancun *BlobConfig
28+
Prague *BlobConfig
29+
Osaka *BlobConfig
30+
BPO1 *BlobConfig
31+
BPO2 *BlobConfig
32+
BPO3 *BlobConfig
33+
BPO4 *BlobConfig
34+
BPO5 *BlobConfig
35+
36+
Default *BlobConfig
37+
}
38+
39+
// BlobConfig contains the parameters required for blob fee calculation.
40+
type BlobConfig struct {
41+
// UpdateFraction is the denominator in the fakeExponential function.
42+
UpdateFraction uint64
43+
}
44+
45+
// Time determination methods (referencing go-ethereum logic).
46+
// IsCancun returns whether time is either equal to the Cancun fork time or greater.
47+
func (c *BlobFeeConfig) IsCancun(num *big.Int, time uint64) bool {
48+
return c.IsLondon(num) && isTimestampForked(c.CancunTime, time)
49+
}
50+
51+
// IsPrague returns whether time is either equal to the Prague fork time or greater.
52+
func (c *BlobFeeConfig) IsPrague(num *big.Int, time uint64) bool {
53+
return c.IsLondon(num) && isTimestampForked(c.PragueTime, time)
54+
}
55+
56+
// IsOsaka returns whether time is either equal to the Osaka fork time or greater.
57+
func (c *BlobFeeConfig) IsOsaka(num *big.Int, time uint64) bool {
58+
return c.IsLondon(num) && isTimestampForked(c.OsakaTime, time)
59+
}
60+
61+
// IsBPO1 returns whether time is either equal to the BPO1 fork time or greater.
62+
func (c *BlobFeeConfig) IsBPO1(num *big.Int, time uint64) bool {
63+
return c.IsLondon(num) && isTimestampForked(c.BPO1Time, time)
64+
}
65+
66+
// IsBPO2 returns whether time is either equal to the BPO2 fork time or greater.
67+
func (c *BlobFeeConfig) IsBPO2(num *big.Int, time uint64) bool {
68+
return c.IsLondon(num) && isTimestampForked(c.BPO2Time, time)
69+
}
70+
71+
// IsBPO3 returns whether time is either equal to the BPO3 fork time or greater.
72+
func (c *BlobFeeConfig) IsBPO3(num *big.Int, time uint64) bool {
73+
return c.IsLondon(num) && isTimestampForked(c.BPO3Time, time)
74+
}
75+
76+
// IsBPO4 returns whether time is either equal to the BPO4 fork time or greater.
77+
func (c *BlobFeeConfig) IsBPO4(num *big.Int, time uint64) bool {
78+
return c.IsLondon(num) && isTimestampForked(c.BPO4Time, time)
79+
}
80+
81+
// IsBPO5 returns whether time is either equal to the BPO5 fork time or greater.
82+
func (c *BlobFeeConfig) IsBPO5(num *big.Int, time uint64) bool {
83+
return c.IsLondon(num) && isTimestampForked(c.BPO5Time, time)
84+
}
85+
86+
// IsLondon returns whether num is either equal to the London fork block or greater.
87+
func (c *BlobFeeConfig) IsLondon(num *big.Int) bool {
88+
return isBlockForked(c.LondonBlock, num)
89+
}
90+
91+
// GetBlobFeeDenominator returns the corresponding UpdateFraction based on the time.
92+
func GetBlobFeeDenominator(blobFeeConfig *BlobFeeConfig, blockTime uint64) *big.Int {
93+
if blobFeeConfig == nil {
94+
// If not configured, use default value.
95+
log.Warn("BlobFeeConfig not set, using default denominator",
96+
"default", DefaultOsakaBlobConfig)
97+
return new(big.Int).SetUint64(DefaultOsakaBlobConfig.UpdateFraction)
98+
}
99+
100+
cfg := blobFeeConfig
101+
londonBlock := cfg.LondonBlock // London block number for fork determination.
102+
103+
// Check in priority order from high to low (BPO5 -> BPO4 -> ... -> Cancun).
104+
var blobConfig *BlobConfig
105+
106+
// Check BPO5
107+
if cfg.BPO5Time != nil && cfg.IsBPO5(londonBlock, blockTime) && cfg.BPO5 != nil {
108+
blobConfig = cfg.BPO5
109+
} else if cfg.BPO4Time != nil && cfg.IsBPO4(londonBlock, blockTime) && cfg.BPO4 != nil {
110+
blobConfig = cfg.BPO4
111+
} else if cfg.BPO3Time != nil && cfg.IsBPO3(londonBlock, blockTime) && cfg.BPO3 != nil {
112+
blobConfig = cfg.BPO3
113+
} else if cfg.BPO2Time != nil && cfg.IsBPO2(londonBlock, blockTime) && cfg.BPO2 != nil {
114+
blobConfig = cfg.BPO2
115+
} else if cfg.BPO1Time != nil && cfg.IsBPO1(londonBlock, blockTime) && cfg.BPO1 != nil {
116+
blobConfig = cfg.BPO1
117+
} else if cfg.OsakaTime != nil && cfg.IsOsaka(londonBlock, blockTime) && cfg.Osaka != nil {
118+
blobConfig = cfg.Osaka
119+
} else if cfg.PragueTime != nil && cfg.IsPrague(londonBlock, blockTime) && cfg.Prague != nil {
120+
blobConfig = cfg.Prague
121+
} else if cfg.CancunTime != nil && cfg.IsCancun(londonBlock, blockTime) && cfg.Cancun != nil {
122+
blobConfig = cfg.Cancun
123+
} else if cfg.Default != nil {
124+
blobConfig = cfg.Default
125+
}
126+
127+
if blobConfig == nil {
128+
log.Warn("No blob config found for current time, using default",
129+
"blockTime", blockTime,
130+
"londonBlock", londonBlock,
131+
"default", DefaultOsakaBlobConfig)
132+
return new(big.Int).SetUint64(DefaultOsakaBlobConfig.UpdateFraction)
133+
}
134+
135+
return new(big.Int).SetUint64(blobConfig.UpdateFraction)
136+
}
137+
138+
// isBlockForked returns whether a fork scheduled at block s is active at the
139+
// given head block. Whilst this method is the same as isTimestampForked, they
140+
// are explicitly separate for clearer reading.
141+
func isBlockForked(s, head *big.Int) bool {
142+
if s == nil || head == nil {
143+
return false
144+
}
145+
return s.Cmp(head) <= 0
146+
}
147+
148+
// isTimestampForked returns whether a fork scheduled at timestamp s is active
149+
// at the given head timestamp. Whilst this method is the same as isBlockForked,
150+
// they are explicitly separate for clearer reading.
151+
func isTimestampForked(s *uint64, head uint64) bool {
152+
if s == nil {
153+
return false
154+
}
155+
return *s <= head
156+
}

0 commit comments

Comments
 (0)