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

Job_creator in roles_logic_sv2 do not check if coinbase_tx_value_remaining is updated by TP #1083

Open
Fi3 opened this issue Aug 8, 2024 · 0 comments
Assignees
Labels

Comments

@Fi3
Copy link
Collaborator

Fi3 commented Aug 8, 2024

In roles_logic_sv2 we have:

    coinbase_outputs[0].value = match new_template.coinbase_tx_value_remaining.checked_mul(1) {
        //check that value_remaining is updated by TP
        Some(result) => result,
        None => return Err(Error::ValueRemainingNotUpdated),
    };

The comment say that we want to check if value remaining is updated by the TP, this make sense. But the code do not do that1.
Here IMO we can just check if coinbase_tx_value_remaining != 0 with an assertion (is fine to panic here cause if it is 0 tp is sending wrong templates and pool can not work)

Footnotes

  1. the code it only verify that an u64 multiplied by one do not overflow, I'm pretty sure that this is impossible.

@Fi3 Fi3 added important Needs to be done roles-logic-sv2 labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants