-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update L1Tx ref types to include multiple proto ops per tx #618
base: STR-807-inscription-changes
Are you sure you want to change the base?
Update L1Tx ref types to include multiple proto ops per tx #618
Conversation
da8be4c
to
e78e71d
Compare
Commit: a8d4e6e SP1 Performance Test Results
|
0a66e86
to
d8f04ee
Compare
6c885d6
to
505735d
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## STR-807-inscription-changes #618 +/- ##
===============================================================
+ Coverage 56.15% 56.28% +0.12%
===============================================================
Files 316 318 +2
Lines 32852 32929 +77
===============================================================
+ Hits 18449 18535 +86
+ Misses 14403 14394 -9
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to rework the data structures a little bit to make them more accurately reflect the design we have now.
Also, see the visitor-oriented approach. The goal with that was to decouple the "figuring out what to do with protocol ops we get" from the "actually finding the protocol ops" parts so that handling can be different depending on if it's in the proof or in the reader.
crates/l1tx/src/filter.rs
Outdated
pub fn filter_protocol_op_tx_refs<F>( | ||
block: &Block, | ||
params: &RollupParams, | ||
filter_config: &TxFilterConfig, | ||
) -> Vec<ProtocolOpTxRef> { | ||
process_raw: &mut F, | ||
) -> Vec<ProtocolOpTxRef> | ||
where | ||
F: FnMut(&RawProtocolOperation) -> anyhow::Result<()>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can write this with &mut impl FnMut(...) -> ...
crates/state/src/tx.rs
Outdated
/// Similar to [`ProtocolOperation`] except that this also contains blob data which is not relevant | ||
/// to chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see DA blobs here.
Also it is relevant, we need to see the blob commitments.
I'm a bit confused about what the purpose of this type is, being distinct from the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it is relevant, we need to see the blob commitments.
Yes, the commitments, but not the actual data/blob which is what I meant in the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'm a bit confused about what the purpose of this type is, being distinct from the other one.
So the idea here is that RawProtocolOp
would contain a variant Da(Vec<u8>)
whereas ProtocolOp
would have the counterpart DaCommitment(Buf32)
. The other variants would be the same. Those(Da/DaCommithemt) are not here right now because we don't actually have DA at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do the visitor thing. The approach with the handler function is just an roundabout and inelegant way of doing the same general idea. Do not copy out the full contents of DA into a type if it's not necessary. That's what the visitor based approach (that I guided in the original PR) enables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
d8f04ee
to
3eb992c
Compare
9991efb
to
501dbc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Discussed in core sync, leaving review here to continue work.)
} | ||
|
||
// Do stuffs with DA. | ||
fn visit_da(&self, d: &[u8]) -> ProtocolOperation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chunks: impl Iterator<Item = &[u8]>
pub trait OpsVisitor { | ||
// Do stuffs with `SignedBatchCheckpoint`. | ||
fn visit_checkpoint(&self, chkpt: SignedBatchCheckpoint) -> ProtocolOperation { | ||
ProtocolOperation::Checkpoint(chkpt) | ||
} | ||
|
||
// Do stuffs with `DepositInfo`. | ||
fn visit_deposit(&self, d: DepositInfo) -> ProtocolOperation { | ||
ProtocolOperation::Deposit(d) | ||
} | ||
|
||
// Do stuffs with `DepositRequest`. | ||
fn visit_deposit_request(&self, d: DepositRequestInfo) -> ProtocolOperation { | ||
ProtocolOperation::DepositRequest(d) | ||
} | ||
|
||
// Do stuffs with DA. | ||
fn visit_da(&self, d: &[u8]) -> ProtocolOperation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to take &mut self
.
3eb992c
to
d7dc0a9
Compare
Description
This PR does the following:
RawProtocolOperation
type, which is supposed to contain extra info(like da blob) which is not required for the rollup protocol along with the data that is required(like da commitment, deposit info, etc).filter_protocol_op_tx_refs
wherein a function of type(&RawProtocolOperation) -> Result<()>
can be passed such that prover can pass a no-op while full node can pass logic to store extra info to database if necessary.Type of Change
Notes to Reviewers
Checklist
Related Issues
STR-935