-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: remove TEE from tree #2627
Conversation
TEE input producer jobs are now created by monitoring the db instead of hooking directly into the tree logic.
Change get_new_l1_batches() to only return a single value.
3a1fa96
to
c1988f7
Compare
// Since we depend on Merkle paths, we use the proof_generation_details table to inform us of newly available to-be-proven batches. | ||
let row = sqlx::query!( | ||
r#" | ||
SELECT |
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.
Wouldn't this mean you could miss some entries (you query once, MAX = 10, you query second time, now there have been 5 batches incoming, MAX = 15, you'd be missing batches 11, 12, 13 and 14, no?).
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.
That should not happen. You only return max(l1_batch_number)
from the proof_generation_details
table if the TEE jobs table is empty (which just handles the special case when the thing comes up for the first time, L114). Normal case is to return max(l1_batch_number)
+1 from the TEE jobs table.
SELECT | ||
MAX(l1_batch_number) AS "number" | ||
FROM | ||
proof_generation_details |
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 like that TEE is tied to proof_generation_details
. If this table happens to become too hot (for instance, a bug in TEE), proof generation (and our SLAs + customer experience) will degrade. I don't have a better solution than code duplication, which I dislike even more.
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.
What code do you intend to duplicate as a potential solution? I'm open to suggestions in terms of an alternate "signal" to monitor for new batches.
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 think that the right way would be to move save_merkle_paths_artifacts_metadata
from proof_generation_dal
to the blocks_dal
(e.g. existence of the metainformation is the property of the block, regardless of the consumer).
This way we (later, not now!) will be able to get rid of insert_proof_generation_details
in the updater.rs
as well -- so that the tree is not aware of any verification logic (as it should be).
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'd say it's unclear who would create the tables afterwards. But I don't oppose the suggestion.
TEE input producer jobs are now created by monitoring the db instead of hooking directly into the tree logic.
What ❔
Why ❔
Checklist
zk fmt
andzk lint
.