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

Market actor implementation #338

Merged
merged 15 commits into from
Apr 10, 2020
Merged

Market actor implementation #338

merged 15 commits into from
Apr 10, 2020

Conversation

dutterbutter
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Added market actor and its types
  • Updated transaction method params

Reference issue to close (if applicable)

Closes #264

Other information and links

vm/src/error.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/paych/state.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/types.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/types.rs Outdated 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/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 Show resolved Hide resolved
@austinabell
Copy link
Contributor

austinabell commented Apr 10, 2020

CI is broken because you reverted the submodule changes after you merged in commit 5c6ccee

To fix either undo that commit, or just cd into that submodule and do a git pull (pretty sure the latter should work if you commit the change, but it may not if you have the submodule cached locally)

vm/src/error.rs Outdated Show resolved Hide resolved
vm/Cargo.toml Outdated 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/mod.rs Outdated 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/mod.rs Outdated 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/mod.rs Outdated 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/mod.rs Outdated 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/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Show resolved Hide resolved
@dutterbutter dutterbutter requested a review from ec2 April 10, 2020 15:09
Comment on lines 353 to 365
let epoch_value = params
.sector_expiry
.checked_sub(rt.curr_epoch())
.ok_or_else(|| {
ActorError::new(
ExitCode::ErrIllegalArgument,
format!(
"invalid sector expiry epoch {:?} ahead of current {:?}",
params.sector_expiry,
rt.curr_epoch()
),
)
})?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this may sound weird, but you actually need to do

.checked_sub(..).unwrap_or(1u8)

lol

I thought through the logic and their impl doesn't error when this value is negative, so this needs to succeed, divide 0 by a valid number and return successfully and/or panic on a divide by 0

filecoin-project/specs-actors#280

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/mod.rs Outdated 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement updated market actor
3 participants