Determine threat models to call data compression #234
Replies: 12 comments
-
Summary of slack conversation: Using a complex compression algorithms, particularly over batches of transactions makes it hard to figure out how to charge users. Some ideas that were floated:
Notes / drawbacks
My proposed options:
|
Beta Was this translation helpful? Give feedback.
-
With batch level compression, it's clear that it's impossible to accurately determine the fees until "runtime" (transaction inclusion time). I suspect even then it's close to impossible to perfectly determine the fees. I guess then the big decision for product are:
Per Transaction
Cons
Per Batch
Cons of exact fees
Cons of estimated fees
Please let me know if there's another approach that you think I'm missing or if the pros/cons don't feel right. |
Beta Was this translation helpful? Give feedback.
-
@trianglesphere this is great, I agree that these are probably the "big bucket" decisions. I can identify another tangential decision, which is how fee payment occurs. I can see worlds where:
The second option has advantages for implementation (can contain everything in the block derivation logic where the compression actually happens), but may be a worse product. Separately, a couple of questions:
|
Beta Was this translation helpful? Give feedback.
-
Not quite. The second three are a refinement of the first three in terms of how to ask product (sorry for the confusion).
I'm not sure on the exact loss that we can limit it to, but we'll never get in s state where we are undercharging by a factor of 10 or something like that.
|
Beta Was this translation helpful? Give feedback.
-
Yep. It seems like we are shying away from the refund, but it's definitely an option worth exploring. I don't think it actually make "perfect" compressor estimation possible (without a huge overhead), but it does mean that the protocol itself cannot be exploited. |
Beta Was this translation helpful? Give feedback.
-
I'd like to nuance this somewhat, I think it's feasible under a few conditions. Two scenarios:
Note that a property of this scheme is that transaction tend to become cheaper as the length of the batch increases. The first transaction effectively gets the same compression as if it was compressed on its own, but each successive entry benefits from previous dictionary entries.
I'm not exactly sure what you mean here. Intrinsic gas in L1 is 21k + calldata cost. What is it currently on L2 (where we do charge the "L1 fee" for calldata posted on L1) and how will this proposition impact that? (My impression being that it's already changed, so we'd just be changing differently.) What does it mean to be "brittle" in this context? |
Beta Was this translation helpful? Give feedback.
-
This was rephrasing Ben's brittle comment. If we change how charge for L2 calldata it means having to keep multiple different sources in sync. |
Beta Was this translation helpful? Give feedback.
-
@norswap So both For estimating the fees I'm more comfortable guessing based on how the transaction itself compresses and what the current compression ratio is on mainnet. This is something also worth benchmarking with the dictionary versions (a big hope is that they help with the successive tx problem). |
Beta Was this translation helpful? Give feedback.
-
Indeed! I like the idea of charging the per-tx compression and compressing per batch anyway. We could refund the difference but it's tricky to know how to split it, and frankly I doubt it will affect price perception much, so we might as well keep it and do something more impactful with it. Who knows, maybe long term this compression advantage becomes the entirety of the sequencer's profits? |
Beta Was this translation helpful? Give feedback.
-
Yea, compressing the tx in isolation is one way of getting a decent estimation of it's weight. Maybe you charge based on the fraction |
Beta Was this translation helpful? Give feedback.
-
And flushing does slightly reduce compressed size, but not as much as I thought
|
Beta Was this translation helpful? Give feedback.
-
My library deserialises ABI arguments with RLP by using the ABI schema to differentiate between signed and unsigned values. Could that not work? The RLP argument in:
Unpacks to ABI:
|
Beta Was this translation helpful? Give feedback.
-
Prior discussion here: There is prior discussion here: #10
Things to consider
Beta Was this translation helpful? Give feedback.
All reactions