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

fix: use nanoseconds instead of seconds in sp1 light client #408

Merged
merged 17 commits into from
Mar 16, 2025

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Mar 14, 2025

Description

zellic audit issue


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@srdtrk srdtrk changed the title fix: use nanoseconds instead of seconds in SP1ICS07Tendermint.sol fix: use nanoseconds instead of seconds in sp1 light client Mar 14, 2025
Copy link

codecov bot commented Mar 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.86%. Comparing base (a284ab0) to head (2e830a1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #408   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          14       14           
  Lines         740      744    +4     
=======================================
+ Hits          739      743    +4     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@srdtrk srdtrk marked this pull request as ready for review March 14, 2025 14:54
@srdtrk srdtrk requested a review from gjermundgaraba as a code owner March 14, 2025 14:54
Copy link
Contributor

@gjermundgaraba gjermundgaraba 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, just wondered about the 128 vs 256 usage

function _validateClientStateAndTime(
IICS07TendermintMsgs.ClientState memory publicClientState,
uint64 time
uint128 time
Copy link
Contributor

Choose a reason for hiding this comment

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

why not uint256? Seems like we are using that elsewhere here

Copy link
Member Author

Choose a reason for hiding this comment

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

rust returns nanos as u128. I think this is a nice reminder to us that this field is a nanos. Making us less likely to confuse.

/// @param root commitment root (i.e app hash)
/// @param nextValidatorsHash next validators hash
struct ConsensusState {
uint64 timestamp;
uint128 timestamp;
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto on uint256

Copy link
Contributor

Choose a reason for hiding this comment

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

Not gonna write on the others, but any reason we mix?

@srdtrk srdtrk merged commit b05dea1 into main Mar 16, 2025
66 checks passed
@srdtrk srdtrk deleted the serdar/xxx-sp1-nanos branch March 16, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants