-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement eth_submitHashrate and eth_submitWork #1280
Implement eth_submitHashrate and eth_submitWork #1280
Conversation
32017cf
to
b5d74a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kclowes let me know if you want me to also take a look at this.
68b3b03
to
727b865
Compare
web3/_utils/rpc_abi.py
Outdated
@@ -51,6 +51,7 @@ | |||
'eth_sendRawTransaction': ['bytes'], | |||
'eth_sendTransaction': TRANSACTION_PARAMS_ABIS, | |||
'eth_sign': ['address', 'bytes'], | |||
'eth_submitHashrate': ['uint', None], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is right (not sure if it's always bytes32
)
'eth_submitHashrate': ['uint', None], | |
'eth_submitHashrate': ['uint', 'bytes'], |
Also, maybe ['bytes8', 'bytes32', 'bytes32']
for eth_submitWork
?
Adding this extra fields should automatically handle arguments like submitting hex strings, hex literals, or python bytes
, as well as length checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, the EIP is still a draft. Since geth & parity implement the same way, that wins over the doc. :)
web3/middleware/pythonic.py
Outdated
apply_formatter_at_index(nonce_formatter, 0), | ||
apply_formatter_at_index(hexstr_if_str(to_hex), 1), | ||
apply_formatter_at_index(hexstr_if_str(to_hex), 2), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these changes to pythonic can go away with the rpc_abi
change, I think.
75eb226
to
1d34cc4
Compare
Ready for final review |
web3/_utils/rpc_abi.py
Outdated
@@ -51,6 +51,8 @@ | |||
'eth_sendRawTransaction': ['bytes'], | |||
'eth_sendTransaction': TRANSACTION_PARAMS_ABIS, | |||
'eth_sign': ['address', 'bytes'], | |||
'eth_submitHashrate': ['uint', 'bytes'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be [bytes32, bytes32]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While parity's fine with that, it seems like geth doesn't like that, going with ['uint', 'bytes32']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iiiinteresting. geth's docs are wrong then. Sounds good!
1d34cc4
to
aa21d98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
b04f966
to
ac274db
Compare
I just merged an |
ac274db
to
19a3a97
Compare
19a3a97
to
fa9207e
Compare
What was wrong?
eth_submitHashrate
needed implementation according to ERC 1474Related to Issue #1273
Cute Animal Picture