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

rpc: implement eth_coinbase #325

Merged
merged 7 commits into from
Jun 8, 2020
Merged

rpc: implement eth_coinbase #325

merged 7 commits into from
Jun 8, 2020

Conversation

fedekunze
Copy link
Contributor

@fedekunze fedekunze commented Jun 8, 2020

Description

Implements eth_coinbase JSON-RPC query with returns the block proposer's validator address in hex format.

test:

=== RUN   TestEth_coinbase
    TestEth_coinbase: rpc_test.go:150: Got coinbase block proposer: 0x1364216b0243482d8a2dac685410093d35215960
--- PASS: TestEth_coinbase (1.01s)

For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@fedekunze fedekunze self-assigned this Jun 8, 2020
@fedekunze fedekunze requested a review from noot June 8, 2020 10:34
rpc/eth_api.go Outdated
return common.Address{}, err
}

return common.BytesToAddress(block.Block.ProposerAddress.Bytes()), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like it returns the coinbase address on the current block, not the coinbase address of this node?
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_coinbase

not sure if this is functionally correct, what is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it to return the validator address of the node 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :D

@fedekunze fedekunze merged commit 988ee53 into development Jun 8, 2020
@fedekunze fedekunze deleted the coinbase branch June 8, 2020 16:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants