celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

fix(blob)!: tendermint compatible commitment proof json marshall

Open zvolin opened this issue 1 year ago • 13 comments

Fixes https://github.com/celestiaorg/celestia-node/issues/3918

Please note: this PR is BREAKING as commitment proof encoding has changed.

zvolin avatar Nov 11 '24 13:11 zvolin

yes, it uses coretypes.RowProof. Everything that comes from core (tendermint fork) should be serialized with tendermint json encoder / decoder as it treats 64 bit integers differently (stringifies them)

zvolin avatar Nov 11 '24 15:11 zvolin

thanks for your response @zvolin. And why is this change useful?

rach-id avatar Nov 11 '24 15:11 rach-id

After second thinking about this, I guess you're right, this needs fixing

rach-id avatar Nov 11 '24 15:11 rach-id

And why is this change useful?

to have unified representation of objects regardless whether they are returned from celestia-node api or tendermint rest api. Moreover, tendermint implementations in different languages can have the rules how to encode types in different level than in go, namely tendermint-rs bakes how the type is meant to be encoded on type level, not encoder level, so in lumina we had to patch tendermint to achieve celestia-node compatible representation, but we could never be compatible with both tendermint and celestia-node.

tl;dr it originates from us wishing to drop tendermint-rs fork but I believe it's a good thing in general

zvolin avatar Nov 11 '24 16:11 zvolin

@zvolin could you please fix lint?

vgonkivs avatar Nov 13 '24 10:11 vgonkivs

switched to marshaling whole type as per https://github.com/celestiaorg/celestia-node/pull/3930#discussion_r1837870368

zvolin avatar Nov 13 '24 12:11 zvolin

Linter failed.

vgonkivs avatar Nov 13 '24 14:11 vgonkivs

should be good now, sorry

zvolin avatar Nov 14 '24 10:11 zvolin

blob_fuzz_test.go:69: invalid 64-bit integer encoding "64", expected string

vgonkivs avatar Nov 15 '24 10:11 vgonkivs

:crossed_fingers: sd '"(total|index)":([0-9]+)' '"$1":"$2"' blob/testdata/**/*.json

zvolin avatar Nov 15 '24 13:11 zvolin

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (feature/api-breaks@2ff0d14). Learn more about missing BASE report.

Files with missing lines Patch % Lines
header/header.go 0.00% 1 Missing :warning:
Additional details and impacted files
@@                  Coverage Diff                  @@
##             feature/api-breaks    #3929   +/-   ##
=====================================================
  Coverage                      ?   35.60%           
=====================================================
  Files                         ?      307           
  Lines                         ?    24168           
  Branches                      ?        0           
=====================================================
  Hits                          ?     8604           
  Misses                        ?    14608           
  Partials                      ?      956           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Nov 15 '24 13:11 codecov-commenter

make test-integration SHORT=true TAGS=sync passes for me locally :thinking:

zvolin avatar Nov 15 '24 13:11 zvolin

The test seems to be flaky.

vgonkivs avatar Nov 15 '24 15:11 vgonkivs