Skip to content
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

feat(rollapp): Updating x/rollapp to accommodate generalized DA layer interface #974

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

spoo-bar
Copy link
Contributor

@spoo-bar spoo-bar commented Jul 3, 2024

This PR aims to generalize and standardize the DA Layers that a rollapp can decide to use. The sequencers can then multiplex between different DAs. Using this, the inclusions of blob can be proved and allows for a trustless dispute process to prove inclusion, non-inclusion or tampering.

The main change includes the change of DAPath from string to a concrete type in MsgUpdateState. Rest of the fields stay the same.

message DAPath {
    // da_type identifies the DA type being used by the sequencer to post the blob.
    string da_type = 1;
    // commitment defines a generic commitment interpreted by the DA Layer.
    google.Protobuf.Any commitment = 2;
}

Every new da layer supported will need to implement the following interface to satisfy the requirements.

// DALayer defines a generic DA layer from the point of view of the
// dymension settlement layer.
type DALayer interface {
    // This is called by x/rollapp keeper during a rollapp state update.
    // It is used to verify the correctness of the provided commitment.
    // It is up to the DA Layer to decide the verification level.
    // For example, a DA layer using IBC can immediately verify inclusion
    // of the blob.
    OnRollappStateUpdate(ctx context.Context, commitment anypb.Any) error
    // VerifyMembership is called by x/rollapp during the dispute process to verify
    // the inclusion or non inclusion of the blob, or verify that it was not tampered 
    // with.
    // It also provides arbitrary proof bytes that can be used to confirm the membership.
    VerifyMembership(ctx context.Context, commitment anypb.Any, proof []byte) error
}

Description

  • Implementing v2.MsgUpdateState which differs from the existing msg in the DAPath field.
    • This is implemented with a second msg server so that the initial implementation is still useable along with the new one. Eventually v1.MsgUpdateState can be deprecated when all da layers are supported by the v2 type.
  • Implementing new DAPath field which also holds information about the type of da layer being used. e.g values are celestia, avail etc
    • The DAPath in the StateInfo is still a string field. The v2.MsgUpdateState will marshall the new DAPath and store it as string and unmarshall when it needs to be read.
  • Adding the DALayer interface which needs to be implemented by every da layer which will be supported.
  • This PR does not implement any DA Layer currently, but just enables it.

References:

  1. SPEC

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here

----;

For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

---;

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

This commit removes the deprecated functions and modules from the codebase. The following changes were made:

- Removed the RandomizedParams function from the sequencer and eibc modules
- Removed the Route, QuerierRoute, and LegacyQuerierHandler functions from the eibc, delayedack, rollapp, sequencer, and streamer modules

These changes were made to clean up the codebase and remove unnecessary and deprecated code.
Copy link

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale label Jul 12, 2024
@spoo-bar spoo-bar removed the Stale label Jul 13, 2024
@spoo-bar spoo-bar marked this pull request as ready for review July 17, 2024 15:19
@spoo-bar spoo-bar requested a review from a team as a code owner July 17, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant