superchain-ops icon indicating copy to clipboard operation
superchain-ops copied to clipboard

Make invoking a task easy

Open blmalone opened this issue 1 year ago • 6 comments

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.just or nested.just) based on the upgrade-controller.

blmalone avatar Feb 12 '25 21:02 blmalone

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

mds1 avatar Feb 12 '25 21:02 mds1

We should be able to automatically determine both OWNER_SAFE and SCRIPT_NAME from the config.toml file.

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.

ElliotFriedman avatar Feb 12 '25 21:02 ElliotFriedman

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

ElliotFriedman avatar Feb 12 '25 21:02 ElliotFriedman

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?

blmalone avatar Feb 12 '25 21:02 blmalone

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 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.

ElliotFriedman avatar Feb 12 '25 22:02 ElliotFriedman

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.

ElliotFriedman avatar Feb 12 '25 22:02 ElliotFriedman

Architecture has meaningfully changed since this issue was opened so closing.

blmalone avatar Sep 24 '25 19:09 blmalone