skalenetwork/skale-manager

SyncManager smart contract

sync-by-unito opened this issue · 3 comments

SyncManager is a smartcontract on the mainnet that keeps a list of allowed sync IP address ranges.
https://skalelabs.atlassian.net/wiki/spaces/SKALE/pages/2287075329/SyncManager+Spec

This task includes adding scripts for further deployment to the mainnet

┆Issue is synchronized with this Jira Task

➤ Ganna Kulikova commented:

Code changes are ready, need confirmation on the release plan and when to merge

➤ Oleksandr Sydorenko commented:

Verified on https://rinkeby.etherscan.io/address/0x4098f35b66fc0dfeccc7679dea3e1746aedb3cba ( https://rinkeby.etherscan.io/address/0x4098f35b66fc0dfeccc7679dea3e1746aedb3cba )

Only user with defaultAdminRole able to grant SyncManagerRole
Access to add Ip ranges has the address with SyncManagerRole only (3 cases - user with access, the user without access, and user with revoke role)
Ip ranges successfully added to whitelist: user with SyncManagerRole is able to use the same IPs for different names but not able to use the same name - the name is a unique value.
Getters return valid values: range by index, range by name, range by name-range’s hex

Positive cases
grant role
https://rinkeby.etherscan.io/tx/0x205b18b2067cf1292d921cd937f92f9db941e196a7aee4fde9e08fd6321060f0 ( https://rinkeby.etherscan.io/tx/0x205b18b2067cf1292d921cd937f92f9db941e196a7aee4fde9e08fd6321060f0 )
revoke role
https://rinkeby.etherscan.io/tx/0x9516121e7e49908bcd2e2ebd61d4e0145ba7de9ee81a963b0fb56c6586e3b3d3 ( https://rinkeby.etherscan.io/tx/0x9516121e7e49908bcd2e2ebd61d4e0145ba7de9ee81a963b0fb56c6586e3b3d3 )

negative cases
required syncManagerRole for add IP range
https://rinkeby.etherscan.io/tx/0xe2888722eaaab9a01f9d6a7d1362167fae1da4e0c453f604d334b1ae06188874 ( https://rinkeby.etherscan.io/tx/0xe2888722eaaab9a01f9d6a7d1362167fae1da4e0c453f604d334b1ae06188874 )
required syncManagerRole for removing IP range
https://rinkeby.etherscan.io/tx/0x3a6ac3f17620e7bfb949518da6c07dcccef3c7057211f3ebbd8993b56c958b85 ( https://rinkeby.etherscan.io/tx/0x3a6ac3f17620e7bfb949518da6c07dcccef3c7057211f3ebbd8993b56c958b85 )
Ip range does not exists
https://rinkeby.etherscan.io/tx/0x200b28c46d00a3f808e687a46b5b3e6ec46ae773de03cad8af51020a15f00b61 ( https://rinkeby.etherscan.io/tx/0x200b28c46d00a3f808e687a46b5b3e6ec46ae773de03cad8af51020a15f00b61 )

And transaction not mined when tried to grant syncManagerRole from an address without DefaultAdminRole permissions
https://rinkeby.etherscan.io/tx/0xa255eebb500f4f950e3c0ea1405a3d5ef962bd48abb0c544c2e3d25d903a82f8 ( https://rinkeby.etherscan.io/tx/0xa255eebb500f4f950e3c0ea1405a3d5ef962bd48abb0c544c2e3d25d903a82f8 )