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

[BUG]: check_pending_account_resources must match pending transaction acceptance #87

Closed
1 task done
sgerbino opened this issue Dec 22, 2022 · 0 comments · Fixed by #88
Closed
1 task done

[BUG]: check_pending_account_resources must match pending transaction acceptance #87

sgerbino opened this issue Dec 22, 2022 · 0 comments · Fixed by #88
Assignees
Labels
bug Something isn't working

Comments

@sgerbino
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

This RPC call is used at the beginning of submit_transaction and determines if the transaction would be accepted so it should match the implementation that actually adds the pending transaction.

Right now it is possible to have enough available RC left on the head node while not having enough RC on another fork which results in the rejection of the pending transaction.

bool mempool_impl::check_pending_account_resources(
const account_type& payer,
uint64_t max_payer_resources,
uint64_t trx_resource_limit,
std::optional< crypto::multihash > block_id ) const
{
auto lock = _db.get_shared_lock();
auto node = relevant_node( block_id, lock );
KOINOS_ASSERT(
node,
pending_transaction_unknown_block,
"cannot check pending account resources from an unknown block"
);
return check_pending_account_resources_on_node( node, payer, max_payer_resources, trx_resource_limit );
}

Expected behavior

If check_pending_account_resources returns true then the resulting pending transaction should be accepted.
If check_pending_account_resources returns false then the resulting pending transaction should fail.

Steps to reproduce

No response

Environment

- OS:

Anything else?

No response

@sgerbino sgerbino added the bug Something isn't working label Dec 22, 2022
sgerbino added a commit that referenced this issue Dec 22, 2022
@sgerbino sgerbino self-assigned this Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant