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(settlement): added DRS version to MsgUpdateState #1086

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions settlement/dymension/dymension.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types"
"github.com/dymensionxyz/dymint/types"
rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp"
"github.com/dymensionxyz/dymint/version"
)

const (
Expand Down Expand Up @@ -502,6 +503,7 @@ func (c *Client) convertBatchToMsgUpdateState(batch *types.Batch, daResult *da.R
DAPath: daResult.SubmitMetaData.ToPath(),
BDs: rollapptypes.BlockDescriptors{BD: blockDescriptors},
Last: batch.LastBatch,
DrsVersion: version.Commit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keruch where is this value validated across the L2?
what prevents the sequencer from lying?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that each node validates his own version vs the rollapp params

if version.Commit != m.State.RollappParams.Version {
    return fmt.Errorf("binary version mismatch. rollapp param: %s binary used:%s", m.State.RollappParams.Version, version.Commit)
}

but I don't see where it's validated in regard with the state updates.

let's assume L2 runs version 8.
but the sequencer sets DrsVersion: 9 in the state update (e.g to bypass the DRS check)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danwt as discussed, this scenario should be fraud provable
pls link the related research/ADR/issue

}
return settlementBatch, nil
}
Expand Down
Loading