Closed zacshowa closed 1 month ago
can you add a test to see if this works? We might also have to make changes to the replay binary to check whether espresso is enabled
My intention was for the migration test to be the test of this work and I intend to have that finished soon.
The migration test is now complete in the branch linked in the PR description. LMK if there is context I'm forgetting to give!
@Sneh1999
I have a few suggestions for changes:
1. [replay binary](https://github.com/EspressoSystems/nitro-espresso-integration/blob/integration/cmd/replay/main.go#L290-L326) should be modified? 2. `EnableEspressoSovereign` flag needs to be replaced by this check? 3. Is the `EnableEspresso` flag in `ArbitrumChainParams` needed now? 4. I understand that we added the migration test to `nitro-testnode` but should we not add any test for `GetArbOSConfigAtHeight` and espressoSwitch - reasoning is that someone might break this functionality without knowing. Let me know your thoughts :)
EnableEspressoSovereign
is currently only used as a "creation time" config check hereArbitrumChainParams
to refer to when deserializing and using the deserialized config. I think the coupling with the actual go struct is loose. I.E. you can set something in the ArbOS chain config that doesn't exsist in the go struct and the transaction won't revert, but I don't think we should remove this param at all. Otherwise I think we will have issues with deserialization. Furthermore we might change it as per the comments left by Mathis.espressoSwitch()
@Sneh1999
I have a few suggestions for changes:
1. [replay binary](https://github.com/EspressoSystems/nitro-espresso-integration/blob/integration/cmd/replay/main.go#L290-L326) should be modified? 2. `EnableEspressoSovereign` flag needs to be replaced by this check? 3. Is the `EnableEspresso` flag in `ArbitrumChainParams` needed now? 4. I understand that we added the migration test to `nitro-testnode` but should we not add any test for `GetArbOSConfigAtHeight` and espressoSwitch - reasoning is that someone might break this functionality without knowing. Let me know your thoughts :)
- The replay binary already loads the arbOS config from the current block to check the chainConfig, so I don't think we need changes there.
EnableEspressoSovereign
is currently only used as a "creation time" config check here- We do need something in the
ArbitrumChainParams
to refer to when deserializing and using the deserialized config. I think the coupling with the actual go struct is loose. I.E. you can set something in the ArbOS chain config that doesn't exsist in the go struct and the transaction won't revert, but I don't think we should remove this param at all. Otherwise I think we will have issues with deserialization. Furthermore we might change it as per the comments left by Mathis.- I think we could add an integration test for the arbOS config fetching with this implementation somewhat easily, the test would remain relatively the same too if we don't change the current API in the execution node. I'm not sure how we could easily test
espressoSwitch()
initialArbOSState
(here). Do you know where its getting the current block?
2, 3, 4 make sense to me! Thank you1. okay maybe the naming is confusing lol - it says `initialArbOSState` ([here](https://github.com/EspressoSystems/nitro-espresso-integration/blob/integration/cmd/replay/main.go#L249)). Do you know where its getting the current block? 2, 3, 4 make sense to me! Thank you
I think the naming might be confusing. Maybe by
initialArbOSState
the arbitrum devs meant "TheArbOS
state before the STF finishes. implying it may be different when it ends. However, it should be the state based on the most recent block. In main.go, main() grabs the latest block height to get the state root and open the statedb here. It then uses this statedb to open ArbOS state here.
Closes #228
This PR:
Adds a method for nitro nodes, primarily the sequencer, to read the ArbOS chain config when determining if espresso is enabled. This allows the
EnableEspresso
field of the chain config to act as a live switch to enable espresso independently of any upgrade.Key places to review:
Key files to review are
transaction_streamer.go
,sequencer.go
,executionengine.go
, andnode.go
are the primary places to review, changes tointerface.go
are important as well.How to test this PR:
Testing this PR also involves using the work in the set-chain-config branch of the nitro-testnode repo here
You can either check this branch out in a different repository, or likely point the nitro-testnode submodule in this repo at that branch.
My testing process included the following steps:
There should be some output near the end of the test that looks similar to this:
This shows that the chain config has switched as we are successfully forwarding transactions to the espresso confirmation layer in the test.
Things tested:
I have confirmed that locally this change is working with the testnode and is showing the chain config switching.