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

Replace Map with Map2 in miner actor #1523

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Replace Map with Map2 in miner actor #1523

merged 1 commit into from
Feb 26, 2024

Conversation

anorth
Copy link
Member

@anorth anorth commented Feb 22, 2024

For #1346. This is the last direct use of Map by actors, the others are embedded inside other structures like Set.

"failed to construct empty precommit map",
)
})?;
PreCommitMap::empty(store, PRECOMMIT_CONFIG, "precommits").flush()?;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PreCommitMap::empty(store, PRECOMMIT_CONFIG, "precommits").flush()?;
PreCommitMap::empty(store, PRECOMMIT_CONFIG, "pre_committed_sectors").flush()?;

Maybe stick to names that match the state names so there's no ambiguity? There's a lot of these to replace though. s/"precommits"/"pre_committed_sectors"/g

Copy link
Member Author

@anorth anorth Feb 26, 2024

Choose a reason for hiding this comment

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

This is not a bad suggestion, but is not the existing pattern (all by me) either. The labels here are for easy reading independent of renames that might happen in the code. The code names are not necessarily good, and some such collections are not even named (when nested in others).

E.g. in the market

SectorDealsMap::load(store, sectors_root, SECTOR_DEALS_CONFIG, "sector deals")

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.

looks much cleaner to me; aside from the single minor nit about naming for clearer error cases

@anorth anorth added this pull request to the merge queue Feb 26, 2024
Merged via the queue into master with commit ca68aa2 Feb 26, 2024
14 checks passed
@anorth anorth deleted the anorth/map2 branch February 26, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

3 participants