0xFableOrg / roll-op

The simplest way to spin your own dev / prod rollup, fully configurable.
BSD 3-Clause Clear License
92 stars 25 forks source link

add bridge convenience script #93

Closed simluyt closed 10 months ago

simluyt commented 10 months ago

Made a basic bridge script for #78

Had two questions:

norswap commented 10 months ago

Hey there! Sorry for the delay in the review, and thanks for the contribution 🙏

You mean a convenience script like this or as a roll.py subcommand?

Both can be good, but I'm wondering if it's maybe not better as a subcommand as it allows reusing the config loading logic (which does a few things beyond just loading the TOML, though not sure they are relevant in this use case from the top of my head).

The only downside is polluting the command space a bit, but maybe we can make it a "script" command and make this a "bridge" subcommand (and then if we add other scripts like this we can add them there as well).

This solution could be maybe improved for devnet/prod by adding an extra 'preset' flag like the main script, so that devnet users don't have to paste in localhost:8545? prod default would get rpc from config, devnet from wherever that gets stored if possible idk.

The default in the loading logic I mention above is the dev preset, if not integrating as a subcommand, could use that here too!

The default is http://127.0.0.1:8545 in any case, even without preset (from config/network.py :: l1_rpc_url)


What I propose: let's merge this (maybe if you can move the utility function to the library first?).

Then if you're motivated, an extra PR to integrate this as a subcommand, and/or to optionally wait for the bridge to complete would be more than welcome!

Thanks again!