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

feat(protocol): support delayed forced inclusion of txs #18826

Draft
wants to merge 39 commits into
base: pacaya_fork
Choose a base branch
from

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jan 23, 2025

The idea is inspired by @cyberhorsey's PR: https://github.com/taikoxyz/taiko-mono/pull/18824/files#diff-bea5dd46ba3d231a238b7c76adc7d09dfa3f8ebd3bf552407f9098492f3ff8f5

The difference:

  • Moved forced inclusion related code to two files: TaikoInboxWithForcedTxInclusion and IForcedInclusionStore (impl missing). IPreconfRouter shall now callTaikoInboxWithForcedTxInclusion, not TaikoInbox.

  • Forced-inclusion data (txLists) are now in blobs, not writen to storage as bytes

Copy link

openzeppelin-code bot commented Jan 23, 2025

feat(protocol): support delayed forced inclusion of txs

Generated at commit: b96c0efb230108c57d1f8e9c7cc1ecd68ddaeaac

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
3
3
0
10
40
56
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik
Copy link
Contributor Author

dantaik commented Jan 23, 2025

@jeff, I had a call with our friends from Nethermind, here are some feedback/suggestions:

  • In the ForcedInclusionStore, we should support using both calldata and a blob to submit their transactions (lets implement the blob support as the first step)
  • A request should be processed with a 12*x seconds delay since 1) the time it is saved or 2) the time the previous request is processed or 3) the time the last batch is proposed. which ever is the biggest.


/// @title TaikoInboxWithForcedTxInclusion
/// @custom:security-contact security@taiko.xyz
contract TaikoInboxWithForcedTxInclusion is EssentialContract {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

need a better name

Base automatically changed from emit_blob_hashes_in_event to pacaya_fork January 24, 2025 04:30
@cyberhorsey cyberhorsey requested a review from Brechtpd January 24, 2025 20:45
uint64 _head = head;
ForcedInclusion storage inclusion = queue[_head];

if (inclusion.createdAt != 0 && block.timestamp >= inclusionDelay + inclusion.createdAt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm kind of thinking that making the inclusion of these forced transactions "automatic" (as in the preconfer cannot decide easily when they are included) could be problematic for a preconfer. Because the preconfer will not always know in which L1 block its propose transaction will be included, but depending on when that happens, these forced transactions need to be inserted at the right place to be able to give preconfirmations after these are supposed to happen. It does seem to introduce a level of non-determinism that could be quite tricky for a preconfer to fully control easily.

When the preconfer can decide on his own when these transactions actually get included within a window, that seems to make the preconfers job much easier to make things 100% predictable without any tricky boundaries enforced onchai, resulting with a hard deadline on when a propose tx actually needs to be included onchain to not mess with the expected order of the preconfer.

Comment on lines +44 to +47
// Call the proposeBatchWithForcedInclusion function on the ForcedInclusionInbox
(, meta_) = IForcedInclusionInbox(forcedInclusionInbox).proposeBatchWithForcedInclusion(
_forcedInclusionParams, _batchParams, _batchTxList
);
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this is still only callable by the whitelisted preconfers right? If so, would say again that forced inclusion != inclusion. Wrote about that here before: #18815 (comment)

Inclusion can only be guaranteed when block proposing is made permissionless again (at least for the forced blocks, but may as well allow any block to be proposed when that happens because why not).

@dantaik dantaik changed the title feat(protocol): show case an different forced-inclusion idea feat(protocol): support delayed forced inclusion of txs Jan 25, 2025
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.

4 participants