Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move some common functions to encoding #24

Conversation

colinlyguo
Copy link
Member

Purpose or design rationale of this PR

@colinlyguo colinlyguo merged commit a5691d4 into feat-support-conditional-encode Aug 20, 2024
3 checks passed
colinlyguo added a commit that referenced this pull request Aug 22, 2024
* feat: support conditional encode

* move append conditionalEncode flag after validity check

* update da-codec

* align naming

* add ConvertBlobToBlobBytes utility functions

* kept blob bytes

* rename enableEncode to enableCompress

* refactor: move some common functions to encoding (#24)

* refactor: move some common functions to encoding

* fix golint

* move symbol replace script to zstd folder

* Update encoding/codecv4/codecv4_test.go

Co-authored-by: Péter Garamvölgyi <[email protected]>

* fix typos

---------

Co-authored-by: Péter Garamvölgyi <[email protected]>
colinlyguo added a commit that referenced this pull request Oct 18, 2024
* feat: support conditional encode

* move append conditionalEncode flag after validity check

* update da-codec

* align naming

* add ConvertBlobToBlobBytes utility functions

* kept blob bytes

* rename enableEncode to enableCompress

* refactor: move some common functions to encoding (#24)

* refactor: move some common functions to encoding

* fix golint

* move symbol replace script to zstd folder

* refactor: move some util functions to public package

* fix CI

* add interfaces of codec

* add SetCompression

* move interface to encoding

* refactor

* add dablock.go

* add dachunk.go

* add dabatch.go

* move computeBatchDataHash to codecv

* fix

* add DABatchBase

* add GetCodecVersion

* add BlobVersionedHashes

* rename encoding.go to interfaces.go

* add NewDABatchWithExpectedBlobVersionedHashes

* tweak

* fix a bug

* add more logs

* add DecodeDAChunks

* add BlockRange interface

* fix

* add version check

* add Version

* remove DABatchBase

* add DABlock

* fixes

* fix

* add CodecFromVersion and CodecFromConfig

* remove GetCodecVersion

* fix typos

* make Block fields internal

* make chunk fields internal

* make batch fields internal and add some tweaks

* add JSONFromBytes

* fix a typo

* use register mode

* fix CI

* remove register mode

* add common functions

* add EstimateBlockL1CommitCalldataSize

* add dabatch interfaces

* update interface implementations

* add data hash

* fix codecv3 & codecv4 estimate gas

* fix

* fix bugs

* tweak

* add CheckChunkCompressedDataCompatibility & CheckBatchCompressedDataCompatibility

* fix

* add BlobDataProofForPointEvaluation

* add nil check in NewDAChunk

* make some util functions internal

* remove GetMaxChunksPerBatch

* fix CI

* change receiver mark from o to d

* remove SetCompression

* fix

* add GetChunkEnableCompression & GetBatchEnableCompression

* fix

* update l2geth dependency

* make types internal

* embed codecv0 <- codecv1 <- codecv2 <- codecv3 <- codecv4

* remove dablock.go dachunk.go dabatch.go

* trigger ci

* tweak

* tweaks

* add back TxsToTxsData

* fix

* fix

* fix

* fix

* fix

* fix

* tweak

* add back test block encode and test chunk encode unit tests

* replace some constants with meaningful vars

* rename daBatchV2 to daBatchV3

* add chunk hash unit tests

* add batch encode

* add batch hash unit tests

* add batch data hash & json marshal unit tests

* add calldata size unit tests

* add commit gas estimation

* add BatchSizeAndBlobSizeEstimation unit tests

* add L1MessagePopped unit tests

* add BlobEncodingAndHashing unit tests

* add blob data proof unit tests

* add TestDecodeBitmap

* add BlobCompressDecompress unit tests

* tweaks and bug fixes

* fix goimport

* add StandardTestCases

* edge cases

* fixes

* address ai's comments

* address ai's comments

* address ai's comments

* address comments

* address ai's comment

* remove some constants

* address comments

* add more logs

* address comments

* address comments

* address comments

* address comments

* add simple and nil functions unit tests

* add uncompressed case unit tests of DecodeTxsFromBlob

* add interface unit tests

* add codecv2 & codecv3 CompressedDataCompatibilityCheck unit tests

* remove mock flag

* add JSONFromBytes unit tests

* add codecv4 CompressedDataCompatibilityCheck unit tests

* add NewDABatchFromBytes unit tests

* fix golint

* tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants