-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
LC Updates by Range to read from DB #14531
LC Updates by Range to read from DB #14531
Conversation
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
I am not sure you missed them or are they intentional but I think they were there because you removed the fn call which returned err . |
3db34bd
to
fb48b4a
Compare
return db | ||
} | ||
|
||
func createUpdate(t *testing.T, v int) (interfaces.LightClientUpdate, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function the same as the other createUpdate
? If yes, you can move it from here to testing/util/lightclient.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did it for the handlers_test.go
but it can't be done for kv/lightclient_test.go
because of circular import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it turns out that it's not even possible for handlers_test.go
.
params.SetupTestConfigCleanup(t) | ||
config := params.BeaconConfig() | ||
|
||
t.Run("new has supermajority but old doesn't", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern that we had is also fine. Can you go back to it so that the diff is smaller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to create these updates and set their values with wrapper setters, using the previous pattern.
930d9ac
into
prysmaticlabs:epf-light-client
* change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]>
* change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]>
* change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]>
* change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]>
* Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * align changelog with develop branch * bzl * LC Updates by Range to read from DB (#14531) * change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]> * Light Client: Electra finality branch (#14597) * extract from lc-p2p branch * generate code * trixy's review * test fixes * fix issue in `CreateDefaultLightClientUpdate` function (#14585) * use state in `CreateDefaultLightClientUpdate` * lint * add `stateSlot` to `update.go` structs * Revert "add `stateSlot` to `update.go` structs" This reverts commit 84468ae. * set sync committee based on attestedHeader in updateElectra * dependencies * add check to `SetNextSyncCommitteeBranchElectra` * add detailed error messages to `update.go` * dependencies * fix `createDefaultLightClientUpdate` * deps * fix errors * deps * revert error messages * deps * save update * save update * move create lc bootstrap to core * bootstrap db * save bootstrap * testing * testing progress * testing * testing * checkpoint working * set genesis time manually * savebootstrap tests * conflicts resolved * fix lint issues * fix lint issues * address reviews * revert changes to consensus-types/lc/updates.go * add lightClientHeaderToJSON support for Electra --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Inspector-Butters <[email protected]>
* change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]>
* Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * align changelog with develop branch * bzl * LC Updates by Range to read from DB (#14531) * change updatebyrange * lcupdateresponse from consensus * range altair test * range forks tests * finish tests * changelog * remove unused functions * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/light-client/handlers.go Co-authored-by: Radosław Kapka <[email protected]> * use slice instead of array * refactor code * refactor tests * refactor tests * refactor tests * add configCleanup in tests * refactor missing updates testcase * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * change updatesByRange to use new structs * Light Client - use the new consensus types (#14549) * in progress * completed logic * var name * additional logic changes * fix createDefaultLightClientUpdate * empty fields * unused context * fix rpc/helpers_test * Return the correct light client payload proof (#14565) * Return the correct payload proof * changelog <3 * merge * Set fields of wrapped proto object in light client setters (#14573) * Set fields of wrapped proto object in light client setters * changelog <3 * fixing tests... * core tests fixed * kv tests fixed * fix TODOs for events (#14570) * fix TODOs for events * address review comments * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * Update beacon-chain/rpc/eth/events/events.go Co-authored-by: Radosław Kapka <[email protected]> * nits --------- Co-authored-by: Radosław Kapka <[email protected]> * tests fixed * remove unused function * fix slice capacity * address issues * address issues * fix circular import error * remove unused func * fix changelog --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]> * Light Client: Electra finality branch (#14597) * extract from lc-p2p branch * generate code * trixy's review * test fixes * fix issue in `CreateDefaultLightClientUpdate` function (#14585) * use state in `CreateDefaultLightClientUpdate` * lint * add `stateSlot` to `update.go` structs * Revert "add `stateSlot` to `update.go` structs" This reverts commit 84468ae. * set sync committee based on attestedHeader in updateElectra * dependencies * add check to `SetNextSyncCommitteeBranchElectra` * add detailed error messages to `update.go` * dependencies * fix `createDefaultLightClientUpdate` * deps * fix errors * deps * revert error messages * deps * save update * save update * move create lc bootstrap to core * bootstrap db * save bootstrap * testing * testing progress * testing * testing * checkpoint working * set genesis time manually * savebootstrap tests * conflicts resolved * fix lint issues * fix lint issues * address reviews * revert changes to consensus-types/lc/updates.go * add lightClientHeaderToJSON support for Electra --------- Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Rupam Dey <[email protected]> Co-authored-by: Radosław Kapka <[email protected]> Co-authored-by: Inspector-Butters <[email protected]>
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR changes the
GetLightClientUpdatesByRange
API function to read the updates from the DB instead of computing them which is a very heavy process.Which issues(s) does this PR fix?
Part of #12991