Conversation
prajwolrg
left a comment
There was a problem hiding this comment.
In a lot of places we are making borsh the canonical encoding and SSZ just a wrapper for borsh. The goal should be to make SSZ the canonical encoding.
Also in SSZ schemas, we are missing out on the existing docstrings. It is be helpful to add them.
I realized that we had to do it this way because a lot of the types are defined outside of this repo. In that case, we'd first need to update the existing types in Alpen to be SSZ compatible. |
|
Moving to draft since it needs alpenlabs/alpen#1513 |
|
Commit: e6de5f9
|
|
Ok I think this is ready @prajwolrg |
Complete the PR 1506 SSZ port so ASM state, proof inputs, messages, logs, and admin payloads all use the new serialization boundary. Keep narrow Borsh compatibility shims for upstream alpen state and storage paths so the current main-based dependency pin still builds cleanly.
Collapse mirror SSZ wrapper types into the primary protocol-owned message and state structs so SSZ is the visible canonical encoding. Keep only field-level adapters for upstream or legacy payloads that cannot be made SSZ-native inside this repo.
Replace the handwritten Borsh-through-SSZ implementations on ASM common types with the shared compatibility macro and document that SSZ remains canonical. This keeps downstream compatibility without implying that Borsh owns the wire format.
Switch the ASM proof commitment to the SSZ tree root and make repeated block decoding explicit in the Moho input helpers. Restore the missing SSZ schema docstrings so the proof-side state representation stays documented alongside the new commitment semantics.
Replace the manual SSZ implementation for `Role` with a derived tag enum so the admin parameter types stay consistently derive-first. This closes out the remaining direct-derive review feedback in the admin params module.
|
@prajwolrg rebased take a look please. |
Summary
This PR finishes the remaining ASM-side SSZ migration work and updates the pinned
alpendependency to the helper commit needed to complete it.It does these things:
mohoto the non-Borsh SSZ versionalpen/typed-sledfor the SSZ +rkyv-compatible dependency setcheckpoint-v0path with helper APIs exposed fromalpenRemaining Borsh
This branch no longer uses Borsh directly for ASM-local bridge/admin/checkpoint payloads, messages, or state.
The only remaining Borsh in this repo is compatibility glue for:
AnchorStateAuxDataThose shims still exist because the current
alpenstorage/state layer still uses Borsh-backed DB codecs for ASM values. Removing them entirely requires a follow-up inalpenstorage/state rather than more local ASM migration.Dependency Note
This PR now pins
alpento commitee8ab446f26ee451e2f7b878b4acad3f95c3339dfromrefactor/ssz-asm, which adds the helper APIs needed for:RawBitcoinTxbyte accessSignedCheckpoint/CheckpointdecodingChainstatedecodingNotes To Reviewers
Reviewing commit-by-commit is still the easiest path through this PR. The key milestones are:
af2804bbumpsmohoto the non-Borsh SSZ versiona32d2c3bumpsalpenandtyped-sledfor the current serialization stacka872b3bfinishes the main ASM serialization migration464fc53pinsalpento the helper follow-up needed for legacy decode paths6fb53c3removes the remaining ASM-local Borsh usage and switches the legacy checkpoint-v0 callers to Alpen helpersValidation
I verified that the current branch passes:
cargo fmt --allcargo checkType Of Change
Checklist
Related Issues
STR-1912