babylonchain / babylon-finality-gadget

3 stars 3 forks source link

fix: unmarshal json error #42

Closed lesterli closed 4 months ago

lesterli commented 4 months ago

Summary

This PR fixes the unmarshal JSON error from the op e2e test case, it is caused by the null response of the RPC call occasionally, so we added a retry mechanism for the RPC call to fix it.

state.go:371:               ERROR[07-03|09:02:44.532] Derivation process critical error        role=sequencer err="failed to check if block 6 is finalized on Babylon: unexpected end of JSON input"

Test Plan

make lint
make test
make run
bap2pecs commented 4 months ago

this will fix flaky test like this:

            Error Trace:    /Users/zidong/Documents/Projects/babylon-finality-provider/itest/opstackl2/op_e2e_test.go:173
            Error:          Received unexpected error:
                            unexpected end of JSON input
            Test:           TestOpMultipleFinalityProviders
    op_test_manager.go:529: Stopping test manager
--- FAIL: TestOpMultipleFinalityProviders (99.28s)