-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(book): Add minimal program stage documentation (#202)
* feat(book): Add minimal program stage documentation ## Overview Adds some documentation for each program stage in the [book](https://static.optimism.io/kona). * Update book/src/fpp-dev/epilogue.md Co-authored-by: refcell <[email protected]> --------- Co-authored-by: refcell <[email protected]>
- Loading branch information
Showing
5 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# Epilogue | ||
|
||
_TODO_ | ||
The epilogue stage of the program is intended to perform the final validation on the outputs from the | ||
[execution phase](./execution.md). In most programs, this entails comparing the outputs of the execution phase | ||
to portions of the bootstrap data made available during the [prologue phase](./prologue.md). | ||
|
||
Generally, this phase should consist almost entirely of validation steps. | ||
|
||
## Example | ||
|
||
In the `kona-client` program, the prologue phase only contains two directives: | ||
|
||
1. Validate that the L2 safe chain could be produced at the claimed L2 block height. | ||
1. The constructed output root is equivalent to the claimed [L2 output root][l2-output-root]. | ||
|
||
{{#include ../links.md}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
# Execution | ||
|
||
_TODO_ | ||
The execution phase of the program is commonly the heaviest portion of the fault proof program, where the computation | ||
that is being verified is performed. | ||
|
||
This phase consumes the outputs of the [prologue phase](./prologue.md), and performs the bulk of the verifiable | ||
computation. After execution has concluded, the outputs are passed along to the [epilogue phase](./epilogue.md) for | ||
final verification. | ||
|
||
## Example | ||
|
||
At a high-level, in the `kona-client` program, the execution phase: | ||
|
||
1. Derives the inputs to the L2 derivation pipeline by unrolling the L1 head hash fetched in the epilogue. | ||
1. Passes the inputs to the L2 derivation pipeline, producing the L2 execution payloads required to reproduce | ||
the L2 safe chain at the claimed height. | ||
1. Executes the payloads produced by the L2 derivation pipeline, producing the [L2 output root][l2-output-root] at the | ||
L2 claim height. | ||
|
||
{{#include ../links.md}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
# Prologue | ||
|
||
_TODO_ | ||
The prologue stage of the program is commonly responsible for bootstrapping the program with inputs from an external | ||
source, pulled in through the [Host <-> Client communication](./env.md#host---client-communication) implementation. | ||
|
||
As a rule of thumb, the prologue implementation should be kept minimal, and should not do much more than establish | ||
the inputs for the [execution phase](./execution.md). | ||
|
||
## Example | ||
|
||
As an example, the prologue stage of the `kona-client` program runs through several steps: | ||
|
||
1. Pull in the boot information over the [Preimage Oracle ABI][preimage-specs], containing: | ||
- The L1 head hash containing all data required to reproduce the L2 safe chain at the claimed block height. | ||
- The latest finalized [L2 output root][l2-output-root]. | ||
- The [L2 output root][l2-output-root] claim. | ||
- The block number of the [L2 output root][l2-output-root] claim. | ||
- The L2 chain ID. | ||
1. Pull in the `RollupConfig` and `L2ChainConfig` corresponding to the passed L2 chain ID. | ||
1. Validate these values. | ||
1. Pass the boot information to the execution phase. | ||
|
||
{{#include ../links.md}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters