linea-monorepo icon indicating copy to clipboard operation
linea-monorepo copied to clipboard

Decompressor Library

Open Tabaie opened this issue 1 year ago • 4 comments
trafficstars

This PR implements creates a decompressor library capable of managing different blob versions and dictionaries. Its output consists of an RLP encoded list of blocks. Due to some information loss during compression, two pieces of information are represented "hackily":

  • The block hash is in the ParentHash field, not the hash field itself, as go-ethereum computes that field itself, not allowing users to set it manually.
  • The transaction from address is in the signature.R field.

NOTE Only the Go side has been tested. Need contribution from a Kotlin developer to make this merge-ready.

Checklist

  • [ ] I wrote new tests for my new core changes.
  • [ ] I have successfully ran tests, style checker and build against my new changes locally.
  • [ ] I have informed the team of any breaking changes if there are any.

Tabaie avatar Sep 12 '24 15:09 Tabaie

Delta Summary - Kotlin Code Coverage

Generated on: 09/14/2024 - 15:26
Description Previous Current Delta
Coverage date: 09/14/2024 - 15:26 09/14/2024 - 15:26
Tag: 118_10863448018 118_10863448018
Line coverage: 27.6% 27.6% 0.0%
Covered lines: 26071 26071 0
Coverable lines: 94280 94280 0
Total lines: 133202 133202 0
Branch coverage: 10.5% 10.5% 0.0%
Covered branches: 5638 5638 0
Total branches: 53419 53419 0
Method coverage: Feature is only available for sponsors

github-actions[bot] avatar Sep 13 '24 09:09 github-actions[bot]

Hi @Tabaie I made a release of the decompressor lib from this branch and created a basic test but it fails with error.

Maybe I am initializing the decompressor wrongly. Please take a take a look at the test. You can run them with

./gradlew jvm-libs:blob-decompressor:test
Error looking up function 'Error': dlsym(0x8b047c60, Error): symbol not found
java.lang.UnsatisfiedLinkError: Error looking up function 'Error': dlsym(0x8b047c60, Error): symbol not found
	at com.sun.jna.Function.<init>(Function.java:255)

jpnovais avatar Sep 15 '24 18:09 jpnovais

~@jpnovais the Kotlin side is probably all wrong. I was hoping to hammer that part out together with yourself or @gauravahuja.~

^ seems like you've already done all that. I'll take a look today or tomorrow. 👍

Tabaie avatar Sep 15 '24 22:09 Tabaie

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.28%. Comparing base (9fc7fa6) to head (a81ee48). Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #31      +/-   ##
============================================
- Coverage     70.69%   70.28%   -0.42%     
+ Complexity     1059     1038      -21     
============================================
  Files           291      282       -9     
  Lines         11972    11244     -728     
  Branches       1106     1077      -29     
============================================
- Hits           8464     7903     -561     
+ Misses         3031     2875     -156     
+ Partials        477      466      -11     
Flag Coverage Δ *Carryforward flag
hardhat 98.69% <ø> (ø)
kotlin 67.75% <ø> (-0.62%) :arrow_down: Carriedforward from 5927923

*This pull request uses carry forward flags. Click here to find out more.

see 146 files with indirect coverage changes

codecov-commenter avatar Oct 02 '24 14:10 codecov-commenter

Closed in favor of https://github.com/Consensys/linea-monorepo/pull/229 due to merge conflicts

Tabaie avatar Oct 22 '24 16:10 Tabaie