-
Notifications
You must be signed in to change notification settings - Fork 90
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
Skip empty Script
transaction
#284
Conversation
fixes: FuelLabs/fuel-core#794 |
From a client side as well we should probably filter these out from the mempool as well right? (separate pr and issue ofc) |
src/interpreter/executors/main.rs
Outdated
{ | ||
self.run_program() | ||
} else { | ||
Ok(ProgramState::Skipped) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is a better variant, I think we should just do ProgramState::Return(1)
like create txs did before to avoid extra breaking changes downstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's introduce ProgramState::Skipped
together with an optimal solution.
Why do we need to filter them? |
we still want to process the change output for empty script txs. We need to skip the vm's |
Is there any reason the node should process empty tx's? Seems like bloat from a larger perspective, and just adds history without doing anything |
It can be useful for transfer like in Bitcoin, you can consume inputs and produce outputs |
The utxo updates can still make a lot of meaningful change to the blockchain state without any scripts or contracts. |
Oh nvrm I had thought that everything was a script by default, kept thinking it was analogous to an empty tx |
It still needs to be a valid script tx type, but only the script field is empty. |
Fixes FuelLabs/fuel-core#794
It is fast but not an optimal solution to unblock users. With the right solution, we need to skip execution totally without allocating any memory and
Interpreter
. But it requires some refactoring to support transactions which not affect VM during execution(like emptyScript
orCreate
transactions).