Make invoking a task easy
Right now, invoking a task looks something like this in our new superchain ops 2.0 system:
SIMULATE_WITHOUT_LEDGER=1 OWNER_SAFE=0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A SCRIPT_NAME=GasConfigTemplate just --justfile ../../../single.just simulate
We should be able to automatically determine SCRIPT_NAME from the config.toml file.
-
SCRIPT_NAME: This value is explicitly defined inside config.toml.
We cannot automatically determine the OWNER_SAFE. Therefore we should specify this role in the config.toml file.
Additionally, I think we could get UX wins by consolidating task commands inside the Justfile at src/improvements/justfile. This Justfile could support commands that are smart enough to abstract away messier command syntaxes:
-
just task simulate <path_to_task> -
just task execute <path_to_task> -
just task approve <path_to_task> -
just task --justfile ../../../justfile.just simulate <path_to_task>(example inside a task directory) - etc
This approach allows the commands to automatically determine the appropriate Justfile (
single.justornested.just) based on the upgrade-controller.
OWNER_SAFE: This can be inferred by retrieving the proxy admin owner (upgrade-controller) of an L2 chain from the array. All upgrade-controllers should be the same. We already have checks later in the process to detect any inconsistencies across chains and revert if necessary.
I don't think it's safe to assume this is always the proxy admin owner, sometimes it will be the system config owner, guardian, etc. So this role cannot be inferred and should be specified in the config file
We should be able to automatically determine both
OWNER_SAFEandSCRIPT_NAMEfrom theconfig.tomlfile.
I think it requires both the config.toml and solidity template files to determine which address is sending the transaction. If the safe address is not SystemConfigOwner, then this assumption will break.
I can remove the OWNER_SAFE in the simulate command from this PR https://github.com/solidity-labs-io/superchain-ops/pull/30/files that way the user doesn't have to specify this value. I'll just remove the --sender flag
I'm not sure we want to remove the --sender flag though. Doesn't it add value by running the simulation as the sender address?
I'm not sure we want to remove the
--senderflag though. Doesn't it add value by running the simulation as the sender address?
I don't think it adds any value. The simulate task calls simulateRun in MultisigTask which calls
_taskSetup(taskConfigFilePath);
/// now execute task actions
build();
simulate();
validate();
print();
None of those functions care who the foundry sender is since nothing gets broadcasted.
Will test it out and report back here.
Ok, just confirmed we can simulate without needing to set the owner safe https://github.com/solidity-labs-io/superchain-ops/pull/30/files PR 30 also includes an example command if you'd like to test it on your machine.
Architecture has meaningfully changed since this issue was opened so closing.