-
Notifications
You must be signed in to change notification settings - Fork 102
feat: Allow VerifiedClient DataCap to be topped up #1390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but please wait for approval from @ZenGround0
func (h *verifRegActorTestHarness) addVerifiedClient(rt *mock.Runtime, verifier, client address.Address, caps ...verifreg.DataCap) { | ||
// caps[0] expects allowance to be set | ||
// caps[1] (optional) expected allowance to be verified | ||
// additional args are ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail the test rather than ignore an unexpected argument. Fail also if the slice has length zero.
Alternatively, I would be just as happy if the two args were explicit, and the usually-redundant expected cap was always explicitly passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to change this to two explict arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your week of work is over @placer14 I'm taking this PR over. I'm going to make some changes to testing but the code change looks good.
func (h *verifRegActorTestHarness) addVerifiedClient(rt *mock.Runtime, verifier, client address.Address, caps ...verifreg.DataCap) { | ||
// caps[0] expects allowance to be set | ||
// caps[1] (optional) expected allowance to be verified | ||
// additional args are ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to change this to two explict arguments.
ca8050d
to
c02e51f
Compare
* feat: Allow VerifiedClient DataCap to be topped up * Modify tests Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
* feat: Allow VerifiedClient DataCap to be topped up * Modify tests Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
* feat: Allow VerifiedClient DataCap to be topped up * Modify tests Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
* feat: Allow VerifiedClient DataCap to be topped up * Modify tests Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
* v5 actors * feat: Adjust consensus fault reward to meet FIL-0011 * feat: Allow VerifiedClient DataCap to be topped up (#1390) * Remove out of date test * Update to go 1.16 * Remove old migration and simplify agent tests Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com> Co-authored-by: Mike Greenberg <mike.greenberg@protocol.ai>
Implements FIP-0012 and fixes #1325.
Thoughts on these changes:
addVerifiedClient
function is now overloaded to support an optionalexpectedAllowance
arg to be used in the cases where VerifiedClients will now have more than what was initially allotted. This makes the verification of anexpectedAllownace
a concern on the caller rather than letting the function reflect on its internal before/after state to verify correctness. I'd personally prefer the latter to keep the call simple, but there were errors when I attempted to access the runtime map for the "before" state of the Client's DataCap allowance. (An example of that is at https://gist.github.com/placer14/f2134a4064373607da44b48b4f338d69.)