-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
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.
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)) |
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.
Why this is needed? Isn't math.MaxUint64
already uint64?
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.
All casts are related to this Go specification
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.
No, it's an untyped constant: https://golang.org/ref/spec#Constants (not a bug, a feature! :))
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.
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.
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.
I was actually re-reviewing this and you're right. In master
we should revise the code patch as follows:
- revert it
- build multi-arch
- fix build errors one by one
Blocked - until concerns raised in #8396 (comment) are addressed |
6ad11b6
to
c06a691
Compare
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.
I'm approving, but before merging please create issue with all followups from the comment below.
store/multistore: revert a height limit increase from #8396 See #8396 (comment)
Codecov Report
@@ 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
|
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes