-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1328 +/- ##
========================================
- Coverage 70.3% 70.0% -0.3%
========================================
Files 72 72
Lines 7306 7346 +40
========================================
+ Hits 5137 5148 +11
- Misses 1335 1354 +19
- Partials 834 844 +10 |
if err != nil { | ||
return NewPowerPairZero(), err | ||
} | ||
emptyExpirationArrayRoot, err := emptyExpirationArray.Root() | ||
if err != nil { | ||
return NewPowerPairZero(), err | ||
} |
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.
Go is killing us here, but it's probably worth factoring out a helper function for each array type.
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.
Ok I've made some wrappers for the common case of constructing an empty array and then flushing, but not pushed too much further.
actors/builtin/miner/miner_state.go
Outdated
if err != nil { | ||
return nil, xerrors.Errorf("failed to persist empty sectors array: %w", err) | ||
} | ||
emptyPartitionsArray, err := adt.MakeEmptyArray(store, builtin.DefaultAmtBitwidth) |
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.
When we see the default used, it's hard to know if it's being used correctly. Possibly we should add a named constant for each distinct use of this value, so they're more obviously correct.
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 did this for the new AMT constants, but not yet replaced the default HAMT bitwidth.
Looking good, I'll take this over to finish off. |
c36f6c3
to
fbb60cb
Compare
Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com> Co-authored-by: anorth <445306+anorth@users.noreply.github.com>
WIP hamt and amt integration + migration.
Closes #1313.