Skip to content

Das merkle accumulator - #739

Merged
PlasmaPower merged 41 commits into
masterfrom
dastree
Jul 22, 2022
Merged

Das merkle accumulator#739
PlasmaPower merged 41 commits into
masterfrom
dastree

Conversation

@rachel-bousfield

@rachel-bousfield rachel-bousfield commented Jun 30, 2022

Copy link
Copy Markdown
Contributor

This PR

  • Introduces a new merkelization strategy for DAS batches
  • Refactors DAS readers to use common.Hash everywhere
  • Includes a one-time upgrade script to replace das contents in a directory

@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2022
@rachel-bousfield
rachel-bousfield changed the base branch from master to das-panic-wrapper July 5, 2022 13:55
@Tristan-Wilson

Copy link
Copy Markdown
Member

I talked to Rachel out of band to make sure I understand how this works. LGTM. I see there are some tests failing currently.

@rachel-bousfield
rachel-bousfield changed the base branch from das-panic-wrapper to master July 7, 2022 23:47
@rachel-bousfield
rachel-bousfield marked this pull request as ready for review July 8, 2022 17:31

@edfelten edfelten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few minor suggestions.

Also, we should think carefully about the fact that the same bytes can be encoded into different trees, having different hashes. Does that break anything? And even if it doesn't, should we dictate a single canonical tree shape in the interest of future-proofing?

Comment thread arbstate/inbox.go Outdated
Comment thread das/aggregator.go Outdated
Comment thread das/dastree/dastree.go Outdated
Comment thread das/dastree/dastree.go
Comment thread das/sign_after_store_das.go

@edfelten edfelten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One small change in a comment suggested. Otherwise looks good.

Comment thread das/dastree/dastree.go Outdated

@Tristan-Wilson Tristan-Wilson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to have upgrade scripts for the other storage types (S3 and Database) in this PR or should that be in a different PR?

Comment thread arbstate/das_reader.go Outdated
return nil, err
}
if !bytes.Equal(crypto.Keccak256(keysetBytes), cert.KeysetHash[:]) {
if dastree.Hash(keysetBytes) != cert.KeysetHash {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about keysets that were stored before the DASes were upgraded? I suppose we'll just fall back to getting it from the chain so it's probably fine...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We now accept both :)

edfelten
edfelten previously approved these changes Jul 19, 2022

@edfelten edfelten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

edfelten
edfelten previously approved these changes Jul 20, 2022

@edfelten edfelten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@PlasmaPower PlasmaPower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some minor recommendations but generally LGTM

Comment thread contracts/src/bridge/SequencerInbox.sol
Comment thread das/dasrpc/dasRpcClient.go Outdated
Comment thread das/dastree/dastree.go Outdated
Comment thread das/dastree/dastree.go Outdated
Comment thread das/dastree/dastree.go Outdated

@PlasmaPower PlasmaPower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I'm going to approve and merge this to include it in consensus v3, but I'd appreciate another review from @edfelten and/or @Tristan-Wilson, and worst case we'll make another consensus release with any fixes to it before we put it to use.

@PlasmaPower
PlasmaPower enabled auto-merge July 22, 2022 02:33
@PlasmaPower
PlasmaPower merged commit 9fbb20d into master Jul 22, 2022
@PlasmaPower
PlasmaPower deleted the dastree branch July 22, 2022 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants