Skip to content
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

Updating my fork #3

Open
wants to merge 177 commits into
base: upnp_support
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
be8cb71
Network vs node configuration (#1223)
MadelineMurray Apr 7, 2019
e337369
Make contract size limit configurable. (#1227)
rojotek Apr 7, 2019
54c6381
custom deserializer for TopicsParameter (#1235)
macfarla Apr 7, 2019
97a749c
Updated eea_getTransactionReceipt to include extra parameter
MadelineMurray Apr 7, 2019
62616be
Updated Permissions Configuration File for new CLI options (#1234)
MadelineMurray Apr 8, 2019
f174e74
[PIE-1224] Different request limits for different request types (#1224)
AbdelStark Apr 8, 2019
079d3d4
Enable pipeline chain downloader for fast sync. (#1232)
ajsutton Apr 8, 2019
8959489
[PRIV-45] Improve eea_sendRawTransaction error messages (#1238)
Puneetha17 Apr 9, 2019
00fd18d
Added permissioning overview (#1242)
MadelineMurray Apr 9, 2019
5629570
Update PantheonCommand.java (#1245)
AbdelStark Apr 9, 2019
7dabc53
[PRIV-41] Refactor PrivacyParameters config to use builder pattern (#…
antonydenyer Apr 9, 2019
0014cc0
Reduce memory usage in import (#1239)
shemnon Apr 9, 2019
504ddf2
Feature/pie 1502 ewp options cli (#1246)
AbdelStark Apr 9, 2019
bbeb5b3
added note (#1244)
MadelineMurray Apr 10, 2019
5f3f298
Fixed link (#1249)
MadelineMurray Apr 10, 2019
49df646
Added note about using node permissioning only (#1243)
MadelineMurray Apr 10, 2019
2b9c371
Feature/pie 1502 ewp options cli (#1255)
AbdelStark Apr 10, 2019
b38e260
Choose sync target based on td rather than height (#1256)
mbaxter Apr 10, 2019
ef60bc3
Added 1.0.3 updates (#1250)
MadelineMurray Apr 10, 2019
94ea4b2
added content on free gas (#1252)
MadelineMurray Apr 10, 2019
77ec5c2
[PAN-2433] Fix netty pipeline (#1257)
mbaxter Apr 10, 2019
9bb43a4
[Gradle Release Plugin] - pre tag commit: '1.0.3'.
pegasys-admin Apr 10, 2019
30ba781
[Gradle Release Plugin] - new version commit: '1.1.0-SNAPSHOT'.
pegasys-admin Apr 10, 2019
a18bbcf
[PAN-2529] subscribing to sync events should receive false when in sy…
Errorific Apr 11, 2019
0a19d49
[Minor] Ignore extra json rpc params (#1261)
mbaxter Apr 11, 2019
f8016d2
[PRIV-44] Use single instance of Rocksdb for privacy (#1247)
Puneetha17 Apr 11, 2019
8477392
[PAN-2499] debug trace transaction (#1258)
AbdelStark Apr 11, 2019
516c995
Added fast sync options (#1241)
MadelineMurray Apr 11, 2019
6e577d5
PAN-2404 - Make PeerDiscovertAgentTest less flakey. (#1262)
shemnon Apr 11, 2019
8daaa4e
PIE-1505 - Build broken in Java 12 (#1263)
shemnon Apr 11, 2019
89755f8
RocksDB Statistics in Metrics (#1169)
shemnon Apr 11, 2019
1416524
Allow use of / in branch name when using the branch from tag release …
jframe Apr 12, 2019
a6c4e65
Normalize EnodeURLs (#1264)
mbaxter Apr 12, 2019
03e00dc
Expose sync mode option (#1270)
AbdelStark Apr 12, 2019
19b5443
Feature/move subclass in pantheon command (#1272)
AbdelStark Apr 12, 2019
6eca39e
[PRIV-46] Use labelled timer to differentiate between rocks db metric…
Puneetha17 Apr 12, 2019
dcce589
Keep enode nodeId stored as a BytesValue (#1274)
mbaxter Apr 12, 2019
d64aa2e
Refactor RocksDBStats (#1266)
shemnon Apr 13, 2019
902045a
Create EnodeURL Builder (#1275)
mbaxter Apr 14, 2019
142bd1a
Add block trace RPC methods (#1088)
kziemianek Apr 15, 2019
a3145eb
Log error when a JSON decode problem is encountered (#1278)
CjHare Apr 15, 2019
6afc022
[MINOR] migrate TransactionPool (& affiliated test) from 'core' to 'e…
smatthewenglish Apr 15, 2019
8c8ebe8
fetch local transactions in isolation (#1259)
smatthewenglish Apr 15, 2019
1d6bfe3
Rollback to rocksdb 5.15.10 (#1279)
shemnon Apr 15, 2019
0f1c70d
[PAN-2560] Cleanup PeerConnection interface (#1282)
mbaxter Apr 15, 2019
b80c523
[PIE-7] Ignore transactions from the network while behind chain head …
smatthewenglish Apr 15, 2019
90fef9b
Fix running ATs with in-process node runner (#1285)
ajsutton Apr 15, 2019
af8345e
Simplify enode construction (#1283)
mbaxter Apr 16, 2019
41fce79
[PRIV-54] Use default enclave public key to generate eea_getTransacti…
Puneetha17 Apr 16, 2019
bd19d60
Update permissioning smart contract interface to match updated EEA pr…
Errorific Apr 16, 2019
233bf7b
[PAN-2560] Consolidate p2p node info methods (#1288)
mbaxter Apr 16, 2019
06f2405
Undo changes to PendingTransactions method visibility (#1281)
mbaxter Apr 16, 2019
62cbad4
Switch to new sync target if it exceeds the td threshold (#1286)
ajsutton Apr 16, 2019
4eee7d0
Better errors for when permissioning contract is set up wrong (#1296)
Errorific Apr 17, 2019
33c0794
Remove --fast-sync-wait-time option (#1297)
ajsutton Apr 17, 2019
318c41b
PAN-2485#Add net_services json rpc endpoint (#1295)
usmananwar Apr 17, 2019
2035e81
Fix RunnerBuilder method names (#1284)
mbaxter Apr 17, 2019
6ca4d6f
Updated eth_getTransactionCount
MadelineMurray Apr 17, 2019
c76078e
Added 1.1 RC changes (#1298)
MadelineMurray Apr 17, 2019
b12d9ad
Implement max message size rather than limiting with fixed number of …
AbdelStark Apr 17, 2019
0bcc0e5
Pipeline based full sync (#1291)
ajsutton Apr 17, 2019
22fa765
Removed available in 1.1 notes and added links from CLI options (#1294)
MadelineMurray Apr 17, 2019
73235fc
Added txpool pantheon statistics endpoint. (#1293)
rojotek Apr 17, 2019
f8cd3a0
[Gradle Release Plugin] - pre tag commit: '1.1.0-RC1'.
pegasys-admin Apr 17, 2019
c0d4729
[Gradle Release Plugin] - new version commit: '1.1.1-SNAPSHOT'.
pegasys-admin Apr 17, 2019
1508367
Removing 'all' from the help wording for host-whitelist (as that no l…
CjHare Apr 18, 2019
36a2294
Remove remnants of the old dev mode. (#1307)
ajsutton Apr 20, 2019
fbfe1bb
Stop synchronizer prior to stopping the network (#1302)
ajsutton Apr 21, 2019
c2e12d8
PAN-2577 - missing p2p info when queried live (#1310)
shemnon Apr 22, 2019
bca6397
tx limit size send peers follow up (#1308)
AbdelStark Apr 22, 2019
5e790e4
Configure RocksDb max background compaction and thread count (#1312)
ajsutton Apr 23, 2019
41838f9
Remove duplicate init code from PantheonController instances (#1305)
ajsutton Apr 23, 2019
9788119
PIE-1526: Fix account permissioning check case matching (#1314)
lucassaldanha Apr 23, 2019
79f06a7
[PAN-1339] Send local transactions to new peers (#1253)
smatthewenglish Apr 23, 2019
c3e7dfc
Update Enclave executePost method (#1317)
AbdelStark Apr 23, 2019
d6148f3
Use header validation mode for ommers (#1313)
ajsutton Apr 23, 2019
cfa9401
PIE-1526: Normalize account permissioning addresses in whitelist (#1320)
lucassaldanha Apr 23, 2019
bfb6ce5
Require block numbers for debug_traceBlockByNumber to be in hex (#1326)
ajsutton Apr 24, 2019
2871e92
Ensure eth scheduler is stopped in tests (#1324)
ajsutton Apr 24, 2019
baccba9
Improve logging of chain download errors in the pipeline chain downlo…
ajsutton Apr 24, 2019
a728654
[PAN-1878] Provide error message when invalid key specified in key fi…
AbdelStark Apr 24, 2019
1752a87
Allow use of large chain ids (#1289)
jframe Apr 24, 2019
27701de
[PAN-2576] Allow whitespace in path (#1327)
AbdelStark Apr 24, 2019
ad7e26b
[PIE-1531] Allow whitespace in file paths loaded from resources direc…
AbdelStark Apr 24, 2019
062ea7a
[PAN-2574] Fix failed tests on Windows (#1332)
AbdelStark Apr 25, 2019
c0bf672
[PAN-1062] Evict old transactions (1 of 2) (#1299)
smatthewenglish Apr 25, 2019
039ec47
Ensured that the transaction statistics endpoint is exposed. (#1330)
rojotek Apr 26, 2019
fc246ff
JsonRpcError decoding to include message (#1336)
CjHare Apr 26, 2019
bed68a5
[PRIV-55] Allow private contract invocations in multiple privacy grou…
iikirilov Apr 26, 2019
513cd89
removed unstable fast sync note in documentation (#1341)
NicolasMassart Apr 26, 2019
53c2c05
Cache current chain head info (#1335)
ajsutton Apr 26, 2019
560efab
Added net_services (#1306)
MadelineMurray Apr 27, 2019
bd79af8
Updated for returning false (#1309)
MadelineMurray Apr 27, 2019
95431a6
Added sending private transactions initial content (#1301)
MadelineMurray Apr 27, 2019
35018cd
Upated Docker image to indicate it doesn't run on Windows (#1346)
MadelineMurray Apr 28, 2019
eaf5692
[PAN-2573] include static nodes in permissioning logic (#1339)
macfarla Apr 28, 2019
2dc0c1a
Removed all option for host-whitelist (#1347)
MadelineMurray Apr 28, 2019
d89b2a4
Added content on using multinode example (#1345)
MadelineMurray Apr 28, 2019
e935536
Don't abort in-progress master builds when a new commit is added. (#1…
ajsutton Apr 29, 2019
c88fbe1
Updating Orion to 0.9.0 (#1359)
lucassaldanha Apr 29, 2019
6e383f9
Added txpool_pantheonStatistics (#1354)
MadelineMurray Apr 29, 2019
3cbe131
Removed privacy quickstart reference (#1361)
MadelineMurray Apr 29, 2019
b67c058
Updated overview (#1362)
MadelineMurray Apr 29, 2019
2b04d7f
Onchain permissioning (#1300)
MadelineMurray Apr 29, 2019
d923981
Update Private-Transaction-Processing.md (#1352)
jacobhackman Apr 29, 2019
0723e5b
Update Using-Configuration-File.md (#1351)
jacobhackman Apr 29, 2019
b1357a8
[PAN-2588] Create P2PNetwork Builder (#1343)
mbaxter Apr 29, 2019
f7f2a70
[PRIV-65] eea_getTransactionCount fails if account has not interacted…
iikirilov Apr 29, 2019
bfb760e
Added requirement to enable JSON-RPC (#1365)
MadelineMurray Apr 29, 2019
44561d8
Request open ended headers from sync target (#1355)
ajsutton Apr 29, 2019
527131b
Increase RocksDB max-background-compactions and background-thread-cou…
ajsutton Apr 29, 2019
0b159d3
Added 1.1 changes (#1356)
MadelineMurray Apr 29, 2019
9fe4e98
Update roadmap (#1371)
arash009 Apr 29, 2019
9975195
[PAN-1062] Specify pending transaction retention period (2 of 2) (#1333)
smatthewenglish Apr 30, 2019
c80ea8a
Handle the pipeline being aborted while finalizing an async operation…
ajsutton Apr 30, 2019
5e3d768
Enable the pipeline chain downloader by default (#1344)
ajsutton Apr 30, 2019
6c1426b
[MINOR] Rename rocksdDbConfiguration to rocksDbConfiguration (#1375)
smatthewenglish Apr 30, 2019
dd1f236
[PAN-2595] Consolidate local enode representation (#1376)
mbaxter May 1, 2019
de49103
Use execute instead of submit so unhandled exceptions get logged (#1379)
ajsutton May 1, 2019
b4dad69
[PAN-2585] Prefer EnodeURL over Endpoint (#1378)
mbaxter May 1, 2019
dbdd10e
[PAN-2605] Add getPeer method to PeerConnection (#1383)
mbaxter May 1, 2019
1795f76
Remove EthTaskChainDownloader and supporting code (#1373)
ajsutton May 1, 2019
6e0334b
Remove unnecessary field (#1384)
mbaxter May 1, 2019
5351ef3
Use streams and avoid iterating child nodes multiple times (#1380)
ajsutton May 1, 2019
52b20bd
Removing smart quotes (#1381)
jmcnevin May 2, 2019
5d15eb1
Update Log message in IBFT Controller (#1387)
rain-on May 2, 2019
b9384c3
Fixed typo (#1388)
MadelineMurray May 2, 2019
fbe2656
update python mkdocs requirements versions (#1374)
NicolasMassart May 2, 2019
45f618e
Handle case where peers advertise a listening port of 0 (#1391)
mbaxter May 2, 2019
00cca89
Add explanatory comment about default port (#1392)
mbaxter May 2, 2019
378f098
Added privacy roadmap (#1386)
MadelineMurray May 2, 2019
1361a6d
Queue pending requests when all peers are busy (#1331)
ajsutton May 2, 2019
6e6a7bb
Wait for next message to be sent in FullSyncChainDownloaderTest. (#1394)
ajsutton May 2, 2019
f792228
Update Create-Permissioned-Network.md (#1353)
jacobhackman May 3, 2019
cd868c9
Update Transactions.md (#1350)
jacobhackman May 3, 2019
b30ad2f
Update Bootnodes.md (#1349)
jacobhackman May 3, 2019
3eeef1a
fixes PIE-1499 remove hotjar tag as we can manage all tags with Googl…
NicolasMassart May 3, 2019
7105f70
Fix non-deterministic test caused by variable size of generated trans…
AbdelStark May 6, 2019
c40387f
[PAN-2586] Reference tests fail on Windows (#1401)
smatthewenglish May 6, 2019
f095f5f
[Minor] Start BlockPropagationManager immediately - don't wait for fu…
mbaxter May 6, 2019
4c9b1c0
Add flat file based task collection (#1377)
ajsutton May 7, 2019
1bbc685
Add constantinople fix block for Rinkeby (#1404)
ajsutton May 7, 2019
e15c5fc
Avoid recomputing the logs bloom filter when reading receipts from RL…
ajsutton May 7, 2019
66c6a81
added error message for RPC method disabled (#1396)
macfarla May 7, 2019
634f1db
PAN-2449: Remove NodePermissioningLocalConfig external references (#1…
lucassaldanha May 8, 2019
7f1b748
Fix clique miner to respect changes to vanity data made via JSON-RPC.…
ajsutton May 8, 2019
9c52391
Support including the transaction details in the pending transactions…
rojotek May 8, 2019
8c414f8
[PIE-1500] windows jdk smoke tests (#1413)
May 8, 2019
25242c5
Use port 0 when starting a websocket server in tests (#1416)
ajsutton May 8, 2019
12bd55f
Updated block size limit configuration (#1414)
MadelineMurray May 8, 2019
02b390d
Privacy quickstart (#1400)
MadelineMurray May 8, 2019
be53313
Added perm and privacy webinars (#1385)
MadelineMurray May 8, 2019
667e0d4
[Ethereal Hackathon] GraphQL EIP-1767 Implementation for Pantheon (#1…
zyfrank May 8, 2019
db79f69
PAN-2592: Rename methods that create and return streams away from get…
May 8, 2019
b3557d7
[PAN-2624] Start listening for p2p connections after start() is invok…
mbaxter May 8, 2019
c1a023a
Troubleshooting doc (#1405)
MadelineMurray May 8, 2019
bf01596
[PIE-1500] Get all our smoke tests for all platforms in 1 jenkins job…
May 8, 2019
b213e1c
Deleting unused windows jenkinsfile (#1421)
May 8, 2019
633a323
[PAN-2590] Improved JSON-RPC responses when EnodeURI parameter has in…
mark-terry May 9, 2019
ba63c29
BlockCreator does not delete transactions with invalid nonce
rain-on May 9, 2019
1d96899
Unwrap DelegatingBytes32 and prevent Hash from wrapping other Hash in…
ajsutton May 9, 2019
7bd413e
simple account permissioning (#1409)
macfarla May 9, 2019
0e5b38f
renamed AccountWhitelistController (#1424)
macfarla May 9, 2019
83dfa95
[PAN-2601] Refactorings and additions to add Account based Smart Cont…
mark-terry May 10, 2019
3b46571
Change AT discard RPC tests to check votes are discarded using propos…
jframe May 10, 2019
4af536c
[PAN-2601] Renamed AccountPermissioningProver to TransactionPermissio…
mark-terry May 10, 2019
9d1e4de
Fix p2p PeerInfo handling (#1428)
mbaxter May 10, 2019
329d50f
Ensure failed Txns are deleted when detected during mining (#1436)
rain-on May 12, 2019
fc7ff51
[PAN-2612] Transaction smart contract permissioning controller (#1433)
May 13, 2019
0a8b5c7
Capture all logs and errors in the Pantheon log output (#1437)
ajsutton May 13, 2019
505028f
IbftProcessor logs when a throwable terminates mining (#1427)
rain-on May 13, 2019
427272a
Allow config files to specify no bootnodes (#1438)
ajsutton May 13, 2019
8ee5f7f
Added Genesis file support for specifying the maximum stack size. (#1…
rojotek May 13, 2019
32b587e
Update EnodeURL to support enodes with listening disabled (#1403)
mbaxter May 13, 2019
bdbabc9
Equals cleanup (#1434)
May 13, 2019
a7a364e
Decode devp2p packets off the event thread (#1439)
ajsutton May 13, 2019
2e5833d
Reorganised API docs (#1441)
MadelineMurray May 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature/pie 1502 ewp options cli (PegaSysEng#1255)
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java

* fix PR 1246 discussion

PegaSysEng#1246 (comment)
AbdelStark authored and notlesh committed Apr 24, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2b9c371822fc7ebee6ba828ae6275329d0579027
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
import static java.util.Collections.singletonList;

import tech.pegasys.pantheon.ethereum.chain.Blockchain;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.p2p.wire.Capability;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive;
@@ -34,10 +35,7 @@ public Istanbul64ProtocolManager(
final int txWorkers,
final int computationWorkers,
final MetricsSystem metricsSystem,
final int maxGetBlockHeaders,
final int maxGetBlockBodies,
final int maxGetReceipts,
final int maxGetNodeData) {
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
super(
blockchain,
worldStateArchive,
@@ -47,10 +45,7 @@ public Istanbul64ProtocolManager(
txWorkers,
computationWorkers,
metricsSystem,
maxGetBlockHeaders,
maxGetBlockBodies,
maxGetReceipts,
maxGetNodeData);
ethereumWireProtocolConfiguration);
}

public Istanbul64ProtocolManager(
Original file line number Diff line number Diff line change
@@ -71,10 +71,7 @@ public EthProtocolManager(
final int networkId,
final boolean fastSyncEnabled,
final EthScheduler scheduler,
final int maxGetBlockHeaders,
final int maxGetBlockBodies,
final int maxGetReceipts,
final int maxGetNodeData) {
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
this.networkId = networkId;
this.scheduler = scheduler;
this.blockchain = blockchain;
@@ -90,14 +87,7 @@ public EthProtocolManager(
this.blockBroadcaster = new BlockBroadcaster(ethContext);

// Set up request handlers
new EthServer(
blockchain,
worldStateArchive,
ethMessages,
maxGetBlockHeaders,
maxGetBlockBodies,
maxGetReceipts,
maxGetNodeData);
new EthServer(blockchain, worldStateArchive, ethMessages, ethereumWireProtocolConfiguration);
}

public EthProtocolManager(
@@ -115,10 +105,7 @@ public EthProtocolManager(
networkId,
fastSyncEnabled,
new EthScheduler(syncWorkers, txWorkers, computationWorkers, metricsSystem),
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_BLOCK_HEADERS,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_BLOCK_BODIES,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_RECEIPTS,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_NODE_DATA);
EthereumWireProtocolConfiguration.defaultConfig());
}

public EthProtocolManager(
@@ -130,20 +117,14 @@ public EthProtocolManager(
final int txWorkers,
final int computationWorkers,
final MetricsSystem metricsSystem,
final int maxGetBlockHeaders,
final int maxGetBlockBodies,
final int maxGetReceipts,
final int maxGetNodeData) {
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
this(
blockchain,
worldStateArchive,
networkId,
fastSyncEnabled,
new EthScheduler(syncWorkers, txWorkers, computationWorkers, metricsSystem),
maxGetBlockHeaders,
maxGetBlockBodies,
maxGetReceipts,
maxGetNodeData);
ethereumWireProtocolConfiguration);
}

public EthContext ethContext() {
Original file line number Diff line number Diff line change
@@ -51,26 +51,17 @@ class EthServer {
private final Blockchain blockchain;
private final WorldStateArchive worldStateArchive;
private final EthMessages ethMessages;
private final int maxGetBlockHeaders;
private final int maxGetBlockBodies;
private final int maxGetReceipts;
private final int maxGetNodeData;
private final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration;

EthServer(
final Blockchain blockchain,
final WorldStateArchive worldStateArchive,
final EthMessages ethMessages,
final int maxGetBlockHeaders,
final int maxGetBlockBodies,
final int maxGetReceipts,
final int maxGetNodeData) {
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
this.blockchain = blockchain;
this.worldStateArchive = worldStateArchive;
this.ethMessages = ethMessages;
this.maxGetBlockHeaders = maxGetBlockHeaders;
this.maxGetBlockBodies = maxGetBlockBodies;
this.maxGetReceipts = maxGetReceipts;
this.maxGetNodeData = maxGetNodeData;
this.ethereumWireProtocolConfiguration = ethereumWireProtocolConfiguration;
this.setupListeners();
}

@@ -82,10 +73,7 @@ class EthServer {
blockchain,
worldStateArchive,
ethMessages,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_BLOCK_HEADERS,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_BLOCK_BODIES,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_RECEIPTS,
EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_NODE_DATA);
EthereumWireProtocolConfiguration.defaultConfig());
}

private void setupListeners() {
@@ -99,7 +87,10 @@ private void handleGetBlockHeaders(final EthMessage message) {
LOG.trace("Responding to GET_BLOCK_HEADERS request");
try {
final MessageData response =
constructGetHeadersResponse(blockchain, message.getData(), maxGetBlockHeaders);
constructGetHeadersResponse(
blockchain,
message.getData(),
ethereumWireProtocolConfiguration.getMaxGetBlockHeaders());
message.getPeer().send(response);
} catch (final RLPException e) {
message.getPeer().disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
@@ -112,7 +103,10 @@ private void handleGetBlockBodies(final EthMessage message) {
LOG.trace("Responding to GET_BLOCK_BODIES request");
try {
final MessageData response =
constructGetBodiesResponse(blockchain, message.getData(), maxGetBlockBodies);
constructGetBodiesResponse(
blockchain,
message.getData(),
ethereumWireProtocolConfiguration.getMaxGetBlockBodies());
message.getPeer().send(response);
} catch (final RLPException e) {
message.getPeer().disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
@@ -125,7 +119,8 @@ private void handleGetReceipts(final EthMessage message) {
LOG.trace("Responding to GET_RECEIPTS request");
try {
final MessageData response =
constructGetReceiptsResponse(blockchain, message.getData(), maxGetReceipts);
constructGetReceiptsResponse(
blockchain, message.getData(), ethereumWireProtocolConfiguration.getMaxGetReceipts());
message.getPeer().send(response);
} catch (final RLPException e) {
message.getPeer().disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
@@ -138,7 +133,10 @@ private void handleGetNodeData(final EthMessage message) {
LOG.trace("Responding to GET_NODE_DATA request");
try {
final MessageData response =
constructGetNodeDataResponse(worldStateArchive, message.getData(), maxGetNodeData);
constructGetNodeDataResponse(
worldStateArchive,
message.getData(),
ethereumWireProtocolConfiguration.getMaxGetNodeData());
message.getPeer().send(response);
} catch (final RLPException e) {
message.getPeer().disconnect(DisconnectReason.BREACH_OF_PROTOCOL);
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@

import static com.google.common.base.Preconditions.checkArgument;

import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.util.uint.UInt256;

import java.time.Duration;
@@ -66,9 +65,6 @@ public class SynchronizerConfiguration {
private final int maxTrailingPeers;
private final long worldStateMinMillisBeforeStalling;

// Ethereum Wire Procotol config
private final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration;

private SynchronizerConfiguration(
final int fastSyncPivotDistance,
final float fastSyncFullValidationRate,
@@ -89,8 +85,7 @@ private SynchronizerConfiguration(
final int downloaderParallelism,
final int transactionsParallelism,
final int computationParallelism,
final int maxTrailingPeers,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
final int maxTrailingPeers) {
this.fastSyncPivotDistance = fastSyncPivotDistance;
this.fastSyncFullValidationRate = fastSyncFullValidationRate;
this.fastSyncMinimumPeerCount = fastSyncMinimumPeerCount;
@@ -111,7 +106,6 @@ private SynchronizerConfiguration(
this.transactionsParallelism = transactionsParallelism;
this.computationParallelism = computationParallelism;
this.maxTrailingPeers = maxTrailingPeers;
this.ethereumWireProtocolConfiguration = ethereumWireProtocolConfiguration;
}

public static Builder builder() {
@@ -222,17 +216,11 @@ public int getMaxTrailingPeers() {
return maxTrailingPeers;
}

public EthereumWireProtocolConfiguration getEthereumWireProtocolConfiguration() {
return ethereumWireProtocolConfiguration;
}

public static class Builder {
private SyncMode syncMode = SyncMode.FULL;
private int fastSyncMinimumPeerCount = DEFAULT_FAST_SYNC_MINIMUM_PEERS;
private Duration fastSyncMaximumPeerWaitTime = DEFAULT_FAST_SYNC_MAXIMUM_PEER_WAIT_TIME;
private int maxTrailingPeers = Integer.MAX_VALUE;
private EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration =
EthereumWireProtocolConfiguration.defaultConfig();

@CommandLine.Option(
names = "--Xsynchronizer-block-propagation-range",
@@ -492,12 +480,6 @@ public Builder maxTrailingPeers(final int maxTailingPeers) {
return this;
}

public Builder ethereumWireProtocolConfiguration(
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
this.ethereumWireProtocolConfiguration = ethereumWireProtocolConfiguration;
return this;
}

public SynchronizerConfiguration build() {
return new SynchronizerConfiguration(
fastSyncPivotDistance,
@@ -519,8 +501,7 @@ public SynchronizerConfiguration build() {
downloaderParallelism,
transactionsParallelism,
computationParallelism,
maxTrailingPeers,
ethereumWireProtocolConfiguration);
maxTrailingPeers);
}
}
}
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import tech.pegasys.pantheon.ethereum.core.TransactionReceipt;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol.EthVersion;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.MockPeerConnection.PeerSendHandler;
import tech.pegasys.pantheon.ethereum.eth.manager.ethtaskutils.BlockchainSetupUtil;
import tech.pegasys.pantheon.ethereum.eth.messages.BlockBodiesMessage;
@@ -117,10 +118,7 @@ public void disconnectOnUnsolicitedMessage() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final MessageData messageData =
BlockHeadersMessage.create(Collections.singletonList(blockchain.getBlockHeader(1).get()));
final MockPeerConnection peer = setupPeer(ethManager, (cap, msg, conn) -> {});
@@ -141,10 +139,7 @@ public void disconnectOnFailureToSendStatusMessage() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final MessageData messageData =
BlockHeadersMessage.create(Collections.singletonList(blockchain.getBlockHeader(1).get()));
final MockPeerConnection peer =
@@ -166,10 +161,7 @@ public void disconnectOnWrongChainId() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final MessageData messageData =
BlockHeadersMessage.create(Collections.singletonList(blockchain.getBlockHeader(1).get()));
final MockPeerConnection peer =
@@ -202,10 +194,7 @@ public void disconnectOnWrongGenesisHash() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final MessageData messageData =
BlockHeadersMessage.create(Collections.singletonList(blockchain.getBlockHeader(1).get()));
final MockPeerConnection peer =
@@ -238,10 +227,7 @@ public void doNotDisconnectOnValidMessage() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final MessageData messageData =
GetBlockBodiesMessage.create(Collections.singletonList(gen.hash()));
final MockPeerConnection peer = setupPeer(ethManager, (cap, msg, conn) -> {});
@@ -266,10 +252,7 @@ public void respondToGetHeaders() throws ExecutionException, InterruptedExceptio
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long startBlock = 5L;
final int blockCount = 5;
final MessageData messageData =
@@ -310,10 +293,7 @@ public void respondToGetHeadersWithinLimits() throws ExecutionException, Interru
1,
1,
new NoOpMetricsSystem(),
limit,
limit,
limit,
limit)) {
new EthereumWireProtocolConfiguration(limit, limit, limit, limit))) {
final long startBlock = 5L;
final int blockCount = 10;
final MessageData messageData =
@@ -353,10 +333,7 @@ public void respondToGetHeadersReversed() throws ExecutionException, Interrupted
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long endBlock = 10L;
final int blockCount = 5;
final MessageData messageData = GetBlockHeadersMessage.create(endBlock, blockCount, 0, true);
@@ -395,10 +372,7 @@ public void respondToGetHeadersWithSkip() throws ExecutionException, Interrupted
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long startBlock = 5L;
final int blockCount = 5;
final int skip = 1;
@@ -440,10 +414,7 @@ public void respondToGetHeadersReversedWithSkip()
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long endBlock = 10L;
final int blockCount = 5;
final int skip = 1;
@@ -506,10 +477,7 @@ public void respondToGetHeadersPartial() throws ExecutionException, InterruptedE
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long startBlock = blockchain.getChainHeadBlockNumber() - 1L;
final int blockCount = 5;
final MessageData messageData =
@@ -549,10 +517,7 @@ public void respondToGetHeadersEmpty() throws ExecutionException, InterruptedExc
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long startBlock = blockchain.getChainHeadBlockNumber() + 1;
final int blockCount = 5;
final MessageData messageData =
@@ -589,10 +554,7 @@ public void respondToGetBodies() throws ExecutionException, InterruptedException
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
// Setup blocks query
final long startBlock = blockchain.getChainHeadBlockNumber() - 5;
final int blockCount = 2;
@@ -645,10 +607,7 @@ public void respondToGetBodiesWithinLimits() throws ExecutionException, Interrup
1,
1,
new NoOpMetricsSystem(),
limit,
limit,
limit,
limit)) {
new EthereumWireProtocolConfiguration(limit, limit, limit, limit))) {
// Setup blocks query
final int blockCount = 10;
final long startBlock = blockchain.getChainHeadBlockNumber() - blockCount;
@@ -700,10 +659,7 @@ public void respondToGetBodiesPartial() throws ExecutionException, InterruptedEx
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
// Setup blocks query
final long expectedBlockNumber = blockchain.getChainHeadBlockNumber() - 1;
final BlockHeader header = blockchain.getBlockHeader(expectedBlockNumber).get();
@@ -749,10 +705,7 @@ public void respondToGetReceipts() throws ExecutionException, InterruptedExcepti
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
// Setup blocks query
final long startBlock = blockchain.getChainHeadBlockNumber() - 5;
final int blockCount = 2;
@@ -804,10 +757,7 @@ public void respondToGetReceiptsWithinLimits() throws ExecutionException, Interr
1,
1,
new NoOpMetricsSystem(),
limit,
limit,
limit,
limit)) {
new EthereumWireProtocolConfiguration(limit, limit, limit, limit))) {
// Setup blocks query
final int blockCount = 10;
final long startBlock = blockchain.getChainHeadBlockNumber() - blockCount;
@@ -858,10 +808,7 @@ public void respondToGetReceiptsPartial() throws ExecutionException, Interrupted
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
// Setup blocks query
final long blockNumber = blockchain.getChainHeadBlockNumber() - 5;
final BlockHeader header = blockchain.getBlockHeader(blockNumber).get();
@@ -909,10 +856,7 @@ public void respondToGetNodeData() throws Exception {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
// Setup node data query

final List<BytesValue> expectedResults = new ArrayList<>();
@@ -963,10 +907,7 @@ public void newBlockMinedSendsNewBlockMessageToAllPeers() {
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200);
EthereumWireProtocolConfiguration.defaultConfig());

// Define handler to validate response
final PeerSendHandler onSend = mock(PeerSendHandler.class);
@@ -1038,10 +979,7 @@ public void shouldSuccessfullyRespondToGetHeadersRequestLessThanZero()
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {
final long startBlock = 1L;
final int requestedBlockCount = 13;
final int receivedBlockCount = 2;
@@ -1106,10 +1044,7 @@ public void transactionMessagesGoToTheCorrectExecutor() {
1,
true,
ethScheduler,
200,
200,
200,
200)) {
EthereumWireProtocolConfiguration.defaultConfig())) {

// Create a transaction pool. This has a side effect of registring a listener for the
// transactions message.
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
import tech.pegasys.pantheon.ethereum.chain.ChainHead;
import tech.pegasys.pantheon.ethereum.chain.GenesisState;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.DeterministicEthScheduler.TimeoutPolicy;
import tech.pegasys.pantheon.ethereum.mainnet.MainnetProtocolSchedule;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
@@ -44,7 +45,12 @@ public static EthProtocolManager create(
final EthScheduler ethScheduler) {
final int networkId = 1;
return new EthProtocolManager(
blockchain, worldStateArchive, networkId, false, ethScheduler, 200, 200, 200, 200);
blockchain,
worldStateArchive,
networkId,
false,
ethScheduler,
EthereumWireProtocolConfiguration.defaultConfig());
}

public static EthProtocolManager create(
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@

import tech.pegasys.pantheon.ethereum.chain.Blockchain;
import tech.pegasys.pantheon.ethereum.core.Hash;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.messages.GetNodeDataMessage;
import tech.pegasys.pantheon.ethereum.eth.messages.NodeDataMessage;
import tech.pegasys.pantheon.ethereum.worldstate.WorldStateArchive;
@@ -45,7 +46,11 @@ public class EthServerTest {

@Before
public void setUp() {
new EthServer(blockchain, worldStateArchive, ethMessages, 2, 2, 2, 2);
new EthServer(
blockchain,
worldStateArchive,
ethMessages,
new EthereumWireProtocolConfiguration(2, 2, 2, 2));
}

@Test
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.difficulty.fixed.FixedDifficultyProtocolSchedule;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthContext;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
@@ -115,10 +116,7 @@ public TestNode(
1,
1,
new NoOpMetricsSystem(),
200,
200,
200,
200);
EthereumWireProtocolConfiguration.defaultConfig());

final NetworkRunner networkRunner =
NetworkRunner.builder()
Original file line number Diff line number Diff line change
@@ -734,6 +734,7 @@ PantheonController<?> buildController() {
try {
return controllerBuilder
.synchronizerConfiguration(buildSyncConfig())
.ethereumWireProtocolConfiguration(ethereumWireConfigurationBuilder.build())
.rocksDbConfiguration(buildRocksDbConfiguration())
.homePath(dataDir())
.ethNetworkConfig(updateNetworkConfig(getNetwork()))
@@ -969,7 +970,6 @@ private SynchronizerConfiguration buildSyncConfig() {
.fastSyncMinimumPeerCount(fastSyncMinPeerCount)
.fastSyncMaximumPeerWaitTime(Duration.ofSeconds(fastSyncMaxWaitTime))
.maxTrailingPeers(TrailingPeerRequirements.calculateMaxTrailingPeers(maxPeers))
.ethereumWireProtocolConfiguration(ethereumWireConfigurationBuilder.build())
.build();
}

Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import tech.pegasys.pantheon.ethereum.core.MiningParameters;
import tech.pegasys.pantheon.ethereum.core.PendingTransactions;
import tech.pegasys.pantheon.ethereum.core.PrivacyParameters;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration;
import tech.pegasys.pantheon.ethereum.storage.StorageProvider;
import tech.pegasys.pantheon.ethereum.storage.keyvalue.RocksDbStorageProvider;
@@ -34,6 +35,7 @@
public class PantheonControllerBuilder {

private SynchronizerConfiguration synchronizerConfiguration;
private EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration;
private RocksDbConfiguration rocksDbConfiguration;
private Path homePath;
private EthNetworkConfig ethNetworkConfig;
@@ -50,6 +52,12 @@ public PantheonControllerBuilder synchronizerConfiguration(
return this;
}

public PantheonControllerBuilder ethereumWireProtocolConfiguration(
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration) {
this.ethereumWireProtocolConfiguration = ethereumWireProtocolConfiguration;
return this;
}

public PantheonControllerBuilder rocksDbConfiguration(
final RocksDbConfiguration rocksDbConfiguration) {
this.rocksDbConfiguration = rocksDbConfiguration;
@@ -116,6 +124,7 @@ public PantheonController<?> build() throws IOException {
return PantheonController.fromConfig(
genesisConfigFile,
synchronizerConfiguration,
ethereumWireProtocolConfiguration,
storageProvider,
ethNetworkConfig.getNetworkId(),
miningParameters,
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.core.Util;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.eth.sync.DefaultSynchronizer;
import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode;
@@ -109,6 +110,7 @@ static PantheonController<CliqueContext> init(
final StorageProvider storageProvider,
final GenesisConfigFile genesisConfig,
final SynchronizerConfiguration syncConfig,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration,
final MiningParameters miningParams,
final int networkId,
final KeyPair nodeKeys,
@@ -157,10 +159,7 @@ static PantheonController<CliqueContext> init(
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem,
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockHeaders(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockBodies(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetReceipts(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetNodeData());
ethereumWireProtocolConfiguration);
final SyncState syncState =
new SyncState(blockchain, ethProtocolManager.ethContext().getEthPeers());
final Synchronizer synchronizer =
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
import tech.pegasys.pantheon.ethereum.core.PrivacyParameters;
import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.eth.sync.DefaultSynchronizer;
import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode;
@@ -100,6 +101,7 @@ static PantheonController<IbftContext> init(
final StorageProvider storageProvider,
final GenesisConfigFile genesisConfig,
final SynchronizerConfiguration syncConfig,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration,
final int networkId,
final KeyPair nodeKeys,
final Path dataDirectory,
@@ -147,7 +149,8 @@ static PantheonController<IbftContext> init(
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem);
metricsSystem,
ethereumWireProtocolConfiguration);

final SyncState syncState =
new SyncState(blockchain, istanbul64ProtocolManager.ethContext().getEthPeers());
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.core.Util;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthContext;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.eth.sync.DefaultSynchronizer;
@@ -137,6 +138,7 @@ static PantheonController<IbftContext> init(
final StorageProvider storageProvider,
final GenesisConfigFile genesisConfig,
final SynchronizerConfiguration syncConfig,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration,
final MiningParameters miningParams,
final int networkId,
final KeyPair nodeKeys,
@@ -182,10 +184,7 @@ static PantheonController<IbftContext> init(
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem,
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockHeaders(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockBodies(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetReceipts(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetNodeData());
ethereumWireProtocolConfiguration);
final SubProtocol ethSubProtocol = EthProtocol.get();

final EthContext ethContext = ethProtocolManager.ethContext();
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.manager.EthContext;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.eth.peervalidation.DaoForkPeerValidator;
@@ -98,6 +99,7 @@ public static PantheonController<Void> init(
final GenesisConfigFile genesisConfig,
final ProtocolSchedule<Void> protocolSchedule,
final SynchronizerConfiguration syncConfig,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration,
final MiningParameters miningParams,
final int networkId,
final KeyPair nodeKeys,
@@ -124,10 +126,7 @@ public static PantheonController<Void> init(
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem,
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockHeaders(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockBodies(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetReceipts(),
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetNodeData());
ethereumWireProtocolConfiguration);
final SyncState syncState =
new SyncState(blockchain, ethProtocolManager.ethContext().getEthPeers());
final Synchronizer synchronizer =
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
import tech.pegasys.pantheon.ethereum.core.PrivacyParameters;
import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration;
import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApi;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.JsonRpcMethod;
@@ -45,6 +46,7 @@ public interface PantheonController<C> extends Closeable {
static PantheonController<?> fromConfig(
final GenesisConfigFile genesisConfigFile,
final SynchronizerConfiguration syncConfig,
final EthereumWireProtocolConfiguration ethereumWireProtocolConfiguration,
final StorageProvider storageProvider,
final int networkId,
final MiningParameters miningParameters,
@@ -63,6 +65,7 @@ static PantheonController<?> fromConfig(
genesisConfigFile,
MainnetProtocolSchedule.fromConfig(configOptions, privacyParameters),
syncConfig,
ethereumWireProtocolConfiguration,
miningParameters,
networkId,
nodeKeys,
@@ -76,6 +79,7 @@ static PantheonController<?> fromConfig(
storageProvider,
genesisConfigFile,
syncConfig,
ethereumWireProtocolConfiguration,
miningParameters,
networkId,
nodeKeys,
@@ -89,6 +93,7 @@ static PantheonController<?> fromConfig(
storageProvider,
genesisConfigFile,
syncConfig,
ethereumWireProtocolConfiguration,
networkId,
nodeKeys,
dataDirectory,
@@ -101,6 +106,7 @@ static PantheonController<?> fromConfig(
storageProvider,
genesisConfigFile,
syncConfig,
ethereumWireProtocolConfiguration,
miningParameters,
networkId,
nodeKeys,
6 changes: 2 additions & 4 deletions pantheon/src/test/java/tech/pegasys/pantheon/PrivacyTest.java
Original file line number Diff line number Diff line change
@@ -55,10 +55,8 @@ public void privacyPrecompiled() throws IOException {
(MainnetPantheonController)
PantheonController.fromConfig(
GenesisConfigFile.mainnet(),
SynchronizerConfiguration.builder()
.ethereumWireProtocolConfiguration(
EthereumWireProtocolConfiguration.builder().build())
.build(),
SynchronizerConfiguration.builder().build(),
EthereumWireProtocolConfiguration.defaultConfig(),
new InMemoryStorageProvider(),
1,
new MiningParametersTestBuilder().enabled(false).build(),
8 changes: 4 additions & 4 deletions pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java
Original file line number Diff line number Diff line change
@@ -97,10 +97,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
final int blockCount = 500;
final KeyPair aheadDbNodeKeys = loadKeyPair(dbAhead);
final SynchronizerConfiguration syncConfigAhead =
SynchronizerConfiguration.builder()
.syncMode(SyncMode.FULL)
.ethereumWireProtocolConfiguration(EthereumWireProtocolConfiguration.builder().build())
.build();
SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build();
final MetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
final int networkId = 2929;

@@ -111,6 +108,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
GenesisConfigFile.mainnet(),
MainnetProtocolSchedule.create(),
syncConfigAhead,
EthereumWireProtocolConfiguration.defaultConfig(),
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys,
@@ -129,6 +127,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
GenesisConfigFile.mainnet(),
MainnetProtocolSchedule.create(),
syncConfigAhead,
EthereumWireProtocolConfiguration.defaultConfig(),
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys,
@@ -185,6 +184,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
GenesisConfigFile.mainnet(),
MainnetProtocolSchedule.create(),
syncConfigBehind,
EthereumWireProtocolConfiguration.defaultConfig(),
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
KeyPair.generate(),
Original file line number Diff line number Diff line change
@@ -105,6 +105,8 @@ public void initMocks() throws Exception {
// doReturn used because of generic PantheonController
Mockito.doReturn(mockController).when(mockControllerBuilder).build();
when(mockControllerBuilder.synchronizerConfiguration(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.ethereumWireProtocolConfiguration(any()))
.thenReturn(mockControllerBuilder);
when(mockControllerBuilder.rocksDbConfiguration(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.homePath(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.ethNetworkConfig(any())).thenReturn(mockControllerBuilder);
@@ -120,8 +122,6 @@ public void initMocks() throws Exception {
when(mockSyncConfBuilder.fastSyncMinimumPeerCount(anyInt())).thenReturn(mockSyncConfBuilder);
when(mockSyncConfBuilder.fastSyncMaximumPeerWaitTime(any(Duration.class)))
.thenReturn(mockSyncConfBuilder);
when(mockSyncConfBuilder.ethereumWireProtocolConfiguration(any()))
.thenReturn(mockSyncConfBuilder);
when(mockSyncConfBuilder.build()).thenReturn(mockSyncConf);

when(mockEthereumWireProtocolConfigurationBuilder.build())
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
import tech.pegasys.pantheon.ethereum.core.MiningParametersTestBuilder;
import tech.pegasys.pantheon.ethereum.core.PendingTransactions;
import tech.pegasys.pantheon.ethereum.core.PrivacyParameters;
import tech.pegasys.pantheon.ethereum.eth.EthereumWireProtocolConfiguration;
import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration;
import tech.pegasys.pantheon.metrics.noop.NoOpMetricsSystem;
import tech.pegasys.pantheon.testutil.BlockTestUtil;
@@ -54,6 +55,7 @@ public void blockImport() throws IOException {
PantheonController.fromConfig(
GenesisConfigFile.mainnet(),
SynchronizerConfiguration.builder().build(),
EthereumWireProtocolConfiguration.defaultConfig(),
new InMemoryStorageProvider(),
1,
new MiningParametersTestBuilder().enabled(false).build(),
@@ -91,6 +93,7 @@ public void ibftImport() throws IOException {
PantheonController.fromConfig(
GenesisConfigFile.fromConfig(config),
SynchronizerConfiguration.builder().build(),
EthereumWireProtocolConfiguration.defaultConfig(),
new InMemoryStorageProvider(),
10,
new MiningParametersTestBuilder().enabled(false).build(),