Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Conversation

@sbwdlihao
Copy link
Contributor

the result of keys command is unsorted, this makes no difference in pplns but in prop there maybe a block credited before a block which solve_time is older than it ant will trigger error in chain calc_shares, so i think we should sort unproc_blocks by solve_time

the result of keys command is unsorted, this makes no difference in pplns but in prop there maybe a block credited before a block which solve_time is older than it ant will trigger error in chain calc_shares, so i think we should sort unproc_blocks by solve_time
@icook
Copy link
Member

icook commented Oct 28, 2014

I'm pretty sure this is actually not a problem because of the way the Redis share slice system operates. Essentially the Redis data structure will have a "solve slice" and the previous block solved on this share chain will designate the "previous solve slice" allowing us to use exactly the shares that were used to solve the block for PROP (which is actuall broken atm, see #74). When the shares are grabbed (order) has no effect on this data or when/where it's collected.

Also, the tests need to not be failing.

@sbwdlihao
Copy link
Contributor Author

i got an exception when test two chains where one is a pplns chain and the other is a prop chain, the exception said "stop_slice 4 cannot be greater than start_slice 7!".
i got data from table chain_slice
qq 20141028091911
as picture shows chain 2 and solve_slice's order is 2, 5, 6, 7, then i got data from redis and the unproc_block data's order is [{'chain_2_solve_index':'4', 'solve_time': '1414404094.531292'},{'chain_2_solve_index':'3','solve_time': '1414404085.525739' },{'chain_2_solve_index':'8','solve_time': '1414405326.228684' }]
so i think the reason of this exception is redis data unsorted

@icook
Copy link
Member

icook commented Oct 28, 2014

Ah, I understand the issue you encountered now, you're definitely right, although I haven't checked to see why the tests broke.

However I'm somewhat nervous about relying on the "previous" block in the sharechain in general, and I think a much better solution would be to have powerpool explicitly enter the started index when it rotates slices. I'll look into implementing that, since I realize this solution (not yours, mine...) is not very resiliant. For example, what happens if a bug prevents payout of the block previous to the proportional one? It may payout the block wrong unwittingly, which I'd rather not be possible.

If you fix the tests I'll merge this.

@icook
Copy link
Member

icook commented Oct 28, 2014

Powerpool now stores the start index as well as solve index, so this should be changeable to not rely on other block data soonish.

simplecrypto/powerpool@a9af7a1

@sbwdlihao
Copy link
Contributor Author

i try to use start index to solve this problem and finished test with LTC, DOGE in testnet
simplecrypto/powerpool#100
#154

@icook
Copy link
Member

icook commented Nov 2, 2014

Superceded by #154.

@icook icook closed this Nov 2, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants