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

Refactor LookupID* APIs in StateManager and StateTree #11919

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

masih
Copy link
Member

@masih masih commented Apr 23, 2024

Related Issues

Proposed Changes

The naming of LookupID can cause confusion when resolving actor IDs vs
ID addresses. To avoid this:

  • Refactor StateTree LookupID to LookupIDAddress, because it returns ID address.
  • Refactor StateManager LookupID to LookupIDAddress because it also returns ID address via a chain call to StateTree.
  • Introduce a new API StateManager dedicated to resolving address to actor ID, called LookupID which returns abi.ActorID.

Additional Info

For context, see:

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@masih masih requested a review from Stebalien April 23, 2024 11:50
@masih masih marked this pull request as ready for review April 23, 2024 11:50
chain/stmgr/stmgr.go Show resolved Hide resolved
chain/stmgr/stmgr.go Outdated Show resolved Hide resolved
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

sgtm

It has me wondering whether we should have a label, or some other way to identify breaking changes so we can keep them separate and call them out specifically. The distinction between breaking code API changes vs breaking RPC API changes also seems worth separating out too, because this change is going to be much less impactful than an RPC API change. @rjan90 what do you think? Maybe at a minimum we should ensure we add a CHANGELOG entry in a PR like this to call out the change for anyone using lotus as a library.

The naming of `LookupID` can cause confusion when resolving actor IDs vs
 ID addresses. To avoid this:

* Refactor `StateTree` `LookupID` to `LookupIDAddress`, because it
returns ID address.
* Refactor `StateManager` `LookupID` to
`LookupIDAddress` because it also returns ID address via a chain call to
`StateTree`.
* Introduce a new API `StateManager` dedicated to resolving address to
actor ID, called `LookupID` which returns `abi.ActorID`.

For context, see:
 * #11723 (comment)
@masih masih force-pushed the masih/stmgr-resolve-actor-id branch from 477e450 to 5bb53e8 Compare April 24, 2024 08:40
@masih masih removed the request for review from Stebalien April 24, 2024 08:41
@masih masih enabled auto-merge (rebase) April 24, 2024 08:41
@masih masih merged commit f907354 into master Apr 24, 2024
186 checks passed
@masih masih deleted the masih/stmgr-resolve-actor-id branch April 24, 2024 14:25
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