-
Notifications
You must be signed in to change notification settings - Fork 1
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
SM-385 CLI #186
SM-385 CLI #186
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.
Just a couple minors
@@ -224,6 +230,7 @@ contract StakingOrchestrator is IStakingOrchestrator, Initializable, AccessContr | |||
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); | |||
_grantRole(onlyOwner, msg.sender); | |||
_grantRole(onlyStakingManager, address(_syloStakingManager)); | |||
_grantRole(onlyStakingManager, address(_seekerStakingManager)); |
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 think we should create a seperate role for this
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.
It's intended for the onlyStakingManager
to cover both roles. Seems redundant to define two distinct roles
contracts/Directory.sol
Outdated
DirectoryEntry memory entry; | ||
DirectoryEntry[] memory entries = directories[cycleId][periodId].entries; | ||
|
||
for (uint256 i; i < entryLength; ++i) { | ||
entry = entries[i]; | ||
nodes[i] = entry.stakee; | ||
boundaries[i] = entry.boundary; | ||
} | ||
|
||
return (nodes, boundaries); |
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.
Whats the reason for storing a varibale in entry here ?
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.
Also what is the benefit in returning the boundaries ?
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.
It is just a generally useful utility method for debugging. Allows us to see all of the nodes that have joined a directory, and what staking value they joined with.
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.
It also allows a local client to perform the scan method locally which is benefecial if it knows it will need to call scan multiple times for the same directory.
|
||
## Build docker | ||
|
||
```sh | ||
yarn docker-ganache | ||
``` | ||
|
||
## Run docker | ||
|
||
The options used to run the local ganache node should be set correctly | ||
to ensure that it re-uses the same directory for the chain state. | ||
|
||
```sh | ||
docker run -p 8545:8545 dn3010/sylo-ethereum-testnet:0.1.0 `bash -c ganache-cli --host 0.0.0.0 --db ganache-data --blockTime 5` |
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 think these need editing
This is a supporting PR for SM-385. It's main contribution is that it re-implements the deployment script, and also the initialisation script for the local test network.
We also move from
ganache -> foundry anvil
for the local test node. Ganache has been deprecated, whilst anvil is still being supported, and allows us to save chain state with the--state state.json
option.Testing the CLI has also prompted some minor changes/fixes in the contract code, which has been included in this PR as well. These changes include: