-
Notifications
You must be signed in to change notification settings - Fork 95
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
Take into account spent gas during synchronous predicates estimation #771
Conversation
let result = transaction.estimate_predicates(¶ms, MemoryInstance::new()); | ||
|
||
// Then | ||
assert_eq!(Ok(()), result); |
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.
if the estimation runs out of gas due to each predicate running an infinite loop, why is this an Ok(())
?
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.
It was done a long time ago to allow estimate predicates even if they return false. For cases when signature incorrect and predicate fails
I also don't like it=D I was thinking of modifying the code and returning an error in all cases except false predicate. But it will change how estimation works, so I decided not to include it in this PR.
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.
Ok - this seems odd but makes sense given the context. If predicates are invalid the estimation should return an error imo.
Closes #756
The
fuel-core
already uses synchronous predicate estimation, so we don't need any other changes.Before requesting review