-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[light/jsonrpc] Provide the actual account for eth_coinbase
RPC and unify error handeling for light and full client
#9383
Conversation
@niklasad1 Do you think it would be a good idea to align full client and light client behavior? Change light client to return zero address when not found, or change full client to return error when not found? |
Yeah, I think we should align the behavior in the full and light client but I don't like the behavior of returning the zero address to indicate errors. So, I would want to return errors in both clients however it might make the |
Yeah, we should have both methods aligned. I'm ok to include that in the relnotes, "the RPC spec" doesn't really describe error conditions at all (I guess that's the reason we didn't return many errors in the past), so there is much room for improvement here. I'm ok with returning an error, but we should also document all the error conditions in wiki in some nice readable and consistent format. |
@@ -252,7 +252,15 @@ impl<T: LightChainClient + 'static> Eth for EthClient<T> { | |||
} | |||
|
|||
fn author(&self) -> Result<RpcH160> { |
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.
Just for my education: what is the reason for rpc-specific hashtypes like RpcH160
?
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.
Historical reasons - hash types were not JSON-serializable in the past, I think currently we could get rid of the wrappers and just use the regular types
45dc28b
to
cda2a76
Compare
eth_coinbase
RPCeth_coinbase
RPC and unify error handeling for light and full client
cda2a76
to
0150a2f
Compare
The previous implementation always provided the `zero address` on `eth_coinbase` RPC. Now, instead the actual address is returned on success or an error when no account(s) is found!
In the full-client return an error when no account is found instead of returning the `zero address`
0150a2f
to
bc05784
Compare
…ount-eth_coinbase
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.
Looks good.
… unify error handeling for light and full client (#9383) * Provide the actual `account` for eth_coinbase The previous implementation always provided the `zero address` on `eth_coinbase` RPC. Now, instead the actual address is returned on success or an error when no account(s) is found! * full client `eth_coinbase` return err In the full-client return an error when no account is found instead of returning the `zero address` * Remove needless blocks on single import * Remove needless `static` lifetime on const * Fix `rpc_eth_author` test
* parity-version: bump beta to 2.0.4 * [light/jsonrpc] Provide the actual account for `eth_coinbase` RPC and unify error handeling for light and full client (#9383) * Provide the actual `account` for eth_coinbase The previous implementation always provided the `zero address` on `eth_coinbase` RPC. Now, instead the actual address is returned on success or an error when no account(s) is found! * full client `eth_coinbase` return err In the full-client return an error when no account is found instead of returning the `zero address` * Remove needless blocks on single import * Remove needless `static` lifetime on const * Fix `rpc_eth_author` test * parity: print correct keys path on startup (#9501) * aura: don't report skipped primaries when empty steps are enabled (#9435) * Only check warp syncing for eth_getWorks (#9484) * Only check warp syncing for eth_getWorks * Use SyncStatus::is_snapshot_syncing * Fix Snapshot restoration failure on Windows (#9491) * Close Blooms DB files before DB restoration * PR Grumbles I * PR Grumble * Grumble
Newer versions of parity don't return zero address in `eth_coinbase` when no accounts exist (openethereum/parity-ethereum#9383). It prevents netstats agent from obtaining correct node version info.
The previous implementation always provided the
zero address
oneth_coinbase
RPCs.Now instead, the actual address is returned on
success and an error when no accounts are found!
Note, this behavior is different from the
full client
where we return thezero address
if no accounts are found!Manual tests
Account exists
Account doesn't exist