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

Implement a ValidateOutbound method in crosschain keeper #2278

Closed
Tracked by #2250
lumtis opened this issue May 28, 2024 · 0 comments · Fixed by #2317
Closed
Tracked by #2250

Implement a ValidateOutbound method in crosschain keeper #2278

lumtis opened this issue May 28, 2024 · 0 comments · Fixed by #2317
Assignees

Comments

@lumtis
Copy link
Member

lumtis commented May 28, 2024

Describe the Issue
Depends on #2276

As per the specs, implement ValidateOutbound

This must be the only entrypoint that finalizes the state of a CCTX

Considered pseudocode:

func ValidateOutbound(outbound, success bool) {
	// retrieve the cctx from store
	cctx := GetCCTXFromOutbound(outbound)

	isRevert := isRevertOutbound(outbound)

	switch {
		case success && !isRevert:
			cctxToOutboundMined(cctx)
		case success && isRevert:
			cctxToReverted(cctx)
		case !success && !isRevert:
			cctxToPendingRevert(cctx)
			revertOutbound := cctx.GetRevertOutbound(cctx)
			initiateOutbound(revertOutbound)
		case !success && isRevert:
			cctxToAborted(cctx)
	}	
}

Then use it in every location where we finalize outbound:

  • VoteOutbound for Observers
  • evm_deposit.go for ZEVM
@lumtis lumtis changed the title Implement a ValidateInbound method in crosschain keeper Implement a ValidateOutbound method in crosschain keeper May 28, 2024
@skosito skosito self-assigned this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants