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

Introduce v2 actors #3936

Merged
merged 80 commits into from
Oct 6, 2020
Merged

Introduce v2 actors #3936

merged 80 commits into from
Oct 6, 2020

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Sep 21, 2020

Mostly opening this for illustrative purposes, but we could merge into #3781 fairly safely. Not gonna work correctly until all the TODO: ActorUpgrades are resolved, though.

Big TODOs:

  • Deal with payment channel parameter changes. This may require some retry logic, and will definitely require picking the right parameters across upgrades.
  • Fix "chain get". Currently, this command assumes exactly one version of specs-actors.
  • TESTING.

Some calls/operations will fail across the upgrade. Any funds associated with these operations (except the gas) will be returned to the sender.

  1. If a user submits a message to create a multisig/paych actor, the message will not be accepted after the upgrade.
  2. If a user submits a message to update a payment channel before the upgrade, it will not be accepted after the upgrade. HOWEVER, vouchers will remain valid and can be re-submitted after the upgrade.
  3. If a multisig transaction to perform any operation listed here is proposed before the upgrade, it will fail if approved after the upgrade.

Open Concerns:

  • Performance. We currently run the state migration on gas estimation. This obviously has absolutely abysmal performance.
    • We could cache migrations.
    • We could just fail. Unfortunately, I'm concerned that lotus may not retry aggressively enough.
    • We could "pretend" that we're still in the previous epoch, and estimate gas there (won't work for all messages).

chain/vm/invoker.go Outdated Show resolved Hide resolved
@arajasek arajasek force-pushed the refactor/net-upgrade branch from cc99ecd to 1dc69e3 Compare September 22, 2020 05:35
Base automatically changed from refactor/net-upgrade to master September 23, 2020 09:24
chain/actors/version.go Show resolved Hide resolved
chain/actors/builtin/builtin.go Show resolved Hide resolved
@Stebalien
Copy link
Member

I'm not sure what to do about the genesis code. It does some pretty hacky things to deal with the lack of power (adds fake power, adds sectors, then removes the fake power). I guess we can add a miner.SetEffectivePower function (to set the "this epoch" power), but that seems kind of sketch.

I'm not actually sure if we're doing this correctly anyways. We're setting TotalQualityAdjPower, TotalRawBytePower, and the "this epoch" variants. However, when computing things like pledge, we use the smoothed power, as far as I can tell.

@arajasek arajasek requested a review from raulk as a code owner September 25, 2020 00:53
arajasek and others added 8 commits September 25, 2020 12:49
Also, correctly handle multiple ADT versions.
Otherwise, we're going to end up with an import cycle between the adt and this
version.
This will make it easier to load arbitrary actors. We can:

* Type switch (sort of unsafe, may want marker methods?)
* Use this with `vm.MutateActorState`.
We're probably going to want to change some of these design decisions down the
road, but this is a good starting point.

* We may want to use a more general test for "is actor valid at epoch". Maybe
just a function?
* I'd like to push some of the actor metadata down into the actor types
themselves. Ideally, we'd be able to register actors with a simple
`Register(validation, manyActors...)` call.
@Stebalien Stebalien changed the title Introduce v1 actors Introduce v2 actors Sep 28, 2020
build/params_shared_funcs.go Show resolved Hide resolved
build/params_testnet.go Show resolved Hide resolved
Comment on lines +512 to +513
// This error is going to be really nasty.
return cid.Undef, xerrors.Errorf("network upgrade failed: %v", msgs.Messages())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 to just halting the chain, I think that's significantly better than allowing a (likely very broken) chain to continue and break state further.

(The answer might be different post-liftoff)

chain/messagepool/gasguess/guessgas.go Show resolved Hide resolved
@arajasek
Copy link
Contributor Author

arajasek commented Oct 5, 2020

Generally looks good, flagged some nits that i can address

@arajasek
Copy link
Contributor Author

arajasek commented Oct 5, 2020

Submodules might need to be updated (or they're wrong in next)

Stebalien added a commit to filecoin-project/oni that referenced this pull request Oct 5, 2020
Stebalien added a commit to filecoin-project/oni that referenced this pull request Oct 5, 2020
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

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

Payment channel changes LGTM 👍

@magik6k
Copy link
Contributor

magik6k commented Oct 6, 2020

Performance. We currently run the state migration on gas estimation. This obviously has absolutely abysmal performance.

  • We could cache migrations.
  • We could just fail. Unfortunately, I'm concerned that lotus may not retry aggressively enough.
  • We could "pretend" that we're still in the previous epoch, and estimate gas there (won't work for all messages).

I feel like the last option is probably the most conservative here

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Other than the gas estimation thing, this looks shippable

nonsense pushed a commit to filecoin-project/oni that referenced this pull request Oct 6, 2020
@arajasek arajasek merged commit 8739b93 into next Oct 6, 2020
@arajasek arajasek deleted the asr/spec-v1 branch October 6, 2020 21:34
nonsense pushed a commit to filecoin-project/oni that referenced this pull request Oct 13, 2020
* update oni for specs-actors v2 upgrade

filecoin-project/lotus#3936

* Update lotus with wallet changes

Co-authored-by: Steven Allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 P0: Critical Blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants