Rewards claim was mistakenly working due to leaving a work-around commit
in the git-tree and mistakenly testing the python script and assuming it
worked. After backing out those changes I identified that rewards claim
was still broken due to several bugs of which I have debugged and
incorporated into this PR.
- Ethereum addresses stored in the DB are stored with a 0x prefix. This
was omitted as we were passing address strings directly through to the
DB. I've made this type safe and convert at the very last moment to
ensure we don't hit this bug. In future, it'd be better to store binary
in the DB.
- The exclude parameter when querying nodes was broken. The code was
double aggregating the node that was requesting a rewards claim. This
meant the generated aggregate signature did not match the smart
contract. This is fixed with the correct break in the for loop.
Additionally, I've added a trace log to dump out the aggregate pubkey
and how many keys we aggregated.
- I've added more error checking in general to try and catch problems earlier.