contracts icon indicating copy to clipboard operation
contracts copied to clipboard

feat: Use standard RLP transactions

Open smartcontracts opened this issue 4 years ago • 6 comments

Description

Updates our sequencer entrypoint and ECDSA contracts to use the standard RLP encoding that we're using in geth now.

Metadata

Fixes

  • Fixes roadmap#754

Contributing Agreement

smartcontracts avatar Mar 08 '21 02:03 smartcontracts

Overall good changes. The abi is changing, we need to make sure to not break everything when we publish these changes. Also we dont have hardhat deploy so there are no deployment artifacts in this repo so we need to be mindful about this change.

tynes avatar Mar 08 '21 04:03 tynes

The calldata size of using a RLP encoded tx is about ~250 gas more than using the custom serialization. Trading a bit of cost for simplicity, but its possible that the gas usage was decreased elsewhere in these changes. We really need automated gas metering in CI

tynes avatar Mar 08 '21 04:03 tynes

Note that this change must be done in a way that is backwards compatible with the current ctc elements. From the point of view of geth, the old contract must be used when syncing the initial set of transactions. This makes me lean towards not changing the contract and adding a new one that is OVM_SequencerEntrypointv2. This way geth can use the old sequencer entrypoint to sync and switch out at a certain point.

This means that geth needs the old serialization logic still and we need a way to selectively set rawTransaction in the data transport layer based on the how the transaction is serialized

tynes avatar Mar 13 '21 21:03 tynes

CI Fails at:

h_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_ExecutionManager Method=run
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_StateManager     Method=isAuthenticated
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_StateManager     Method=hasAccount
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_StateManager     Method=testAndSetAccountLoaded
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_StateManager     Method=getAccountEthAddress
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_SequencerEntrypoint Message="no method with id: 0x00dede53"
geth_l2_1               | DEBUG[03-16|01:02:16.924] Calling Known Contract                   ID=85f757a4 Name=OVM_ExecutionManager    Method=ovmCHAINID
geth_l2_1               | DEBUG[03-16|01:02:16.925] Reached the end of an OVM execution      ID=85f757a4 Return Data=0x Error="ovm execution failed"
geth_l2_1               | INFO [03-16|01:02:16.925] New block                                index=5     l1-timestamp=1615856583 l1-blocknumber=64 tx-hash=0x40483b4c114a3330ce0afb10500ad4ca304c1a327c5fcab06f0b9b19353074de queue-orign=0 type=0 gas=294814 fees=0 elapsed=4.505ms

gakonst avatar Mar 19 '21 12:03 gakonst

Converting to draft until checks pass.

maurelian avatar Mar 23 '21 13:03 maurelian

Is this dead?

maurelian avatar Apr 09 '21 15:04 maurelian