Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

v3 H/AMT integration #1328

Merged
merged 10 commits into from
Dec 16, 2020
Merged

v3 H/AMT integration #1328

merged 10 commits into from
Dec 16, 2020

Conversation

ZenGround0
Copy link
Contributor

@ZenGround0 ZenGround0 commented Dec 13, 2020

WIP hamt and amt integration + migration.

  • update to v3 hamt
  • update to v3 amt
  • amt and hamt migrations
  • migration vm tests working
  • amt bitwidth config plumbing

Closes #1313.

@codecov-io
Copy link

codecov-io commented Dec 14, 2020

Codecov Report

Merging #1328 (fbb60cb) into master (2a62795) will decrease coverage by 0.2%.
The diff coverage is 61.2%.

@@           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     

@ZenGround0 ZenGround0 marked this pull request as ready for review December 14, 2020 16:59
@ZenGround0 ZenGround0 requested a review from anorth December 14, 2020 16:59
if err != nil {
return NewPowerPairZero(), err
}
emptyExpirationArrayRoot, err := emptyExpirationArray.Root()
if err != nil {
return NewPowerPairZero(), err
}
Copy link
Member

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.

Copy link
Member

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.

if err != nil {
return nil, xerrors.Errorf("failed to persist empty sectors array: %w", err)
}
emptyPartitionsArray, err := adt.MakeEmptyArray(store, builtin.DefaultAmtBitwidth)
Copy link
Member

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.

Copy link
Member

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.

actors/builtin/power/power_test.go Outdated Show resolved Hide resolved
actors/migration/nv9/miner.go Show resolved Hide resolved
actors/builtin/power/policy.go Outdated Show resolved Hide resolved
actors/migration/nv9/util.go Outdated Show resolved Hide resolved
@anorth
Copy link
Member

anorth commented Dec 16, 2020

Looking good, I'll take this over to finish off.

@anorth anorth force-pushed the feat/v3-hamt-and-amt branch from c36f6c3 to fbb60cb Compare December 16, 2020 03:34
@anorth anorth merged commit 638376f into master Dec 16, 2020
@anorth anorth deleted the feat/v3-hamt-and-amt branch December 16, 2020 03:59
bibibong pushed a commit to EpiK-Protocol/go-epik-actors that referenced this pull request Feb 19, 2021
Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
Co-authored-by: anorth <445306+anorth@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support different bitwidth configuration for different H/AMTs
3 participants