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

WIP - Eip1559 support for private txs #838

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

siladu
Copy link
Contributor

@siladu siladu commented Jul 11, 2023

PR Description

WIP - waiting for web3j fix

Built on #836

Diff:
gfukushima/web3signer@siladu:web3signer:eip1559...siladu:eip1559-private-txs

TODO:
https://github.com/Consensys/web3signer/pull/838/files#diff-ae3cde7ae9568a69c100a1b73f9c829fbc66fac4cedb1e5af0c46bae10f7bf98R100

Blocked on a bug in web3j:
https://github.com/web3j/web3j/blob/2ad9a8b4b9411de13c6d09e8392a51213d8160f0/eea/s[…]va/org/web3j/protocol/eea/crypto/PrivateTransactionDecoder.java
Although the delegation to TransactionDecoder.decode() covers the 1559 decoding routine, the RlpDecoder.decode() method higher up relies on the all important stripping of the first byte happening before it is called...
final byte[] encodedTx = Arrays.copyOfRange(transaction, 1, transaction.length);

Tasks

  • Add additional fields to EthSendTransactionJsonParameters for maxFeePerGas and maxPriorityFeePerGas
  • Update EeaPrivateTransaction and BesuPrivateTransaction to create 1559 transactions and be used in the encoding
  • Update web3j PrivateTransactionDecoder to work for 1559
  • Integration/Acceptance tests:
    • eea_sendTransaction
      • EeaPrivateTransactionTest
      • 1559 version of SigningEeaSendTransactionIntegrationTest.signSendTransaction for EeaPrivateTransaction
      • 1559 version of SigningEeaSendTransactionIntegrationTest.signSendTransactionWithPrivacyGroupId for BesuPrivateTransaction

Fixed Issue(s)

#839

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Testing

  • I thought about testing these changes in a realistic/non-local environment.

gfukushima and others added 25 commits June 27, 2023 10:44
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
# Conflicts:
#	CHANGELOG.md
#	acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/signer/SignerConfigurationBuilder.java
#	core/src/integrationTest/java/tech/pegasys/web3signer/core/jsonrpcproxy/IntegrationTestBase.java
#	core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/EthSendTransactionJsonParameters.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/internalresponse/EthSignTransactionResultProvider.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/sendtransaction/NonceProvider.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/sendtransaction/transaction/EthTransaction.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/sendtransaction/transaction/Transaction.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/signing/ChainIdProvider.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/signing/ConfigurationChainId.java
#	core/src/main/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/signing/TransactionSerializer.java
#	core/src/test/java/tech/pegasys/web3signer/core/service/jsonrpc/EthSignTransactionResultProviderTest.java
#	core/src/test/java/tech/pegasys/web3signer/core/service/jsonrpc/handlers/transaction/EthTransactionTest.java
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Wire in chainId to EthTransaction and PrivateTransaction variants.
Create eip1559 variant of RawTransaction and RawPrivateTransaction but don't do anything with it yet.
Remove rlpEncode(final long chainId) method override

This is to make the upcoming changes to the serialize method easier
@siladu siladu changed the title Eip1559 private txs Eip1559 support for private txs Jul 11, 2023
@siladu siladu force-pushed the eip1559-private-txs branch from 7258533 to fe21f28 Compare July 11, 2023 01:47
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

class DownstreamPathCalculatorTest {

Check notice

Code scanning / CodeQL

Unused classes and interfaces

Unused class: DownstreamPathCalculatorTest is not referenced within this codebase. If not used as an external API it should be removed.
@siladu siladu changed the title Eip1559 support for private txs WIP - Eip1559 support for private txs Jul 13, 2023
@NickSneo
Copy link

PR for Web3j private 1559 transaction - hyperledger-web3j/web3j#1980

@jframe jframe mentioned this pull request Nov 29, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants