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

Use is_controlling_address in actors #948

Merged
merged 4 commits into from
Jan 24, 2023
Merged

Conversation

sudo-shashank
Copy link
Contributor

@sudo-shashank sudo-shashank commented Dec 14, 2022

Replace existing control address accessor with new is_controlling_address

Closes #816

@anorth
Copy link
Member

anorth commented Dec 14, 2022

I look forward to this, but please target master for this one.

@arajasek
Copy link
Contributor

@anorth I think the right target branch is integration/builtin-api, since the APIs work isn't in master yet (and won't be until FIP-0050 is accepted)

@sudo-shashank sudo-shashank changed the base branch from next to integration/builtin-api December 15, 2022 16:11
@sudo-shashank sudo-shashank changed the base branch from integration/builtin-api to master December 15, 2022 16:11
@sudo-shashank sudo-shashank changed the base branch from master to next December 15, 2022 16:12
@anorth
Copy link
Member

anorth commented Dec 15, 2022

Sorry, yes @arajasek is correct

@sudo-shashank sudo-shashank force-pushed the shashank/control-address-#816 branch from 8eb879a to 57eec94 Compare December 16, 2022 08:04
@sudo-shashank sudo-shashank changed the base branch from next to integration/builtin-api December 16, 2022 08:04
@sudo-shashank
Copy link
Contributor Author

@anorth some test cases are failing with failed to get a readonly copy of the state with the use of is_controlling_address
am i missing something here?

@sudo-shashank sudo-shashank marked this pull request as ready for review January 3, 2023 21:16
@sudo-shashank sudo-shashank requested a review from anorth January 5, 2023 03:29
@arajasek arajasek force-pushed the integration/builtin-api branch 3 times, most recently from 6001a12 to 07b4f5d Compare January 12, 2023 15:56
@sudo-shashank sudo-shashank force-pushed the shashank/control-address-#816 branch 7 times, most recently from b8c70be to b6876d2 Compare January 18, 2023 11:37
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

This looks like the right direction now. Please re-request review when the tests are passing.

@@ -26,13 +26,27 @@ pub mod miner {
use super::*;

pub const CONTROL_ADDRESSES_METHOD: u64 = 2;
Copy link
Member

Choose a reason for hiding this comment

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

I hope you can remove this constant and the associated params object now it's unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i will

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anorth didn't remove this because it's also used in escrow_address

let (owner_addr, worker_addr, _) = request_miner_control_addrs(rt, nominal)?;

Copy link
Contributor Author

@sudo-shashank sudo-shashank Jan 19, 2023

Choose a reason for hiding this comment

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

we can rename this to request_miner_addrs if that is more suitable

Copy link
Member

Choose a reason for hiding this comment

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

@anorth
Copy link
Member

anorth commented Jan 18, 2023

We've now merged integration/builtin-api into master, so this can be rebased on master.

@sudo-shashank sudo-shashank force-pushed the shashank/control-address-#816 branch 2 times, most recently from 508b521 to 609845b Compare January 19, 2023 15:02
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2023

Codecov Report

Merging #948 (3d501f9) into master (e28bc90) will decrease coverage by 2.14%.
The diff coverage is 90.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #948      +/-   ##
==========================================
- Coverage   89.36%   87.22%   -2.14%     
==========================================
  Files          93       93              
  Lines       19590    19834     +244     
==========================================
- Hits        17507    17301     -206     
- Misses       2083     2533     +450     
Impacted Files Coverage Δ
actors/market/src/lib.rs 63.66% <85.71%> (-27.36%) ⬇️
actors/market/src/ext.rs 90.00% <100.00%> (-10.00%) ⬇️
test_vm/src/util.rs 93.67% <100.00%> (-6.24%) ⬇️
actors/miner/src/deadline_info.rs 79.77% <0.00%> (-16.86%) ⬇️
actors/verifreg/src/state.rs 90.10% <0.00%> (-9.36%) ⬇️
test_vm/src/lib.rs 88.91% <0.00%> (-0.46%) ⬇️
actors/power/src/lib.rs 83.58% <0.00%> (+0.21%) ⬆️
... and 1 more

@sudo-shashank sudo-shashank changed the base branch from integration/builtin-api to master January 19, 2023 15:23
@sudo-shashank sudo-shashank changed the base branch from master to integration/builtin-api January 19, 2023 15:23
@sudo-shashank sudo-shashank force-pushed the shashank/control-address-#816 branch from 609845b to 8794be0 Compare January 19, 2023 17:23
@sudo-shashank sudo-shashank changed the base branch from integration/builtin-api to master January 19, 2023 17:24
@sudo-shashank sudo-shashank force-pushed the shashank/control-address-#816 branch from 8794be0 to 3d501f9 Compare January 19, 2023 17:33
@sudo-shashank sudo-shashank requested a review from anorth January 19, 2023 18:08
@sudo-shashank
Copy link
Contributor Author

@anorth this PR is ready for review

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

Thanks. Are there any other actors that use this (for a follow-up PR?)

IpldBlock::serialize_cbor(&ext::miner::IsControllingAddressParam { address: caller })?,
TokenAmount::zero(),
)?)?;
let caller_ok = res.is_controlling;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: inline the caller_ok variable.

@@ -166,6 +166,34 @@ pub fn expect_provider_control_address(
expect_get_control_addresses(rt, provider, owner, worker, vec![])
}

pub fn expect_get_is_control_addresses(
Copy link
Member

Choose a reason for hiding this comment

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

This method has the wrong name. I think you should inline it into expect_provider_is_control_address, which is otherwise doing nothign.

@sudo-shashank
Copy link
Contributor Author

Thanks. Are there any other actors that use this (for a follow-up PR?)

No i didn't find any other actor that uses this

@anorth anorth enabled auto-merge (squash) January 24, 2023 19:07
@anorth anorth merged commit f1d0fb0 into master Jan 24, 2023
@anorth anorth deleted the shashank/control-address-#816 branch January 24, 2023 19:28
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
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.

Replace fetching control addresses with IsControllingAddress
4 participants