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

Validate transactions using local state #586

Open
Tracked by #6539
sideninja opened this issue Sep 25, 2024 · 0 comments
Open
Tracked by #6539

Validate transactions using local state #586

sideninja opened this issue Sep 25, 2024 · 0 comments

Comments

@sideninja
Copy link
Contributor

sideninja commented Sep 25, 2024

We should validate transactions using the local state (either with remote register API or local register index) instead of relying on the network to return invalid transaction error.

The problem we are facing now is that we have to wait for the network to process the transaction to figure out whether a nonce was incorrect, that is because we have no way to locally test if the nonce is correct for example. Once we have access to the state locally we can do such checks before submitting the transaction to the network and significantly lower the response time.

The transaction pool should then just return the hash of the transaction if valid or an error if invalid. The pool shouldn't have to wait for the transaction result, because that will anyway be done by requesting the transaction receipt.

At that point we should refactor the transaction pool https://github.com/onflow/flow-evm-gateway/blob/main/services/requester/pool.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant