Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

remove support for GoQuorum private transactions via Besu #500

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Bugs Fixed
- Update of Azure libraries (transitive via signers library) and manual override to fix CVE-2023-1370

### Breaking Changes
- remove support for GoQuorum private transactions via Besu [#500](https://github.com/ConsenSys/ethsigner/pull/500)

---

## 23.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
import tech.pegasys.ethsigner.core.jsonrpc.exception.JsonRpcException;
import tech.pegasys.ethsigner.core.requesthandler.JsonRpcRequestHandler;
import tech.pegasys.ethsigner.core.requesthandler.VertxRequestTransmitterFactory;
import tech.pegasys.ethsigner.core.requesthandler.sendtransaction.transaction.GoQuorumPrivateTransaction;
import tech.pegasys.ethsigner.core.requesthandler.sendtransaction.transaction.Transaction;
import tech.pegasys.ethsigner.core.requesthandler.sendtransaction.transaction.TransactionFactory;
import tech.pegasys.ethsigner.core.signing.GoQuorumPrivateTransactionSerializer;
import tech.pegasys.ethsigner.core.signing.TransactionSerializer;
import tech.pegasys.signers.secp256k1.api.Signer;

Expand Down Expand Up @@ -97,10 +95,7 @@ private void sendTransaction(
final Signer signer,
final JsonRpcRequest request) {

final TransactionSerializer transactionSerializer =
transaction instanceof GoQuorumPrivateTransaction
? new GoQuorumPrivateTransactionSerializer(signer, chainId)
: new TransactionSerializer(signer, chainId);
final TransactionSerializer transactionSerializer = new TransactionSerializer(signer, chainId);

final TransactionTransmitter transmitter =
createTransactionTransmitter(transaction, transactionSerializer, routingContext, request);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@

import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.RoutingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class TransactionFactory {

private static final Logger LOG = LogManager.getLogger();

private final VertxRequestTransmitterFactory transmitterFactory;
private final JsonDecoder decoder;

Expand All @@ -43,13 +39,10 @@ public Transaction createTransaction(final RoutingContext context, final JsonRpc
final String method = request.getMethod().toLowerCase();
final VertxNonceRequestTransmitter nonceRequestTransmitter =
new VertxNonceRequestTransmitter(context.request().headers(), decoder, transmitterFactory);
final VertxStoreRawRequestTransmitter storeRawRequestTransmitter =
new VertxStoreRawRequestTransmitter(
context.request().headers(), decoder, transmitterFactory);

switch (method) {
case "eth_sendtransaction":
return createEthTransaction(request, nonceRequestTransmitter, storeRawRequestTransmitter);
return createEthTransaction(request, nonceRequestTransmitter);
case "eea_sendtransaction":
return createEeaTransaction(request, nonceRequestTransmitter);
default:
Expand All @@ -58,20 +51,16 @@ public Transaction createTransaction(final RoutingContext context, final JsonRpc
}

private Transaction createEthTransaction(
final JsonRpcRequest request,
final VertxNonceRequestTransmitter nonceRequestTransmitter,
final VertxStoreRawRequestTransmitter storeRawRequestTransmitter) {
final JsonRpcRequest request, final VertxNonceRequestTransmitter nonceRequestTransmitter) {
final EthSendTransactionJsonParameters params =
fromRpcRequestToJsonParam(EthSendTransactionJsonParameters.class, request);

final NonceProvider ethNonceProvider =
new EthNonceProvider(params.sender(), nonceRequestTransmitter);
final StoreRawEnclaveLookupIdProvider lookupIdProvider =
new StoreRawEnclaveLookupIdProvider(storeRawRequestTransmitter);

if (params.privateFor().isPresent()) {
return GoQuorumPrivateTransaction.from(
params, ethNonceProvider, lookupIdProvider, request.getId());
throw new IllegalArgumentException(
"GoQuorum private transactions (using PrivateFor) are not supported.");
} else {
return new EthTransaction(params, ethNonceProvider, request.getId());
}
Expand All @@ -83,14 +72,6 @@ private Transaction createEeaTransaction(
final EeaSendTransactionJsonParameters params =
fromRpcRequestToJsonParam(EeaSendTransactionJsonParameters.class, request);

if (params.privacyGroupId().isPresent() == params.privateFor().isPresent()) {
LOG.warn(
"Illegal private transaction received; privacyGroup (present = {}) and privateFor (present = {}) are mutually exclusive.",
params.privacyGroupId().isPresent(),
params.privateFor().isPresent());
throw new IllegalArgumentException("PrivacyGroup and PrivateFor are mutually exclusive.");
}

if (params.privacyGroupId().isPresent()) {
final NonceProvider nonceProvider =
new BesuPrivateNonceProvider(
Expand Down
Loading