Skip to content

Merklize UserMailbox storage for ethexe fast sync #5591

Description

@ark0f

Context

UserMailbox is currently persisted as one SCALE-encoded CAS blob:

  • UserMailbox(BTreeMap<MessageId, Expiring<MailboxMessage>>)
  • fast sync requests this blob through Bitswap when walking Mailbox
  • the new Bitswap path currently caps blockstore responses at 1 MiB

UserMailbox has no hard encoded-size limit. It is bounded only indirectly by mailbox expiry and outgoing-message soft limits, so a valid mailbox blob can exceed 1 MiB before expiry.

Proposal

Store UserMailbox as a Merkle/CAS-backed tree instead of one monolithic blob.

This should let fast sync fetch mailbox state in bounded chunks and avoid rejecting otherwise valid chain state because one user mailbox blob grew too large.

Tasks

  • Design the Merkle layout for UserMailbox
  • Update mailbox read/write paths to store and load the Merkle root
  • Update DB iterator/visitor traversal so fast sync requests mailbox chunks
  • Add a regression test for a mailbox larger than the current Bitswap block size

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: normalStandard planned workscope: vara.ethVara Ethereum application layer (L2)size: MMedium task (1–2 days)type: refactorInternal improvements without changing behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions