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

Orphan block payouts are included #27

Open
Tracked by #23
hinto-janai opened this issue Apr 20, 2023 · 1 comment
Open
Tracked by #23

Orphan block payouts are included #27

hinto-janai opened this issue Apr 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@hinto-janai
Copy link
Owner

When P2Pool finds a payout, Gupax immediately saves it into it's own history.

In the case of orphan blocks, this payout is no longer existent, yet Gupax has already has written the data to the file and cannot remove it. There's not really a good way to fix this. Possible solutions and their drawbacks:

Solution Drawback
Wait a few minutes (2-3 blocks) before appending data Payout data will hang in memory, what happens when the user exits Gupax during this time? Flush the possible bad data to disk? Ignore it?
Check each payout for validity via the current monerod connection We have to make tons of connections that are 99.99% of the time useless
Upon Gupax startup, check payout validity via monerod RPC calls Same as above
Upon Gupax startup, check payout validity via a hardcoded list of known orphaned blocks Maintaining this is painful

The first two will also have the drawback of having delayed data, aka, when a payout is received, the user won't immediately see it in the [Status] tab and submenus.

Another solution (that puts the burden on the user) is to have a UI for deleting a payout line from the history, automatically deducting it from the total XMR received, and total payout count:

// Errors that aren't handled:
//   - Parsing `&str` -> `u64/f64`
//   - Subtraction underflows
//   - Writing to disk

for (line, payout) in payout_log_lines.enumerate() {
    if user_clicked_remove {
        subtract_payout(payout);
        remove_payout_log_line(line);
        decrement_total_payout_count();
    }
}
@hinto-janai hinto-janai added the bug Something isn't working label Apr 20, 2023
@hinto-janai hinto-janai mentioned this issue Apr 20, 2023
17 tasks
@R3yn4ld
Copy link

R3yn4ld commented Apr 27, 2023

Hi, very nice work overall, I used to use docker p2pool+monerod+xmrig, now I rely on your awsome gui.

Actually I check payout for validity via the monerod gui-wallet and edit Gupax files by hand.
I'd prefer 99.99% useless connection.
Some ideas:

  • filter to check only today payouts? only last n payouts?
  • add a confirmed/pending word at the end of the line in log and then check only pending payouts?

Also, if a payout occurs while gupax is closed, it is missing from history (Same effect with your first solution). My workaround is to export monero transaction with gui-wallet, and then doing manual work with a spreadsheet.

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

No branches or pull requests

2 participants