-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 GetDepositContract in the config API #8316
Conversation
This reverts commit e01dd52.
beacon-chain/rpc/beaconv1/config.go
Outdated
chainId, err := binary.ReadUvarint(buf) | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "could not obtain genesis fork version: %v", err) | ||
} |
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 did not test the error case as this can only happen when our fork version is completely broken.
beacon-chain/rpc/beaconv1/config.go
Outdated
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "could not obtain genesis fork version: %v", err) | ||
} | ||
byteAddress := [20]byte(bs.PowchainInfoFetcher.DepositContractAddress()) |
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.
Similar to my last feedback, we do not need to implement a new service getter to obtain deposit contract address. This is already accessible via params.BeaconConfig().DepositContractAddress
(where powchain service gets it too)
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.
Good catch. I have to go through the config file and make a mental note of what is available.
Actually it turned out I tried to fetch the wrong thing. It was supposed to be the Eth1 chain ID, not the Eth2 fork version. There was a mistake in the endpoint's description. I fixed it in one of the commits. |
beacon-chain/rpc/beaconv1/server.go
Outdated
@@ -32,6 +32,7 @@ type Server struct { | |||
ChainInfoFetcher blockchain.ChainInfoFetcher | |||
DepositFetcher depositcache.DepositFetcher | |||
BlockFetcher powchain.POWBlockFetcher | |||
PowchainInfoFetcher powchain.ChainInfoFetcher |
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.
Are these changes still relevant to this PR?
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.
Nope. +1
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR implements config API's
GetDepositContract
method according to the spec: https://ethereum.github.io/eth2.0-APIs/#/Config/getDepositContractWhich issues(s) does this PR fix?
Part of #7510
Other notes for review
N/A