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

[Merged by Bors] - Return ATX version along with blob #5922

Closed
wants to merge 3 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented May 9, 2024

Motivation

Need to get the ATX version from the atx_blobs table to decode ATX w/o knowing epoch->version mapping everywhere in the code.

Description

  • atxs.LoadBlob() also returns types.AtxVersion
  • refactored atxs.LoadBlob() to avoid duplicating the query code

Test Plan

  • added a UT to make sure one cannot mess the cached ATX blobs

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 76.08696% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 80.7%. Comparing base (06ec6d0) to head (8540dbc).
Report is 4 commits behind head on develop.

Files Patch % Lines
checkpoint/util.go 55.5% 4 Missing and 4 partials ⚠️
activation/validation.go 72.7% 3 Missing and 3 partials ⚠️
activation/handler.go 55.5% 2 Missing and 2 partials ⚠️
activation/handler_v1.go 25.0% 1 Missing and 2 partials ⚠️
activation/activation.go 0.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5922   +/-   ##
=======================================
  Coverage     80.7%   80.7%           
=======================================
  Files          289     288    -1     
  Lines        29868   29890   +22     
=======================================
+ Hits         24107   24141   +34     
+ Misses        4164    4160    -4     
+ Partials      1597    1589    -8     

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

@poszu poszu force-pushed the atxmerge/decoding-atxv2-blob branch from e457400 to f0743ac Compare May 10, 2024 07:14
@poszu poszu marked this pull request as ready for review May 10, 2024 07:18
sql/atxs/atxs.go Outdated Show resolved Hide resolved
@@ -273,7 +273,10 @@ type (
)

var loadBlobDispatch = map[Hint]loadBlobFunc{
ATXDB: atxs.LoadBlob,
ATXDB: func(ctx context.Context, db sql.Executor, key []byte, blob *sql.Blob) error {
_, err := atxs.LoadBlob(ctx, db, key, blob)
Copy link
Contributor

Choose a reason for hiding this comment

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

We will need blob version handling in fetch client / server, but that can be done later, of course.
Initial syncv2 version will reuse current blob fetching mechanism

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would it need to care about the version here? The fetched blobs are pushed through the ATX handler which can figure out the version while decoding on its own.

@poszu
Copy link
Contributor Author

poszu commented May 13, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 13, 2024
## Motivation

Need to get the ATX version from the `atx_blobs` table to decode ATX w/o knowing epoch->version mapping everywhere in the code.
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Return ATX version along with blob [Merged by Bors] - Return ATX version along with blob May 13, 2024
@spacemesh-bors spacemesh-bors bot closed this May 13, 2024
@spacemesh-bors spacemesh-bors bot deleted the atxmerge/decoding-atxv2-blob branch May 13, 2024 11:09
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.

None yet

2 participants