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

[backport/v0.41.x]: Compatibility with the ARM architecture #8450

Merged
merged 3 commits into from
Feb 17, 2021

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Jan 27, 2021

From: #8396
Thanks: @RiccardoM for the original patch.


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@alessio alessio added this to the v0.41.1 milestone Jan 27, 2021
@alessio alessio changed the title Compatibility with the ARM architecture v0.41.x: cherry-pick ARM build compatibility fix Jan 27, 2021
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

I wonder why you need to add type conversions. This should be handled by the compiler.

@@ -91,7 +91,7 @@ func (s *Store) Get(height uint64, format uint32) (*types.Snapshot, error) {

// Get fetches the latest snapshot from the database, if any.
func (s *Store) GetLatest() (*types.Snapshot, error) {
iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(math.MaxUint64, math.MaxUint32))
iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(uint64(math.MaxUint64), math.MaxUint32))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this is needed? Isn't math.MaxUint64 already uint64?

Copy link
Contributor

Choose a reason for hiding this comment

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

All casts are related to this Go specification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's an untyped constant: https://golang.org/ref/spec#Constants (not a bug, a feature! :))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, exactly. constants will adapt to the expected types. The encodeKey has following declaration:

func encodeKey(height uint64, format uint32) []byte

so the math.MaxUint64 will automatically become uint64 - seems that this conversion is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was actually re-reviewing this and you're right. In master we should revise the code patch as follows:

  1. revert it
  2. build multi-arch
  3. fix build errors one by one

@alessio alessio added the S:blocked Status: Blocked label Jan 28, 2021
@alessio
Copy link
Contributor Author

alessio commented Jan 28, 2021

Blocked - until concerns raised in #8396 (comment) are addressed

@alessio alessio force-pushed the alessio/backport-8396 branch from 6ad11b6 to c06a691 Compare February 1, 2021 14:32
@clevinson clevinson changed the title v0.41.x: cherry-pick ARM build compatibility fix [backport/v0.41.x]: Compatibility with the ARM architecture Feb 10, 2021
@clevinson clevinson mentioned this pull request Feb 10, 2021
23 tasks
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

I'm approving, but before merging please create issue with all followups from the comment below.

@clevinson
Copy link
Contributor

@alessio Can you update this PR to include a backport of #8466 ?

Alessio Treglia added 2 commits February 17, 2021 09:22
store/multistore: revert a height limit increase from #8396

See #8396 (comment)
@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #8450 (031bfbb) into release/v0.41.x (2a5818c) will decrease coverage by 0.00%.
The diff coverage is 36.36%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           release/v0.41.x    #8450      +/-   ##
===================================================
- Coverage            61.93%   61.92%   -0.01%     
===================================================
  Files                  611      611              
  Lines                35250    35241       -9     
===================================================
- Hits                 21831    21822       -9     
  Misses               11136    11136              
  Partials              2283     2283              
Impacted Files Coverage Δ
baseapp/grpcserver.go 2.70% <0.00%> (+0.13%) ⬆️
store/rootmulti/store.go 66.05% <0.00%> (ø)
x/staking/keeper/keeper.go 56.66% <ø> (-1.40%) ⬇️
x/staking/keeper/validator.go 80.52% <ø> (+0.03%) ⬆️
client/grpc_query.go 29.16% <40.00%> (+0.90%) ⬆️
baseapp/grpcrouter.go 80.00% <50.00%> (-6.05%) ⬇️
server/grpc/server.go 62.50% <100.00%> (ø)
snapshots/store.go 74.31% <100.00%> (ø)
testutil/network/util.go 72.91% <100.00%> (ø)
x/ibc/applications/transfer/module.go 60.68% <100.00%> (ø)
... and 1 more

@alessio alessio merged commit d685701 into release/v0.41.x Feb 17, 2021
@alessio alessio deleted the alessio/backport-8396 branch February 17, 2021 10:02
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.

6 participants