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

Increase test coverage & Fix for goerli setup #853

Merged
merged 26 commits into from
Jun 9, 2023
Merged

Increase test coverage & Fix for goerli setup #853

merged 26 commits into from
Jun 9, 2023

Conversation

yrong
Copy link
Contributor

@yrong yrong commented Jun 5, 2023

  • sno-454
  • make sure beacon client works for goerli setup
  • update benchmark with lower weight for ExecutionUpdate

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Patch coverage: 93.75% and project coverage change: +1.90 🎉

Comparison is base (118b614) 71.20% compared to head (188053c) 73.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #853      +/-   ##
==========================================
+ Coverage   71.20%   73.10%   +1.90%     
==========================================
  Files          30       38       +8     
  Lines        1330     1517     +187     
  Branches        0       52      +52     
==========================================
+ Hits          947     1109     +162     
- Misses        383      388       +5     
- Partials        0       20      +20     
Impacted Files Coverage Δ
parachain/primitives/beacon/src/types.rs 77.19% <0.00%> (+8.77%) ⬆️
...arachain/pallets/ethereum-beacon-client/src/lib.rs 87.10% <100.00%> (+4.55%) ⬆️

... and 12 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yrong yrong marked this pull request as ready for review June 5, 2023 05:37
@yrong yrong changed the title Increase test coverage Increase test coverage & Fix for goerli main spec Jun 6, 2023
@yrong yrong changed the title Increase test coverage & Fix for goerli main spec Increase test coverage & Fix for goerli setup Jun 6, 2023
Copy link
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome update @yrong! I made some minor comments and asked some questions. The new tests in this PR are particularly useful, nice!

parachain/pallets/ethereum-beacon-client/src/tests.rs Outdated Show resolved Hide resolved
parachain/pallets/ethereum-beacon-client/src/tests.rs Outdated Show resolved Hide resolved
parachain/pallets/ethereum-beacon-client/src/types.rs Outdated Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Outdated Show resolved Hide resolved
relayer/relays/beacon/header/header.go Show resolved Hide resolved
relayer/relays/beacon/header/header.go Outdated Show resolved Hide resolved
Comment on lines +301 to +302
// sync for the next period
periodsToSync := []uint64{latestSyncedPeriod + 1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the sync committee processing fell behind? Or will this not happen with the new beacon client checks?

Copy link
Contributor Author

@yrong yrong Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure fully get the point here. FinalityUpdate changes every epoch(i.e. 6.4 mins) and SyncCommitteeUpdate every 27.3 hours, so plenty of time for our light client to catch up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say the latestSyncedPeriod is 50, but the current sync period is 60, then sync period 50 and 51 would be synced only. Please correct me if I'm wrong, I'm wrapping my head around the changes. 😄

Copy link
Contributor Author

@yrong yrong Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only period 51 will be synced in this case, we won't sync period 50 unless latestSyncedPeriod is also initialPeriod when checkpoint initialized. And we also won't start syncing period 52 unless executionUpdate in between catch up.

Actually the change above is mainly for coordinating with Vincent's improvement recently, to follow ALC spec more closely we do not store historical sync committees anymore. Instead only current&next which also means we can not verify arbitrary historical update as we did before.

@claravanstaden Please let me know if any concern.

relayer/relays/beacon/header/syncer/syncer.go Outdated Show resolved Hide resolved
relayer/relays/beacon/header/syncer/syncer.go Outdated Show resolved Hide resolved
@yrong
Copy link
Contributor Author

yrong commented Jun 6, 2023

Beacon client with goerli setup work as expected expect for one issue found in lodestar, add ChainSafe/lodestar#5613
for tracking.

Copy link
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @yrong! I think it's nearly ready to merge. I just have one last question here: #853 (comment)

parachain/pallets/ethereum-beacon-client/src/types.rs Outdated Show resolved Hide resolved
parachain/primitives/beacon/src/types.rs Outdated Show resolved Hide resolved
parachain/primitives/beacon/src/types.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approved!

Copy link
Collaborator

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yrong ah, one thing, I saw you updated the weights in cumulus. Can you also update the weights in pallets/ethereum-beacon-client/weights.rs please.

@yrong yrong requested a review from claravanstaden June 8, 2023 12:49
core/package.json Outdated Show resolved Hide resolved
relayer/relays/beacon/header/syncer/syncer.go Outdated Show resolved Hide resolved
relayer/relays/beacon/header/syncer/syncer.go Outdated Show resolved Hide resolved
relayer/relays/beacon/header/header.go Show resolved Hide resolved
parachain/templates/benchmarking-fixtures.mustache Outdated Show resolved Hide resolved
parachain/pallets/ethereum-beacon-client/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@vgeddes
Copy link
Collaborator

vgeddes commented Jun 8, 2023

Ron, you can exclude coverage reports for the benchmarking and weight stuff by those code paths into codecov.yml.

This should make the PR pass the checks.

@yrong yrong requested a review from doubledup June 9, 2023 01:47
@yrong yrong merged commit cd9e049 into main Jun 9, 2023
@yrong yrong deleted the ron/sno-454 branch June 9, 2023 08:36
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.

4 participants