MystenLabs / sui

Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
https://sui.io
Apache License 2.0
5.84k stars 11.06k forks source link

Use dedicated table for determining if transaction was executed in current epoch #18411

Closed mystenmark closed 3 days ago

mystenmark commented 3 days ago

This is the first step of a change to remove effects signing from the execution path and adding effects equivocation prevention (necessary for WB cache on validators).

vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **multisig-toolkit** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/multisig-toolkit/CKSbJ7k5paZgzt7TuRxriksr2Qqy)) | [Visit Preview](https://multisig-toolkit-git-mlogan-executed-in-epoch-table-mysten-labs.vercel.app) | | Jun 25, 2024 8:58pm | | **sui-kiosk** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-kiosk/BYKVfPYjjubAKLBovv3j7JdriREz)) | [Visit Preview](https://sui-kiosk-git-mlogan-executed-in-epoch-table-mysten-labs.vercel.app) | | Jun 25, 2024 8:58pm | | **sui-typescript-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-typescript-docs/6wYduadzkcotKUUvdTaMbkY3mQe3)) | [Visit Preview](https://sui-typescript-docs-git-mlogan-executed-in-e-cf3c0b-mysten-labs.vercel.app) | | Jun 25, 2024 8:58pm |
lxfind commented 3 days ago

Could you double check how this would be used differently than the executed_effects table in AuthorityStore?

mystenmark commented 3 days ago

Could you double check how this would be used differently than the executed_effects table in AuthorityStore?

The main difference is that the executed_effects table can be pruned. Really the only purpose of storing this info in the epoch store is so that the checkpoint builder knows when to stop causal completion. Any dependency that is not executed in the current epoch is omitted from the checkpoint.

In theory, we could accomplish the same thing by looking up the effects in the perpetual store. If they are present, the executed_in_epoch field would tell us which epoch the effects are from. If they are absent, they must be from a prior epoch, since we don't prune that table in the same epoch. However, I wouldn't want to do things that way, since it would mean a pruner bug could cause a checkpoint fork.