-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding support for EIP1559 Private Transactions #1980
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
Conversation
Signed-off-by: Nischal Sharma <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1980 +/- ##
============================================
+ Coverage 68.45% 68.69% +0.24%
- Complexity 3005 3041 +36
============================================
Files 488 490 +2
Lines 12568 12715 +147
Branches 1643 1653 +10
============================================
+ Hits 8603 8735 +132
- Misses 3485 3497 +12
- Partials 480 483 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Nischal Sharma <[email protected]>
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.
Some questions around the approach, let's discuss.
eea/src/main/java/org/web3j/protocol/eea/crypto/PrivateTransactionDecoder.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Nischal Sharma <[email protected]>
} | ||
|
||
private static byte[] longToBytes(long x) { | ||
ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); | ||
buffer.putLong(x); | ||
return buffer.array(); | ||
} | ||
|
||
public static List<RlpType> asRlpValues( |
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.
Any issue with this being removed for backwards compatibility?
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.
So every Tx type has its own different asRlpValues(), so it is being transferred from here.
import org.web3j.utils.Numeric; | ||
import org.web3j.utils.Restriction; | ||
|
||
public class PrivateTransaction1559 extends RawPrivateTransaction implements ITransaction { |
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.
Is it not a bit odd that RawTransaction does not implement ITransaction, if PrivateTransaction1559 does? It seems like a bit of a broken pattern?
Genuine question: Why should PrivateTransaction1559 implement the interface is RawTransaction does not?
@@ -24,7 +24,7 @@ | |||
import org.web3j.abi.datatypes.generated.Bytes32; | |||
import org.web3j.crypto.Credentials; | |||
import org.web3j.protocol.eea.crypto.PrivateTransactionEncoder; | |||
import org.web3j.protocol.eea.crypto.RawPrivateTransaction; | |||
import org.web3j.protocol.eea.crypto.transaction.type.RawPrivateTransaction; |
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.
As we talked about, I guess this package change will break backwards compatibility?
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.
Yeah we can change the class path to original so that it doesn't break anything
…ctionType Signed-off-by: Nischal Sharma <[email protected]>
Signed-off-by: Nischal Sharma <[email protected]>
Hi @NickSneo, Thanks for adding this functionality to web3j, these are the changes we needed for web3signer |
What does this PR do?
refactored private txs logic, to include more type of private txs
Adds support for EIP1559 private tx
Where should the reviewer start?
Review all files
Why is it needed?
#1966