-
Notifications
You must be signed in to change notification settings - Fork 95
feat(proto): create v2 execution API #1962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| astria.primitive.v1.RollupId rollup_id = 1; | ||
| // The first block height on the sequencer chain to use for rollup transactions. | ||
| // This is mapped to `rollup_first_block_number`. | ||
| uint32 sequencer_first_block_height = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we did away with sequencer_start_block_height in favor of sequencer_start_height before, but somehow sequencer_first_height feels like it carries less information than sequencer_first_block_height to me. Happy to change, though
…length, make uint32s uint64s
SuperFluffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some notes for discussion on the need for rollup_halt_at_stop_number.
Going down this rabbit hole - I wonder if we can avoid setting rollup_stop_block_number entirely in favor of using gRPC error codes?
For example, OUT_OF_RANGE or RESOURCE_EXHAUSTED might be valid error codes that can trigger conductor to re-fetch the genesis and/or commitment states.
joroshiba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but noting there is one extra file here were we should delete.
Either as a part of this PR or as follow up can we get a execution api v2 spec doc?
proto/executionapis/astria/execution/v2/get_commitment_state_request.proto
Outdated
Show resolved
Hide resolved
Noting that I have made a followup issue here for the spec: #1986. Prefer to get this landed ASAP |
SuperFluffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall.
I only have a bunch of naming and field ordering requests (important to get this right because future changes would be breaking).
| // Celestia blobs). | ||
| string celestia_chain_id = 6; | ||
| // The allowed variance in celestia for sequencer blocks to have been posted. | ||
| uint64 celestia_block_variance = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joroshiba I think we should define a fixed variance here and not perform a calculation inside conductor. Right now it's 6x this value, but I don't see a reason to not just set it here without extra conductor shenanigans.
Co-authored-by: Superfluffy <janis@astria.org>
SuperFluffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some thoughts on the block fields in CommitmentState. I think we should define bespoke SoftRollupBlock and FirmRollupBlock (or alternatively, SoftCommitmentState and FirmCommitmentState, which we will populate from the executed RollupBlock conductor side).
SuperFluffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments on the response types of the RPCs. We are sometimes relatively strict about naming these things (for example in the auctioneer protos), but here we are loser.
Should we enforce a *Request -> *Response convention everywhere (where for example GetBlock responds with a GetBlockResponse { rollup_block: RollupBlock } (so that the block is just a field of the response)?
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_service.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/rollup_block_identifier.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execution_session_parameters.proto
Outdated
Show resolved
Hide resolved
joroshiba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SuperFluffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to fix the type of the ExecuteBlock.prev_block_hash request to match the ExecutedBlockMetadata.
proto/executionapis/astria/execution/v2/execute_block_request.proto
Outdated
Show resolved
Hide resolved
proto/executionapis/astria/execution/v2/execute_block_request.proto
Outdated
Show resolved
Hide resolved
## Summary
Updates Conductor to use v2 Execution API, including use of new
"execution sessions".
## Background
These changes are necessary to support migrating Forma to mainnet.
Migrating Forma to Astria's main net requires introducing stop and start
logic into the Conductor. A migration using these changes could look
like this:
1. Running against a fresh rollup node, Conductor starts and initiates a
new execution session via `astria.execution.v2.CreateExecutionSession`,
which contains `rollup_start_block_number = 1`, and
`rollup_end_block_number = 1000`.
2. Conductor executes (syncs) the rollup node from rollup block numbers
1 to 1000 (inclusive)
3. Upon executing rollup number 1000, conductor resets its inner state
and initiates a new execution session via
`astria.execution.v2.CreateExecutionSession`, with new information from
which it will continue executing.
For cases where `rollup_end_block_number` is unset (or equivalently set
to 0), conductor will never restart as there is no stop condition.
For conductors running in firm-only or in soft-and-firm modes, only the
firm-executed block triggers a restart (in soft-and-firm mode, upon
soft-executing at the rollup stop number no blocks will be executed past
it).
For conductors running in soft-only mode the soft-executed block
triggers the restart.
If the rollup chain is halted, it should respond with
`tonic::Code::FailedPrecondition` to `CreateExecutionSession`, which
will cause the Conductor to shut down upon attempting a restart.
The aforementioned rollup changes to be made in `astria-geth`
necessitate changing our current charts config for the following.
"Forks" now describes a set of instructions for when and how to stop and
restart the EVM at different heights, such that changes (such as network
migration) can be made.
```yaml
config:
# < non astria-prefixed items... >
AstriaOverrideGenesisExtraData:
AstriaRollupName:
AstriaForks: []
# - < fork name >:
# height: ""
# halt: ""
# snapshotChecksum: ""
# extraDataOverride: ""
# feeCollector: ""
# EIP1559Params: {}
# sequencer:
# chainId: ""
# addressPrefix: ""
# startHeight: ""
# celestia:
# chainId: ""
# startHeight: ""
# searchHeightMaxLookAhead: ""
# bridgeAddresses: []
# astriaOracleCallerAddress: ""
# astriaOracleContractAddress: ""
```
## Changes
### In `astria-core`
- Replaced v1 execution domain types with v2 execution domain types:
- `ExecutionSession`
- `ExecutionSessionParameters`
- `ExecutedBlockMetadata`
- `CommitmentState` (name unchanged, but fields are)
- For more information on API changes, see #1962
### In `astria-auctioneer`
- Updated execution types to v2
### In `astria-conductor`
- Changed sequencer-to-rollup-height calculation to start from
`rollup_start_block_number` in `ExecutionSessionParameters`, so that
Conductor doesn't start from rollup height 1 again after restarting.
- Removed `ASTRIA_CONDUCTOR_SEQUENCER_CHAIN_ID` and
`ASTRIA_CONDUCTOR_CELESTIA_CHAIN_ID` env vars from Conductor (chain ID
checks will now be performed against the values retrieved from the
genesis info)
- Added restart logic for when the stop block number is reached:
Conductor will restart at the stop height and initiate a new execution
session
- Removed multiplication of Celestia variance.
### In `charts`
- Added `astriaForks` to EVM rollup config, to reflect changes in
`astria-geth`: https://github.com/astriaorg/astria-geth/pull/59/files.
- Add just command for deploying the EVM rollup restart test, which
functions the same as our regular smoke test with a restart at sequencer
height 20.
## Testing
- Added miscellaneous unit tests to ensure heights are correctly
calculated and whether to restart is successfully determined.
- Added blackbox tests to ensure conductor correctly restarts in each
mode, and continues to execute at the correct height after initiating a
new execution session.
- Added EVM rollup restart test which restarts EVM and Conductor at
sequencer height 20 during the regular smoke test.
## Changelogs
Changelogs updated
## Breaking Changelist
- Domain v1 execution types have been almost entirely replaced
- Conductor config is not backwards compatible, i.e. old conductor will
work with new config but not vice versa.
- Conductor now required v2 execution API
## Related Issues
closes #1994
closes #2003
---------
Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io>
## Description <!-- Describe your changes in detail --> Updates the Execution API docs to reflect latest updates to v2: astriaorg/astria#2006 and astriaorg/astria#1962 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> <!-- If it fixes an open issue, please link to the issue here. --> The v2 Execution API starkly contrasts to v1, so changing the documentation seemed appropriate. ## Screenshots (if appropriate): <!-- Provide before and after screen shots --> ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Edits to existing documentation - [ ] Changing documentation structure (relocating existing files, ensure redirects exist) - [ ] Stylistic changes (provide screenshots above)
## Summary Updated the `execution-api` spec to match the new v2 changes introduced in #1962. ## Background v2 is a decent lift from v1, which warranted a new spec. Additionally, instead of leaving the v1 as well, I've simply replaced it with the v2, since the old spec didn't accurately reflect v1 design anymore. ## Changes - Updated `execution API` spec. ## Testing No tests needed. ## Changelogs No updates required. ## Related Issues closes #1986
## Summary Updated the `execution-api` spec to match the new v2 changes introduced in astriaorg/astria#1962. ## Background v2 is a decent lift from v1, which warranted a new spec. Additionally, instead of leaving the v1 as well, I've simply replaced it with the v2, since the old spec didn't accurately reflect v1 design anymore. ## Changes - Updated `execution API` spec. ## Testing No tests needed. ## Changelogs No updates required. ## Related Issues closes #1986
## Summary Updated the `execution-api` spec to match the new v2 changes introduced in astriaorg/astria#1962. ## Background v2 is a decent lift from v1, which warranted a new spec. Additionally, instead of leaving the v1 as well, I've simply replaced it with the v2, since the old spec didn't accurately reflect v1 design anymore. ## Changes - Updated `execution API` spec. ## Testing No tests needed. ## Changelogs No updates required. ## Related Issues closes #1986
Summary
Creates v2 execution API to support upcoming v2 changes to Conductor and Geth.
Background
These changes are meant to support the upcoming v2 upgrades to Conductor and astria-geth, which will facilitate the ability to have rollup forks, driven by the need to migrate Forma to Mainnet.
Changes from
v1GenesisInfoand associated RPC.BatchGetBlocksRPC and associated types.GetCommitmentStateRPC.ExecutionSessionand associated RPCCreateExecutionSession:ExecutionSessionis the execution client-side's current session, which starts at a specific block number and can end at one as well.CreateExecutionSessionshould be called, to which the server should respond with the current session, containing an ID for the session, theCommitmentState, andExecutionSessionParams.ExecutionSessionParams, which contains the necessary configuration for the execution client to run for the entirety of the session, consisting of the following:rollup_idrollup_start_block_number, the first block to be executed against the rolluprollup_end_block_number, the final block to be executed against the rollup before ending the current execution session.sequencer_chain_idsequencer_start_block_height, the sequencer height to map torollup_start_block_number.celestia_chain_idcelestia_max_search_height_look_ahead(formerlycelestia_block_variance)session_idtoExecuteBlockRequestandUpdateCommitmentStateRequest, so that the server can validate the calls are for the correct execution session.BlocktoExecutedBlockMetadataand made corresponding service changes.ExecuteBlockResponseto follow AIP.CommitmentState.base_celestia_heighttolowest_celestia_search_heightTesting
No testing needed.
Changelogs
Protos have no changelog