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

Updates market actor #496

Merged
merged 12 commits into from
Jun 18, 2020
Merged

Updates market actor #496

merged 12 commits into from
Jun 18, 2020

Conversation

dutterbutter
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • updates market actor to the following commit
  • Updated set_multimap
  • Added verified actor registry actor code

Please advise on the best way to handle some of the errors in market_state, as you will see its not quite 1:1 at the moment since they are mixing err types.

Reference issue to close (if applicable)

Closes #461

Other information and links

vm/actor/src/builtin/codes.rs Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/state.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/state.rs Outdated Show resolved Hide resolved
@@ -111,60 +362,51 @@ impl State {
})
}

pub(super) fn maybe_lock_balance<BS: BlockStore>(
fn maybe_lock_balance<BS: BlockStore>(
&mut self,
store: &BS,
addr: &Address,
amount: &TokenAmount,
) -> Result<(), ActorError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This fn should now not return an actor error, since it might cause issues with the caller assuming the exit code is handled correctly (which it isn't here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, this will return an Actor Error due to the usage of get_locked_balance and get_escrow_balance returning an ActorError.

vm/actor/src/builtin/market/state.rs Outdated Show resolved Hide resolved
vm/actor/src/util/set_multimap.rs Outdated Show resolved Hide resolved
vm/actor/tests/set_multimap_test.rs Outdated Show resolved Hide resolved
@austinabell austinabell added the Spec Change Updates to implementation required due to a Filecoin spec change after implementation label Jun 11, 2020
})?;
.map_err(|e| ActorError::new(ExitCode::ErrIllegalState, e.into()))?;

if deal.is_some() {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also do

deal.ok_or_else(|_|ActorError::new(ExitCode::ErrIllegalArgument,format!("given deal already included in another sector: {}", id)))?

@dutterbutter dutterbutter merged commit 0f1dba0 into master Jun 18, 2020
@dutterbutter dutterbutter deleted the dustin/market-updates branch June 18, 2020 17:02
timvermeulen pushed a commit that referenced this pull request Jun 22, 2020
* initial market actor updates

* fix market actor errs

* fix linting issue

* made requested changes

* update error msg

* added verifreg to internal send and mockrt

* updated multimap error handling
timvermeulen added a commit that referenced this pull request Jun 26, 2020
* Bitfield improvements

* Store prefix bits in separate variables

* Use the `Result` type alias in reader.rs

* Remove unused dependency

* Avoid creating vectors unnecessarily

* Rename union to merge

* Rename multi_union to union

* Combine first access with is_empty check

* Avoid traversing `self.unset` up front in `BitField::iter`

* Updates market actor (#496)

* initial market actor updates

* fix market actor errs

* fix linting issue

* made requested changes

* update error msg

* added verifreg to internal send and mockrt

* updated multimap error handling

* Update proofs to v4 (#507)

* Bump dep versions

* Refactor to new proofs types

* Switch to from trait and cleanup

* Update bootnodes and genesis for testnet (#509)

* Remove unnecessary >=

* Get rid of redundant `get_mut`

* Add UnverifiedBitField type in order to deserialize a bit field without verifying it

* Rename RLEPlus to RlePlus in accordance with Rust's naming conventions

* Remove pointless mutable reference

* Remove UnverifiedBitField

* Make sure that RlePlus::new returns an error on integer overflow

* Don't yield a run of length 0 whenever a short block has the value 0

Co-authored-by: Dustin Brickwood <dustinbrickwood204@gmail.com>
Co-authored-by: Austin Abell <austinabell8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spec Change Updates to implementation required due to a Filecoin spec change after implementation Status: Needs Review VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update market actor
3 participants