Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[NC-1337] Support responding to GetNodeData requests. #587

Merged
merged 5 commits into from
Jan 17, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

Support responding to ETH63 GET_NODE_DATA requests. With this change, Geth (and any other client that implements fast sync) can use Pantheon as a fast sync source.

Fixed Issue(s)

NC-1337

Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

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

LGTM - just a small comment about test organization.

}

@Test
public void shouldRespondToNodeDataRequests() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

The other tests of this flavor are in EthProtocolManagerTest - we should probably consolidate them in one place. I originally put these tests on EthProtocolManager so that the test were less closely tied to implementation details (the serving logic being segregated in this internal package-private EthServer class). I have a slight preference for keeping them there, but I'll leave it up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The EthProtocolManagerTest cases are kind of more integration tests - they cover quite a large chunk of system. Good to have as they ensure it all fits together well but for testing the detail like that limits are applied and missing data is skipped I generally find it's better to focus on a smaller unit which EthServer works well for.

I've added a test in EthProtocolManagerTest for getNodeData to ensure it does all hang together properly.

I suspect if I had to change the other request types much in the future I'd likely write tests in EthServerTest for them just because they're smaller and easier to work with. EthProtocolManagerTest is ensuring they work well now though so I don't feel particularly compelled to go add them now. I'm happy to if you feel strongly about it though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do tend to prefer higher-level tests for this stuff, but I am not super opinionated. So, lgtm - merge away!

@ajsutton ajsutton merged commit 0080fb9 into PegaSysEng:master Jan 17, 2019
@ajsutton ajsutton deleted the NC-1337 branch January 17, 2019 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants