Skip to content

Update example using outdated type L1BlockInfoGlacier #2732

@emhane

Description

@emhane

## Protocol Changes
Introduce a new `glacier.rs` module containing a `L1BlockInfoGlacier` type
in [`kona_genesis::info` module][info-mod].
This should include a few methods used in the `L1BlockInfoTx` later.
```rust
pub fn encode_calldata(&self) -> Bytes { ... }
pub fn decode_calldata(r: &[u8]) -> Result<Self, DecodeError> { ... }
```
Use other hardfork variants like the [`L1BlockInfoEcotone`][ecotone]
for reference.
Next, add the new "Glacier" variant to the [`L1BlockInfoTx`][info-tx].
```rust
pub enum L1BlockInfoTx {
...
Glacier(L1BlockInfoGlacier)
}
```
Update [`L1BlockInfoTx::try_new`][try-new] to construct the `L1BlockInfoGlacier`
if the hardfork is active using the `RollupConfig::is_glacier_active`.
Also, be sure to update [`L1BlockInfoTx::decode_calldata`][decode-calldata]
with the new variant decoding, as well as other [`L1BlockInfoTx`][info-tx]
methods.
Once some tests are added surrounding the decoding and encoding of the new
`L1BlockInfoGlacier` variant, all required changes are complete!
Now, [this example PR diff][pr-diff] introducing the Isthmus changes should
make sense, since it effectively implements the above changes for the Isthmus
hardfork (replacing "Glacier" with "Isthmus"). Notice, Isthmus introduces
some new "operator fee" fields as part of it's `L1BlockInfoIsthmus` type.
Some new error variants to the [`BlockInfoError`][bie] are needed as well.

https://github.com/op-rs/kona/actions/runs/17097895931/job/48486594111?pr=2689#step:3:809

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-examplesArea: examplesA-protocolArea: protocol cratesK-debtKind: debtK-docsKind: documentation

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions