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

Double-check the consistency of STF execution status #1223

Open
Kailai-Wang opened this issue Jan 26, 2023 · 5 comments
Open

Double-check the consistency of STF execution status #1223

Kailai-Wang opened this issue Jan 26, 2023 · 5 comments
Assignees
Labels
D3-chore tasks that need to be completed but don’t provide any additional features/functionality I2-medium should be completed within 10 working days

Comments

@Kailai-Wang
Copy link
Collaborator

Context

It's common that an STF execution will call both parentchain extrinsic and sgx-runtime extrinsic. Ideally we need to make sure the state is synchronised between these: what if one extrinsic succeeds while the other fails? Then we have an inconsistent state.

We seek the long-term solution for it.


✔️ Please set appropriate labels and assignees if applicable.

@Kailai-Wang Kailai-Wang added I2-medium should be completed within 10 working days D3-chore tasks that need to be completed but don’t provide any additional features/functionality labels Jan 26, 2023
@Kailai-Wang Kailai-Wang changed the title Double-check the consistentcy of STF execution status Double-check the consistency of STF execution status Jan 28, 2023
@github-actions
Copy link
Contributor

❗ This issue is stale because it has been open for 60 days with no activity.
Remove Stale label or update it, otherwise this issue will be closed in 7 days.
@litentry/parachain

@github-actions github-actions bot added the Stale label Mar 30, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2023

🔐 This issue was closed because there has been no activity for 7 days since it became stale.

@github-actions github-actions bot closed this as completed Apr 7, 2023
@Kailai-Wang Kailai-Wang removed the Stale label Apr 7, 2023
@Kailai-Wang
Copy link
Collaborator Author

Still relevant

@Kailai-Wang Kailai-Wang reopened this Apr 7, 2023
@clangenb
Copy link

@coax1d is now working on implementing a generic parentchain event checker. integritee-network/worker#1272

In this PR, we will add a handling that is very similar to how we approach indirect calls. We will introduce a ParentchainEvent enum, on which we will implement a trait:

impl HandleParentchainEvent for ParentchainEvent {
   fn handle(self, executor: &IndirectExecutor) -> Result {
      match self {
            ExtrinsicSuccess(event) => event.handle(executor)
            ExtrinsicFailed(event) => event.handle(executor)
        }
   }
}

This is where I would handle failures of parentchain callbacks, essentially and roll-back, unreserve, unlock some sidechain stuff.

Note: some details are still being worked out on our end.

@kziemianek
Copy link
Member

Practically this is not a case for us, because our callback logic is limited to depositing an event (except requesting a VC).
At worst the event might not be recorded on parachain. Does it mean we should rollback all the changes on sidechain ? I'm not sure.

Once we remove indirect calls the only output reported back to parachain would be VC generation.
On the sidechain side the VC generation is a stateless operation, thus no state incosistency can happen if parachain extrinsic fails.

I think there is nothing that needs to be solved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3-chore tasks that need to be completed but don’t provide any additional features/functionality I2-medium should be completed within 10 working days
Projects
None yet
Development

No branches or pull requests

3 participants