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

STR-378 Semantic Information L1Block #298

Merged
merged 13 commits into from
Sep 24, 2024

Conversation

voidash
Copy link
Contributor

@voidash voidash commented Sep 20, 2024

Description

Puts the RelevantTx information in L1Tx db by modifying the filter relevancies logic.

Some fixes required :

  • Inscription Parser doesn't take RollupName right now, which can be passed on
  • RollupParams should have some constants like BTC bridge in amount, EE address length, federation addr but it is hardcoded right now. This is also simple fix
  • Needs to remove warnings, lint fixes etc

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 82.32104% with 163 lines in your changes missing coverage. Please review.

Project coverage is 63.46%. Comparing base (d557f91) to head (b8a8cda).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
crates/consensus-logic/src/l1_handler.rs 0.00% 82 Missing ⚠️
crates/tx-parser/src/deposit/mod.rs 0.00% 16 Missing ⚠️
crates/tx-parser/src/inscription.rs 86.32% 16 Missing ⚠️
crates/btcio/src/reader/filter.rs 92.09% 14 Missing ⚠️
crates/btcio/src/reader/query.rs 0.00% 12 Missing ⚠️
crates/btcio/src/reader/messages.rs 56.25% 7 Missing ⚠️
crates/tx-parser/src/deposit/common.rs 96.89% 4 Missing ⚠️
crates/primitives/src/l1.rs 66.66% 3 Missing ⚠️
crates/tx-parser/src/utils.rs 90.32% 3 Missing ⚠️
crates/tx-parser/src/deposit/deposit_request.rs 98.68% 2 Missing ⚠️
... and 3 more
@@            Coverage Diff             @@
##           master     #298      +/-   ##
==========================================
+ Coverage   63.01%   63.46%   +0.44%     
==========================================
  Files         196      204       +8     
  Lines       20628    21190     +562     
==========================================
+ Hits        12999    13448     +449     
- Misses       7629     7742     +113     
Files with missing lines Coverage Δ
crates/btcio/src/writer/builder.rs 98.07% <100.00%> (+0.07%) ⬆️
crates/primitives/src/params.rs 42.85% <ø> (ø)
crates/primitives/src/tx.rs 100.00% <100.00%> (ø)
crates/primitives/src/utils.rs 80.50% <100.00%> (ø)
crates/proof-impl/btc-blockspace/src/block.rs 90.75% <100.00%> (+0.07%) ⬆️
crates/rocksdb-store/src/l1/db.rs 98.17% <100.00%> (+<0.01%) ⬆️
crates/test-utils/src/l2.rs 98.76% <100.00%> (+0.03%) ⬆️
crates/tx-parser/src/deposit/test_utils.rs 100.00% <100.00%> (ø)
crates/tx-parser/src/deposit/deposit_tx.rs 98.03% <98.03%> (ø)
crates/tx-parser/src/deposit/error.rs 0.00% <0.00%> (ø)
... and 11 more

... and 7 files with indirect coverage changes

Copy link
Contributor

@bewakes bewakes left a comment

Choose a reason for hiding this comment

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

Looks good, some comments.

Copy link
Contributor

@delbonis delbonis left a comment

Choose a reason for hiding this comment

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

There's two issues here that I would want to resolve, but I'm not sure if it's a feasible lift to do it in here:

  • It's entirely possible for a tx to both be a deposit request, a batch inscription reveal, and a checkpoint inscription reveal. The way the types and filtering are structured right now can't describe that, so it's possible we could end up in a situation where someone can prove that they did something right but the rollup can't understand it and we're stuck.
  • We need to split the manifests into two different types, for a few reasons.
    • We need to be able to extract the raw batch data so that we can store it in the database and reconstruct states from it, but we really don't want to expose all of that into the CL prover because it's a large amount of data. We'd introduce a "short" version that only includes the BlobId that comes out of the prover (ideally we'd reuse the same types for consistency), which is all the CL STF cares about.
    • The "short" version also won't have the request transactions, since the rollup should only care about deposits after they're actually accepted.
    • We also want to break down the inscription types more, so that we have separate types for both blobs and the checkpoints. We could do that here right now, but it would involve making the inscription parsing messier.

I'm not sure what's feasible to of those parts to do here at this stage. Keep in mind some considerations in how the types are structured to make it easier to implement STR-274.

crates/btcio/src/parser/deposit/deposit_request.rs Outdated Show resolved Hide resolved
crates/btcio/src/parser/deposit/deposit_request.rs Outdated Show resolved Hide resolved
crates/btcio/src/parser/inscription.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/filter.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/filter.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/filter.rs Outdated Show resolved Hide resolved
crates/btcio/src/parser/deposit/deposit_tx.rs Outdated Show resolved Hide resolved
crates/btcio/src/parser/deposit/deposit_request.rs Outdated Show resolved Hide resolved
crates/btcio/src/lib.rs Outdated Show resolved Hide resolved
crates/btcio/src/parser/utils.rs Outdated Show resolved Hide resolved
crates/primitives/src/tx.rs Outdated Show resolved Hide resolved
crates/btcio/src/writer/builder.rs Outdated Show resolved Hide resolved
crates/btcio/src/writer/builder.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/filter.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/messages.rs Outdated Show resolved Hide resolved
@voidash voidash force-pushed the STR-378-SEMANTIC-INFORMATION-L1BLOCK branch from b753bd0 to 0fbeefc Compare September 23, 2024 19:59
@voidash voidash marked this pull request as ready for review September 23, 2024 20:00
@voidash voidash requested a review from delbonis September 23, 2024 20:01
Copy link
Contributor

@delbonis delbonis left a comment

Choose a reason for hiding this comment

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

When we rename something we have to rename all the identifiers that are derived from it. There's 3 different names that refer to the same concept now that need to be unified.

crates/btcio/src/reader/messages.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/messages.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/query.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/query.rs Outdated Show resolved Hide resolved
crates/btcio/src/reader/query.rs Outdated Show resolved Hide resolved
crates/primitives/src/l1.rs Outdated Show resolved Hide resolved
crates/primitives/src/l1.rs Outdated Show resolved Hide resolved
crates/primitives/src/l1.rs Outdated Show resolved Hide resolved
crates/tx-parser/Cargo.toml Outdated Show resolved Hide resolved
sequencer/src/main.rs Outdated Show resolved Hide resolved
…ss and resolve other comments

rename all relevant_tx/_info usage with protocol_op/filters

fix tests
@voidash voidash force-pushed the STR-378-SEMANTIC-INFORMATION-L1BLOCK branch from 0fbeefc to ff18eec Compare September 23, 2024 21:26
@voidash voidash requested a review from delbonis September 23, 2024 21:41
@delbonis
Copy link
Contributor

Still pending formatting issue for fntest lints, can merge now.

@delbonis delbonis merged commit d107314 into master Sep 24, 2024
14 of 17 checks passed
@storopoli storopoli deleted the STR-378-SEMANTIC-INFORMATION-L1BLOCK branch November 28, 2024 10:37
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.

3 participants