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

eth66 #2365

Merged
merged 84 commits into from
Aug 25, 2021
Merged

eth66 #2365

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
07f882b
refactor response constructor and sending
RatanRSur Jul 1, 2021
db59e70
nullable fix
RatanRSur Jul 1, 2021
a021144
restore original name
RatanRSur Jul 1, 2021
1725d62
remove early return
RatanRSur Jul 1, 2021
5db16eb
add eth66 version code and cleanup
RatanRSur May 12, 2021
97d46c6
dry
RatanRSur May 12, 2021
3d9ed89
move method
RatanRSur May 12, 2021
3717fbd
add requestId tracking
RatanRSur May 13, 2021
89b0cad
make RequestManager test work
RatanRSur May 14, 2021
8b6cb8d
tests successfully fail
RatanRSur May 17, 2021
dfd8557
write rlp raw instead of as opaque bytes
RatanRSur May 17, 2021
bd09170
use unwrapping from production code
RatanRSur May 17, 2021
a46dc83
wip: json parsing stuff
RatanRSur May 17, 2021
9af245e
todo
RatanRSur May 20, 2021
a815aa3
change json parsers to factory methods
RatanRSur May 20, 2021
edd3c6b
random json stuff
RatanRSur May 24, 2021
3babbc1
get transaction parsing working
RatanRSur May 25, 2021
712540e
fix block header
RatanRSur May 25, 2021
90cae83
some more tests
RatanRSur Jun 2, 2021
fd1813a
Receipts
RatanRSur Jun 2, 2021
f202eae
finish unit tests
RatanRSur Jun 2, 2021
7f4e117
disconnect if they send us a bad requestId
RatanRSur Jun 2, 2021
d5a4b9e
cleanup
RatanRSur Jun 2, 2021
5cb5ad5
remove unused method
RatanRSur Jun 2, 2021
e57300a
add test
RatanRSur Jun 2, 2021
2eb03be
spotless
RatanRSur Jun 2, 2021
c8f018a
remove unused var
RatanRSur Jun 2, 2021
22c9a42
clean up constructor
RatanRSur Jun 9, 2021
b09ec51
update optionals
RatanRSur Jun 23, 2021
ee9439b
spotless
RatanRSur Jun 23, 2021
c3c89a0
refactor response constructor and sending
RatanRSur Jul 1, 2021
bbb3217
wip
RatanRSur Jul 1, 2021
81a9fa7
Merge branch 'refcator-response-constructor' into eth66
RatanRSur Jul 1, 2021
c426304
remove logger
RatanRSur Jul 1, 2021
ee1d36a
Merge branch 'refcator-response-constructor' into eth66
RatanRSur Jul 1, 2021
1a17ed6
fix merge problem
RatanRSur Jul 1, 2021
72733dc
wip: thread all the production code
RatanRSur Jul 2, 2021
864002f
Merge branch 'master' of github.com:hyperledger/besu into eth66
RatanRSur Jul 7, 2021
d617943
add final
RatanRSur Jul 7, 2021
e6d030f
Merge branch 'master' of github.com:hyperledger/besu into eth66
RatanRSur Jul 8, 2021
32a1f8a
wip: mainly test stuff
RatanRSur Jul 8, 2021
3f908da
Merge branch 'master' of github.com:hyperledger/besu into eth66
RatanRSur Jul 9, 2021
6c879e6
request manager cleanup
RatanRSur Jul 11, 2021
5723c2d
wip
RatanRSur Jul 12, 2021
185cc68
Merge branch 'master' of github.com:hyperledger/besu into eth66
RatanRSur Jul 12, 2021
d656bc9
todo
RatanRSur Jul 12, 2021
24b1e76
check if the message needs a requestId
RatanRSur Jul 12, 2021
7f56578
extract vars
RatanRSur Jul 12, 2021
c62626b
remove import
RatanRSur Jul 12, 2021
48d004a
fix comment
RatanRSur Jul 12, 2021
a58e233
impove asserts
RatanRSur Jul 13, 2021
b66b9fa
Merge branch 'master' of github.com:hyperledger/besu into eth66
RatanRSur Jul 20, 2021
d51fe57
master logging
RatanRSur Jul 29, 2021
6472d45
Merge branch 'master' into eth66
RatanRSur Jul 29, 2021
a2fa4c8
tracing
RatanRSur Aug 11, 2021
b0767a3
fix exit
RatanRSur Aug 11, 2021
56d8f2c
add params to handle message log
RatanRSur Aug 11, 2021
a4b992c
add stacktrace for close
RatanRSur Aug 11, 2021
092d54e
add back collection copy
RatanRSur Aug 11, 2021
3baf873
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 11, 2021
7431eef
remove logging
RatanRSur Aug 11, 2021
fda160f
fix tests
RatanRSur Aug 11, 2021
220068f
spotless
RatanRSur Aug 11, 2021
f38add2
spdx header
RatanRSur Aug 11, 2021
5c28e93
use big integer
RatanRSur Aug 11, 2021
1eee08b
spotless
RatanRSur Aug 11, 2021
98f9c31
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 16, 2021
332778a
robust to future protocols
RatanRSur Aug 16, 2021
0b26535
streamline codespace
RatanRSur Aug 19, 2021
ce32e90
make big integer scalar encoding consistent with long scalar
RatanRSur Aug 19, 2021
abaffc4
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 19, 2021
45cad8c
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 23, 2021
54e86f8
rename
RatanRSur Aug 23, 2021
261da8f
handle malformed rlp exception
RatanRSur Aug 23, 2021
c3e67db
spotless
RatanRSur Aug 23, 2021
faca857
ethPeer
RatanRSur Aug 23, 2021
36d61b8
minimize try/catch block scope
RatanRSur Aug 23, 2021
9841b70
remove unused logger
RatanRSur Aug 24, 2021
c15c5b7
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 24, 2021
f181530
spotless
RatanRSur Aug 24, 2021
3922a9d
Merge branch 'main' into eth66
garyschulte Aug 25, 2021
d0d6c73
changelog
RatanRSur Aug 25, 2021
a013b8c
Merge branch 'main' of github.com:hyperledger/besu into eth66
RatanRSur Aug 25, 2021
731ad55
Merge branch 'eth66' of github.com:RatanRSur/besu into eth66
RatanRSur Aug 25, 2021
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
robust to future protocols
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
  • Loading branch information
RatanRSur committed Aug 16, 2021
commit 332778a44227b67446a3b1855888142066e7e3b8
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ public EthPeer(
peerValidators.forEach(peerValidator -> validationStatus.put(peerValidator, false));
fullyValidated.set(peerValidators.isEmpty());

// todo : make this robust to future protocols
final boolean supportsRequestId = getAgreedCapabilities().contains(EthProtocol.ETH66);
final boolean supportsRequestId =
getAgreedCapabilities().stream()
.anyMatch(capability -> capability.compareTo(EthProtocol.ETH66) >= 0);
this.headersRequestManager = new RequestManager(this, supportsRequestId);
this.bodiesRequestManager = new RequestManager(this, supportsRequestId);
this.receiptsRequestManager = new RequestManager(this, supportsRequestId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
import java.nio.charset.StandardCharsets;
import java.util.Objects;

import org.jetbrains.annotations.NotNull;

/**
* Represents a client capability.
*
* @see <a href= "https://github.com/ethereum/devp2p/blob/master/devp2p.md">Capability wire
* format</a>
*/
public class Capability {
public class Capability implements Comparable<Capability> {
private final String name;
private final int version;

Expand Down Expand Up @@ -85,4 +87,9 @@ public int hashCode() {
public String toString() {
return name + "/" + version;
}

@Override
public int compareTo(@NotNull final Capability that) {
return Integer.compare(this.getVersion(), that.getVersion());
}
}