EVM/Sequencer: version data-dir and perform migration
Context
This puts a version file in the data-dir. Therefore if we make breaking changes and we need to migrate we just need to bump the version and write the migration code.
I'm not a huge fan of where is located the code, but I believe it has to be in evm_context.ml to avoid circular dependencies etc
Manually testing the MR
$ ./octez-evm-node run sequencer with endpoint https://rollup-node.2024-02-12.etherlink-nightly.tzalpha.net/ signing with <sk> --data-dir /tmp/evm-node-data-dir --rpc-addr 0.0.0.0 --rpc-port 8545 --time-between-blocks none --initial-kernel sequencer.wasm
produced a few blocks:
$ curl -X POST -H 'Content-Type: application/json' --data '{"id":28303029412179935,"jsonrpc":"2.0","method":"produceBlock"}' http://localhost:8546/private
$ curl -X POST -H 'Content-Type: application/json' --data '{"id":28303029412179935,"jsonrpc":"2.0","method":"produceBlock"}' http://localhost:8546/private
$ curl -X POST -H 'Content-Type: application/json' --data '{"id":28303029412179935,"jsonrpc":"2.0","method":"produceBlock"}' http://localhost:8546/private
then:
$ ./octez-evm-node run sequencer with endpoint https://rollup-node.2024-02-12.etherlink-nightly.tzalpha.net/ signing with <sk> --data-dir /tmp/evm-node-data-dir --rpc-addr 0.0.0.0 --rpc-port 8545 --time-between-blocks none --initial-kernel sequencer.wasm **--devmode**
If the migration do not happen, you'll produce the block genesis again.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Valentin Chaboche