Open sz-piotr opened 3 weeks ago
Thanks for the detailed feedback @sz-piotr!
If I miss a given point, it means I agree. ;) However, implementing everything will take some time.
ad 1. I wanted to avoid repeating what was already specified in a linked documentation of Ethereum JSON-RPC.
ad 4. This should be mentioned in the spec as I think automating verification fits this proposal nicely. (and it's often problem on dev nets)
ad 7. This problem is mentioned in security considerations section but I will make sure to emphasise it more.
ad 12. I had the same thoughts but I didn't propose it because already standarized json-rpc methods don't utilize objects.
ad 13. btw. how do you call wei equivalent for erc20s? We call them internally "base units". but yes, i'll tweak the comment
ad 26. This is something that i need more input from the node side. Some of the providers (tenderly) return something that look like uuid. Ofc this could be converted to a number but I am not sure if it makes sense.
ad 28. I know it's a bad approach but it might be fastest 0 to 1 approach that solves most issues. Internally we already use something like this.
ad 29.
Backwards compatibility should be about the future.
Can you elaborate on that? I think this section should explain how implementing this spec would change the experience of current users.
Backwards compatibility should be about the future.
Basically I was thinking about the following points:
Spec feedback, top to bottom
Type definitions
type Data
the comment doesn't specify that it has to be hex, and it doesn't specify that it has to be full number of bytes, so0x123
isn't allowed, but0x0123
is.Quantity
. This eliminates negative and floating point numbers as well as sticks to how Ethereum JSON-RPC behaves.NodeInfo
toCheatcallsInfo
, because it doesn't contain all information about a node.bytecodeVerification
seems to be unused. I'd remove it.impersonateAllStatus
suggests a string. I'd rename toimpersonateAllEnabled
.RunMode
- I'd replace"new"
with"genesis"
RunMode.originRpc
might contain a secret, e.g. alchemy key. I am not sure if sending those over JSON-RPC is a good idea. Maybe this shouldn't be part of the returned data.InputRunMode.blockNumber
should beQuantity | 'latest'
and be optional. The reasoning being that otherwise there is no way to be explicit about using'latest'
-undefined
is confusing.MiningMode.intervalInSec
tointervalSeconds
.MiningOrdering
values. I'd replace them with"highest-fee-first"
and"oldest-first"
. You can also add"random"
.JSON RPC Methods
cheat_setBalance
renameaddr
toaccount
andbalanceInWei
tobalance
.cheat_setErc20Balance
. The10^18
base unit comment is confusing. If I pass1
do I get10^18
or1
. I think I should get1
. Renameaddr
toaccount
andbalanceInBaseUnit
tobalance
.cheat_setCode
. Renameaddr
toaccount
.cheat_setNonce
. Renameaddr
toaccount
.cheat_setStorageAt
. Renameaddr
toaccount
,key
toslot
. Changeslot
type toQuantity
.cheat_setCoinbase
. Renameaddr
toaccount
.cheat_setMinGasPrice
. RenamepriceInWei
togasPrice
. Change type toQuantity | 'default'
. Passingnull
might be confused with setting it to0
.cheat_setNextBlockBaseFeePerGas
. RenamepriceInWei
tobaseFeePerGas
. Change type toQuantity | 'default'
. Passingnull
might be confused with setting it to0
.cheat_setBlockGasLimit
. Change type toQuantity | 'default'
. Setting0
means no limit.cheat_mine
renameblocks
tocount
. RenamegapInSec
togapSeconds
. It is unclear if this method advances the time or not. I think the gap parameter should be reworked.cheat_mining_mode
rename tocheat_setMiningMode
.cheat_increaseTime
renamedeltaInSec
todeltaSeconds
.cheat_setNextBlockTimestamp
unclear how it plays withcheat_mine
gap
parameter. AlsonextTimestamp
type should be changed toQuantity | 'default'
. The case is not as strong here but this will follow other methods.cheat_snapshot
returnQuantity
.cheat_revert_snapshot
rename tocheat_revertSnapshot
.id
type change toQuantity
. Not sure why we need errors in the boolean return value if JSON-RPC already has support for errors.Other comments