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

Chunked DA txs #925

Merged
merged 27 commits into from
Aug 20, 2024
Merged

Chunked DA txs #925

merged 27 commits into from
Aug 20, 2024

Conversation

kpp
Copy link
Contributor

@kpp kpp commented Jul 25, 2024

Description

This PR implements a new DA tx format. Here is the format: #871 (comment)

Also instead of txids we use wtxids for prefixes. So we don't try to find nonces for txid, we find nonces so that wtxid matches a specific prefix. It was done for #991 better inclusion proof (O(log N) instead of O(N)).

In order to speed up proofs when a DA block has both zkproof and seq commitment I implemented a trick to parse only DA tx that are related to our proofs. Before we had 1 prefix, but now there are two of them (#972). Before the prefix was 00, now they are:

  • light_client: 22
  • batch_proof: 11

Where light_client - zkproofs (diffs), batch_proof - currently only a tx with sequencer commitment, but will be extended with forced transactions sometime in the future.

@eyusufatik eyusufatik mentioned this pull request Aug 13, 2024
49 tasks
kpp and others added 4 commits August 13, 2024 16:37
* depend only on wtxid

* verify merkle root of coinbase tx, use zkvm efficient sh256 and bitcoin merkle tree

* remove unused asserts

* pr fixes

* pr fixes
crates/bitcoin-da/src/service.rs Outdated Show resolved Hide resolved
* get ready for test fixes

* fix tests

* reactivate some of the verifier tests

* fix remaning bitcoin-da tests

* cleanup
@kpp kpp changed the title [WIP] Chunked DA txs Chunked DA txs Aug 19, 2024
kpp and others added 3 commits August 19, 2024 15:40
* Add merkle tree tests (#995)

* Add merkle tree tests

* Add 1 tx test to bitcoin compare

---------

Co-authored-by: yaziciahmet <yaziciahmetcleargmail.com>

* Fix errors/lints

---------

Co-authored-by: Ahmet Yazıcı <[email protected]>
@kpp kpp marked this pull request as ready for review August 19, 2024 21:05
@auto-assign auto-assign bot requested a review from ercecan August 19, 2024 21:05
Copy link
Contributor

@rakanalh rakanalh left a comment

Choose a reason for hiding this comment

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

Genuine question: Is there an E2E test that uses bitcoin-da?

@kpp
Copy link
Contributor Author

kpp commented Aug 19, 2024

Genuine question: Is there an E2E test that uses bitcoin-da?

Not really. Esad dumped a bitcoin block with txs (see mock_txs.txt) and all tests passed (except for CI but I will fix it). Tests are: parse seq commitment, verify inclusion etc.

@eyusufatik
Copy link
Member

eyusufatik commented Aug 20, 2024

Genuine question: Is there an E2E test that uses bitcoin-da?

waiting on @jfldde for e2e bitcoin framework 🙄

crates/bitcoin-da/src/service.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/service.rs Outdated Show resolved Hide resolved
crates/primitives/src/constants.rs Show resolved Hide resolved
crates/bitcoin-da/Cargo.toml Outdated Show resolved Hide resolved
crates/bitcoin-da/src/lib.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/helpers/builders.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/helpers/builders.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/service.rs Show resolved Hide resolved
crates/bitcoin-da/src/service.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/helpers/parsers.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/helpers/parsers.rs Outdated Show resolved Hide resolved
crates/bitcoin-da/src/helpers/parsers.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 20, 2024

@kpp kpp merged commit 5dea363 into nightly Aug 20, 2024
12 checks passed
@kpp kpp deleted the kpp/chunked_da branch August 20, 2024 10:37
This was referenced Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants