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

Power actor: Export methods to CreateMiner and get miner counts #868

Merged
merged 3 commits into from
Nov 23, 2022

Conversation

arajasek
Copy link
Contributor

As in the title.

@arajasek arajasek requested a review from anorth November 23, 2022 21:12
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2022

Codecov Report

❗ No coverage uploaded for pull request base (integration/builtin-api@be02e09). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##             integration/builtin-api     #868   +/-   ##
==========================================================
  Coverage                           ?   88.23%           
==========================================================
  Files                              ?       96           
  Lines                              ?    19912           
  Branches                           ?        0           
==========================================================
  Hits                               ?    17570           
  Misses                             ?     2342           
  Partials                           ?        0           

actors/power/src/lib.rs Outdated Show resolved Hide resolved
let st: State = rt.state()?;

Ok(MinerConsensusCountReturn { miner_consensus_count: st.miner_above_min_power_count })
}
Copy link
Member

Choose a reason for hiding this comment

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

I reckon we should just merge these into a single method with compound return value. There's no extra cost/work in one vs the other: they're both vanilla state reads

Copy link
Member

Choose a reason for hiding this comment

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

You convinced me otherwise.

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
let st: State = rt.state()?;

Ok(MinerConsensusCountReturn { miner_consensus_count: st.miner_above_min_power_count })
}
Copy link
Member

Choose a reason for hiding this comment

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

You convinced me otherwise.

@arajasek arajasek merged commit 044fd0d into integration/builtin-api Nov 23, 2022
@arajasek arajasek deleted the asr/power-apis branch November 23, 2022 22:56
arajasek added a commit that referenced this pull request Nov 23, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 27, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 28, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 28, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 29, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 30, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Nov 30, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Dec 5, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Dec 7, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
vyzo pushed a commit that referenced this pull request Dec 7, 2022
* Remove the market actor state mutation pattern (#734)

Fixes #656

* Proof of concept exported API for Account actor (#797)

* Export stable methods for public access (#807)

* Export Datacap Actor methods

* Export Init Actor methods

* Export Market Actor methods

* Export Miner Actor methods

* Export Multisig Actor methods

* Export Verifreg Actor methods

* Address review

* Restrict internal APIs of all actors (#809)

* Exported API method for market actor escrow/locked balance (#812)

* Power actor: Add exported getters for raw power (#810)

* Power actor: Add exported getters for raw power

* FRC-XXXX is FRC-0042

* Power actor: network_raw_power: Return this_epoch_raw_byte_power

* Power actor: miner_raw_power: Return whether above consensus min power

* Power actor: types: serialize one-element structs transparently

* Address review

* Miner actor: Add exported getters for info and monies (#811)

* Miner actor: Add exported getters for info and monies

* Tweak comment

* Miner actor: Replace GetWorker and GetControls with IsControllingAddress

* Miner actor: Add exported GetAvailableBalance

* Miner actor: Add exported GetVestingFunds

* Miner actor: Remove exported monies getters

* Miner actor: types: serialize one-element structs transparently

* Address review

* Address review

* Built-in market API for deal proposal metadata (#818)

* Call exported authenticate method from PSD (#829)


Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>

* Drop CALLER_TYPES_SIGNABLE and signable caller validation (#821)

* Market actor: Minor improvements to two exported getters (#826)

* Market actor: GetDealTermExported: Return (start_epoch, duration)

* Market actor: Export getter for deal total price

* Exported API for market deal activation state (#819)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs (#824)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs

* Address review

* Address review

* Account actor: Deprecate AuthenticateMessage (#856)

* Market actor: Export PublishStorageDeals (#857)

* Miner: Export several more methods (#863)

* Miner: Export ChangeWorkerAddress

* Miner: Export ChangePeerID

* Miner: Export WithdrawBalance

* Miner: Export ChangeMultiaddrs

* Miner: Export ConfirmUpdateWorkerKey

* Miner: Export RepayDebt

* Miner: Export ChangeOwnerAddress

* Miner: Add exported getters for PeerID & multiaddrs

* Miner: Refactor: Rename ConfirmUpdateWorkerKey to ConfirmChangeWorkerAddress

* Power actor: Export methods to CreateMiner and get miner counts (#868)

* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

* Verifreg: Export AddVerifiedClient and GetClaims (#873)

* Verifreg: Rename AddVerifierClientParams to AddVerifiedClientParams

* Verifreg: Export AddVerifiedClient and GetClaims

* Datacap actor: Modify exported methods (#909)

* Datacap: Export Mint and Destroy

* Datacap actor: Deprecate all internal methods

* Datacap actor: Rename BalanceOf to Balance

* Datacap actor: Add Granularity method

* fix: comments on newly exported methods (#910)

Co-authored-by: RK <r.raajey@gmail.com>
Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
Co-authored-by: ZenGround0 <5515260+ZenGround0@users.noreply.github.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
arajasek added a commit that referenced this pull request Dec 11, 2022
* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
arajasek added a commit that referenced this pull request Jan 12, 2023
* Proof of concept exported API for Account actor (#797)

* Export stable methods for public access (#807)

* Export Datacap Actor methods

* Export Init Actor methods

* Export Market Actor methods

* Export Miner Actor methods

* Export Multisig Actor methods

* Export Verifreg Actor methods

* Address review

* Restrict internal APIs of all actors (#809)

* Exported API method for market actor escrow/locked balance (#812)

* Power actor: Add exported getters for raw power (#810)

* Power actor: Add exported getters for raw power

* FRC-XXXX is FRC-0042

* Power actor: network_raw_power: Return this_epoch_raw_byte_power

* Power actor: miner_raw_power: Return whether above consensus min power

* Power actor: types: serialize one-element structs transparently

* Address review

* Miner actor: Add exported getters for info and monies (#811)

* Miner actor: Add exported getters for info and monies

* Tweak comment

* Miner actor: Replace GetWorker and GetControls with IsControllingAddress

* Miner actor: Add exported GetAvailableBalance

* Miner actor: Add exported GetVestingFunds

* Miner actor: Remove exported monies getters

* Miner actor: types: serialize one-element structs transparently

* Address review

* Address review

* Built-in market API for deal proposal metadata (#818)

* Call exported authenticate method from PSD (#829)


Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>

* Drop CALLER_TYPES_SIGNABLE and signable caller validation (#821)

* Market actor: Minor improvements to two exported getters (#826)

* Market actor: GetDealTermExported: Return (start_epoch, duration)

* Market actor: Export getter for deal total price

* Exported API for market deal activation state (#819)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs (#824)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs

* Address review

* Address review

* Account actor: Deprecate AuthenticateMessage (#856)

* Market actor: Export PublishStorageDeals (#857)

* Miner: Export several more methods (#863)

* Miner: Export ChangeWorkerAddress

* Miner: Export ChangePeerID

* Miner: Export WithdrawBalance

* Miner: Export ChangeMultiaddrs

* Miner: Export ConfirmUpdateWorkerKey

* Miner: Export RepayDebt

* Miner: Export ChangeOwnerAddress

* Miner: Add exported getters for PeerID & multiaddrs

* Miner: Refactor: Rename ConfirmUpdateWorkerKey to ConfirmChangeWorkerAddress

* Power actor: Export methods to CreateMiner and get miner counts (#868)

* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

* Verifreg: Export AddVerifiedClient and GetClaims (#873)

* Verifreg: Rename AddVerifierClientParams to AddVerifiedClientParams

* Verifreg: Export AddVerifiedClient and GetClaims

* Datacap actor: Modify exported methods (#909)

* Datacap: Export Mint and Destroy

* Datacap actor: Deprecate all internal methods

* Datacap actor: Rename BalanceOf to Balance

* Datacap actor: Add Granularity method

* fix: comments on newly exported methods (#910)

* Miner: Export method to GetPendingOwner

* MarketNotifyDeal (#944)


Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>

* Verifreg: Call AuthenticateMessage instead of validating siggys

* Multisig: Do not export any functionality (#967)

* use const for EX_DEAL_EXPIRED (#954)

* Address review

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
Co-authored-by: ZenGround0 <5515260+ZenGround0@users.noreply.github.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
Co-authored-by: Shashank <99187193+sudo-shashank@users.noreply.github.com>
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
…coin-project#868)

* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
…ecoin-project#1004)

* Proof of concept exported API for Account actor (filecoin-project#797)

* Export stable methods for public access (filecoin-project#807)

* Export Datacap Actor methods

* Export Init Actor methods

* Export Market Actor methods

* Export Miner Actor methods

* Export Multisig Actor methods

* Export Verifreg Actor methods

* Address review

* Restrict internal APIs of all actors (filecoin-project#809)

* Exported API method for market actor escrow/locked balance (filecoin-project#812)

* Power actor: Add exported getters for raw power (filecoin-project#810)

* Power actor: Add exported getters for raw power

* FRC-XXXX is FRC-0042

* Power actor: network_raw_power: Return this_epoch_raw_byte_power

* Power actor: miner_raw_power: Return whether above consensus min power

* Power actor: types: serialize one-element structs transparently

* Address review

* Miner actor: Add exported getters for info and monies (filecoin-project#811)

* Miner actor: Add exported getters for info and monies

* Tweak comment

* Miner actor: Replace GetWorker and GetControls with IsControllingAddress

* Miner actor: Add exported GetAvailableBalance

* Miner actor: Add exported GetVestingFunds

* Miner actor: Remove exported monies getters

* Miner actor: types: serialize one-element structs transparently

* Address review

* Address review

* Built-in market API for deal proposal metadata (filecoin-project#818)

* Call exported authenticate method from PSD (filecoin-project#829)

Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>

* Drop CALLER_TYPES_SIGNABLE and signable caller validation (filecoin-project#821)

* Market actor: Minor improvements to two exported getters (filecoin-project#826)

* Market actor: GetDealTermExported: Return (start_epoch, duration)

* Market actor: Export getter for deal total price

* Exported API for market deal activation state (filecoin-project#819)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs (filecoin-project#824)

* Paych actor: Drop account req, use AuthenticateMessage to verify sigs

* Address review

* Address review

* Account actor: Deprecate AuthenticateMessage (filecoin-project#856)

* Market actor: Export PublishStorageDeals (filecoin-project#857)

* Miner: Export several more methods (filecoin-project#863)

* Miner: Export ChangeWorkerAddress

* Miner: Export ChangePeerID

* Miner: Export WithdrawBalance

* Miner: Export ChangeMultiaddrs

* Miner: Export ConfirmUpdateWorkerKey

* Miner: Export RepayDebt

* Miner: Export ChangeOwnerAddress

* Miner: Add exported getters for PeerID & multiaddrs

* Miner: Refactor: Rename ConfirmUpdateWorkerKey to ConfirmChangeWorkerAddress

* Power actor: Export methods to CreateMiner and get miner counts (filecoin-project#868)

* Power: Export CreateMiner

* Power Actor: Export MinerCount and MinerConsensusCount

* Update actors/power/src/lib.rs

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>

* Verifreg: Export AddVerifiedClient and GetClaims (filecoin-project#873)

* Verifreg: Rename AddVerifierClientParams to AddVerifiedClientParams

* Verifreg: Export AddVerifiedClient and GetClaims

* Datacap actor: Modify exported methods (filecoin-project#909)

* Datacap: Export Mint and Destroy

* Datacap actor: Deprecate all internal methods

* Datacap actor: Rename BalanceOf to Balance

* Datacap actor: Add Granularity method

* fix: comments on newly exported methods (filecoin-project#910)

* Miner: Export method to GetPendingOwner

* MarketNotifyDeal (filecoin-project#944)

Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>

* Verifreg: Call AuthenticateMessage instead of validating siggys

* Multisig: Do not export any functionality (filecoin-project#967)

* use const for EX_DEAL_EXPIRED (filecoin-project#954)

* Address review

Co-authored-by: Alex <445306+anorth@users.noreply.github.com>
Co-authored-by: ZenGround0 <5515260+ZenGround0@users.noreply.github.com>
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
Co-authored-by: Shashank <99187193+sudo-shashank@users.noreply.github.com>
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.

4 participants