Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b4797f1 to
66a9c00
Compare
just-mitch
left a comment
There was a problem hiding this comment.
Nice. Minor comments.
| vm.prank(SLASHER); | ||
| staking.slash(ATTESTER, MINIMUM_STAKE / 2); | ||
|
|
||
| assertEq(stakingAsset.balanceOf(address(staking)), MINIMUM_STAKE); |
There was a problem hiding this comment.
Would maybe be good to show that the gse has 0 balance here
|
|
||
| vm.prank(SLASHER); | ||
| staking.slash(ATTESTER, depositAmount / 2); | ||
| staking.slash(ATTESTER, MINIMUM_STAKE / 2); |
There was a problem hiding this comment.
good to show the LIVING status here I think
| rollupAddress: Hex, | ||
| stakingAssetAddress: Hex, | ||
| validators: Hex[], | ||
| validators: Operator[], |
There was a problem hiding this comment.
unrelated to this PR, but we can probably remove the cheat_ from this function name
There was a problem hiding this comment.
Will rename it to addMultipleValidators it is only used in here directly, so seems like a neat tiny fix.
| error Staking__NotWithdrawer(address, address); // 0x8e668e5d | ||
| error Staking__NothingToExit(address); // 0xd2aac9b6 | ||
| error Staking__WithdrawalNotUnlockedYet(Timestamp, Timestamp); // 0x88e1826c | ||
| error Staking__WithdrawFailed(address); |
There was a problem hiding this comment.
| error Staking__WithdrawFailed(address); | |
| error Staking__WithdrawFailed(address); // 0x377422c1 |
There was a problem hiding this comment.
At this point the number of errors here and there are kinda pain to update. Might add something to the bootstrap so we just spit a file out that have all the errors and event codes and such to make it simpler to keep up to date, pretty sure that some of the hexes here and there are broken
| canonical.push(block.timestamp.toUint32(), uint224(uint160(_rollup))); | ||
| } | ||
|
|
||
| function deposit(address _attester, address _proposer, address _withdrawer, bool _onCanonical) |
There was a problem hiding this comment.
might explain how you can serve as an attester on multiple versions?
|
|
||
| STAKING_ASSET.transfer(msg.sender, amountWithdrawn); | ||
|
|
||
| return (amountWithdrawn, removed); |
There was a problem hiding this comment.
All good, but the semantics/names are a little confusing when the amount reduces below the min balance, because the "amountWithdrawn" doesn't reflect the slashed amount.
There was a problem hiding this comment.
The function is not doing any slashing, but just withdrawing, which can be used as part of slashing, but the rollup needs to deal with the logic itself. Have extended the natspec comment.
66a9c00 to
c58f22d
Compare
Docs PreviewYou can check your preview here. |
c7229db to
c58ae65
Compare
| }), | ||
| }); | ||
|
|
||
| // Hand over the registry to the governance |
There was a problem hiding this comment.
| // Hand over the registry to the governance | |
| // Hand over the GSE to the governance |
| await Promise.all(txHashes.map(txHash => extendedClient.waitForTransactionReceipt({ hash: txHash }))); | ||
| }; | ||
|
|
||
| export type Operator = { |
There was a problem hiding this comment.
Observational nit here would be that Operator carries multiple meanings in realtion to ATPs and elsewhere, this could maybe be RollupOperator or ValidatorTuple or something (no change required just a comment)
There was a problem hiding this comment.
Might make sense to deal with as part of #14287.
| indices[i] = i; | ||
| } | ||
|
|
||
| return _getAddressFromIndecesAtTimestamp(_instance, indices, _timestamp); |
There was a problem hiding this comment.
| return _getAddressFromIndecesAtTimestamp(_instance, indices, _timestamp); | |
| return _getAddressFromIndicesAtTimestamp(_instance, indices, _timestamp); |
same elsewhere
| override(IGSE) | ||
| returns (address[] memory) | ||
| { | ||
| // @todo Throw me in jail for this crime against humanity |
There was a problem hiding this comment.
I stand by the statement.
| * @dev Must be the current canonical for `_onCanonical = true` to be valid. | ||
| */ | ||
| function deposit(address _attester, address _proposer, address _withdrawer, bool _onCanonical) | ||
| external |
There was a problem hiding this comment.
i guess we now dont allow depositing more than the mimumim if you feel like it. It also is not clear how it can be topped up
There was a problem hiding this comment.
Atm no topup, same as it was before.
Fixes #13870 and the staking portion of #13871. Starts the work for the staking escrow (not fully tested but more tests also needed along with the governance part of it, so in a decent spot). Notable changes: - as a shared contract there is now the GSE that is escrowing funds staked, and support moving it along. - it is another contract that must be called when adding a new rollup if it is to move along, since it is too dangerous to just move it along in the hopes that the rollup will work similar to the old one. - starts the work to have different values for deposit and staying staked, but atm they are set to the same value to not make this pr even bigger than it already is - see #14304 - deployments in ts are passing along a full "operator" or validator, e.g., the set of addresses instead of just a single address and using that for all. - updates the staking handler to by default follow the canonical.
Fixes #13870 and the staking portion of #13871. Starts the work for the staking escrow (not fully tested but more tests also needed along with the governance part of it, so in a decent spot). Notable changes: - as a shared contract there is now the GSE that is escrowing funds staked, and support moving it along. - it is another contract that must be called when adding a new rollup if it is to move along, since it is too dangerous to just move it along in the hopes that the rollup will work similar to the old one. - starts the work to have different values for deposit and staying staked, but atm they are set to the same value to not make this pr even bigger than it already is - see #14304 - deployments in ts are passing along a full "operator" or validator, e.g., the set of addresses instead of just a single address and using that for all. - updates the staking handler to by default follow the canonical.

Fixes #13870 and the staking portion of #13871.
Starts the work for the staking escrow (not fully tested but more tests also needed along with the governance part of it, so in a decent spot).
Notable changes: