node
node copied to clipboard
Use stateful precompile contracts to process ZEVM inbound instead of event parsing
Describe the Issue
To process inbounds on the ZEVM we currently have a "pull" model where the function call emits event and the events are parsed in the PostTx hook.
A more intuitive model and potentially much simpler would be to use a "push" model where the inbound can directly validated by calling a precompile smart contract.
The smart contract would only be callable by the gateway contract.
Let's call it cctxCreator here
interface ICCTXCreator {
function validateInbound(...) bool
}
func ValidateInbound(...) {
if caller != gatewayAddress {
return false
}
crosschainkeeper.ValidateInbound(....)
}