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
Add GSN to BasicAdapter, fix calculating number of registered darknodes after a Registry upgrade #86
Conversation
contracts/Shifter/IShifter.sol
Outdated
|
||
interface IInShifter { | ||
// function status(bytes32) external returns (bool); |
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.
If it is left commented out, it either needs a comment explaining why it has been left here, or it should be removed.
@noiach coveralls reports that tests are missing for |
I think that's the coverage for See https://coveralls.io/github/renproject/darknode-sol?branch=feat/adapter-with-gsn |
Coverage dropped (-0.08%) because of some GSN functions in an example contract that aren't tested. |
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.
Ok, thanks!
Note - Solidity's VSCode extension now comes with a source code formatter, so there's a lot of style-only changes. See below for the specific changes.
DarknodeRegistry update
Problem Description
The DarknodeRegistry contract currently keeps track of the number of darknodes registered in the previous, current and next epoch. However, this is independent of its Store contract which holds the registration state of each darknode. If a new Registry is used against an existing Store, these numbers are out of sync.
Solution
When the DarknodeRegistry is linked to a Store, is syncs its darknode counts.
The main change to DarknodeRegistry can be found here:
https://github.com/renproject/darknode-sol/pull/86/files#diff-b69098100468efec280620252f903886R716-R742
darknode-sol/contracts/DarknodeRegistry/DarknodeRegistry.sol
Lines 716 to 742 in 1679642
darknode-sol/contracts/DarknodeRegistry/DarknodeRegistry.sol
Lines 351 to 363 in 1679642
Add GSN to Basic Adapter
The BasicAdapter contract is an example adapter, and this PR adds GSN support to it. This involves inheriting from
GSNRecipient
and implementingacceptRelayedCall
. Currently, it accepts all relayed calls.