-
Notifications
You must be signed in to change notification settings - Fork 44
Require rewards - partial: Updates to contracts and clients #137
Require rewards - partial: Updates to contracts and clients #137
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.
Nice start!
contracts/contracts/Utilities.sol
Outdated
pragma solidity >=0.8.0 <0.9.0; | ||
pragma abicoder v2; | ||
|
||
contract Utilities { |
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.
No a huge fan of this name, very generic. Maybe Functions
, FunctionsUtilities
instead?
We could also add this to an existing contract such as VerificationGateway
or BLSExpander
so we can avoid another contract deploy.
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.
Hmm. They're very generic utilities though. In fact I'm kinda hoping this already exists in some form and we can use that instead of this.
Anyway, I renamed it to AggregatorUtilities
. Wdyt?
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.
We could also add this to an existing contract such as VerificationGateway or BLSExpander so we can avoid another contract deploy.
Adding to VerificationGateway
would increase the audit burden (and complexity that may be considered by users) though.
For BLSExpander
, it really doesn't fit. That contract is about compressing calldata for processBundle
.
Also, this may be out of date, but I believe there was some concern about the maximum allowed size of a contract and pushing up against that limit.
Is there much benefit in avoiding a contract deploy? Is it more efficient to deploy A+B functions into one contract than A functions into contract A and B functions into contract B?
contracts/contracts/Utilities.sol
Outdated
bytes returnValue; | ||
} | ||
|
||
function performSequence( |
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.
Would be good to have NatSpec comments/docs for this function and contract. Can do this as follow up.
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.
Done
Co-authored-by: Jacob Caban-Tomski <jacque006@users.noreply.github.com>
What is this PR doing?
This PR contributes to the larger work to require rewards in the aggregator.
That work is built on top of these changes to contracts, and clients - most importantly the new
Utilities
contract and its bindings.That's not everything though, so here's a list:
Utilities
contract with two methodsperformSequence
which takes a sequence of functions to call and returns all their results. This will allow the aggregator to test a sequence of bundles and figure out the rewards for each bundle resulting from executing in that sequence.ethBalanceOf
returns the eth balance of a contract to allow this to be represented as a function call so you can use it withperformSequence
. (For tokens, you can use the function call already, but there isn't one for eth).callStaticSequence
andcallStaticSequenceWithMeasure
inEthereumService
which provides an additional layer aroundperformSequence
allowing decoded types to be extracted (rather than the byte arrays that are actually returned byperformSequence
Fixture
How can these changes be manually tested?
Does this PR resolve or contribute to any issues?
Contributes to #133.
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors