-
Notifications
You must be signed in to change notification settings - Fork 829
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 eth/68 (EIP-5793) #4730
Implement eth/68 (EIP-5793) #4730
Conversation
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…nsactionHashesMessage Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…actionHashesMessage Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ncoding Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ctionAnnouncement Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ooledTransactionHashesMessage accept capability instead of boolean Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
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.
overall the implementation is good, please read the inline comments for questions, optimizations and suggestions to improve the handling of malformed messages.
Then there is another part of this implementation that should cover our new strategy on how we broadcast transactions taking in account the new type
and size
parameters, it is fine to do it in another PR to keep them small, have you already planned to do it?
.../main/java/org/hyperledger/besu/ethereum/eth/messages/NewPooledTransactionHashesMessage.java
Show resolved
Hide resolved
...th/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionAnnouncement.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/hyperledger/besu/ethereum/eth/encoding/TransactionAnnouncementDecoder.java
Show resolved
Hide resolved
...src/main/java/org/hyperledger/besu/ethereum/eth/encoding/TransactionAnnouncementDecoder.java
Outdated
Show resolved
Hide resolved
this.type = Optional.ofNullable(type); | ||
this.size = Optional.ofNullable(size); |
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.
Why allowing nulls here?
type
and size
should never be null at this point, otherwise it means there message was malformed, and its processing should have stopped before.
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.
Hum, if the transaction is announced by a protocol version older than Eth/68, only the hash is announced
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.
if the transaction is announced by a protocol < Eth/68 then the constructor public TransactionAnnouncement(final Hash hash)
is used if I am not wrong
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 understood your point now. I changed the constructors to not accept null
and throw instead. Also added a unit test for that. Thanks again!
...src/main/java/org/hyperledger/besu/ethereum/eth/encoding/TransactionAnnouncementEncoder.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/hyperledger/besu/ethereum/eth/encoding/TransactionAnnouncementEncoder.java
Show resolved
Hide resolved
...reum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java
Show resolved
Hide resolved
...perledger/besu/ethereum/eth/transactions/NewPooledTransactionHashesMessageProcessorTest.java
Show resolved
Hide resolved
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
@fab-10 Thanks for the review.
Yeah, that makes sense. This PR only implements the protocol specs, implementing the ability to send and receive NewPooledTransactionHashes with their sizes and types when using eth68 ensuring that we are compatible with older protocol versions. What the client should do with the type and size and how it impacts broadcast transaction strategy are not part of the scope. I believe it would be better to handle it in a separate PR. |
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ntinalia/besu into 4715-implement-eth68
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
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.
LGTM, just a comment on the nullable arguments
this.type = Optional.ofNullable(type); | ||
this.size = Optional.ofNullable(size); |
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.
if the transaction is announced by a protocol < Eth/68 then the constructor public TransactionAnnouncement(final Hash hash)
is used if I am not wrong
...reum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java
Show resolved
Hide resolved
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ntinalia/besu into 4715-implement-eth68
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.
LGTM just need to move the changelog entry
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
…ntinalia/besu into 4715-implement-eth68
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
PR description
Implement eth/68
Modify the NewPooledTransactionHashes (0x08) message:
(eth/67): [hash_0: B_32, hash_1: B_32, ...]
(eth/68): [[type_0: B_1, type_1: B_1, ...], [size_0: B_4, size_1: B_4, ...], [hash_0: B_32, hash_1: B_32, ...]]
Fixed Issue(s)
fixes #4715
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog