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

feat: implement the v10 migration #142

Merged
merged 1 commit into from
Dec 22, 2022
Merged

feat: implement the v10 migration #142

merged 1 commit into from
Dec 22, 2022

Conversation

arajasek
Copy link
Contributor

  • Create the EAM Actor with "empty object" head
  • Create the EthZeroAddress actor as an EthAccount, map it in the init actor (without a robust address)
  • everything else is just a CodeID update, and has the new Address field nil

Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

Approved with one nit

builtin/v10/migration/top.go Outdated Show resolved Hide resolved
return cid.Undef, xerrors.Errorf("failed to make eth zero address: %w", err)
}

migrations[oldInitCodeCID] = initActorMigrator{OutCodeCID: newInitCodeCID, EthZeroAddress: ethZeroAddr}
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see. Yeah.... that's not so fun. Could we just apply it as an implicit message? Or is that not allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's not so fun? Manipulating the init actor state like this? It's...not too different from stuff what we've done before.

We could apply an implicit message after the migration has run (so in Lotus, after we've done all the code CID transformations and such). But I'm generally comfortable with this (honestly we did much more in the v17 migration).

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

return cid.Undef, xerrors.Errorf("failed to set EAM Actor: %w", err)
}

// Create the EthZeroAddress as an EthAccount
Copy link
Member

Choose a reason for hiding this comment

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

I'm not seeing us create it. Are we just checking to see if it exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WDYM? There's basically 2 steps to "creating" it:

  • Assigning it an ID in the init actor (happens as part of the init actor migration)
  • Adding that ID to the state tree as an EthAccount, which happens ~25 lines after this comment.

We're not assigning it a robust address, but that seemed okay to me?

Copy link
Member

Choose a reason for hiding this comment

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

Assigning it an ID in the init actor (happens as part of the init actor migration)

Ah, this is what I was looking for. You're right, we're creating the actor here, we've already assigned the address.

@arajasek arajasek merged commit 890a364 into master Dec 22, 2022
@arajasek arajasek deleted the asr/migration branch December 22, 2022 18:01
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.

3 participants