Disable json-rpc trace API's (#40)

Signed-off-by: Meredith Baxter <meredith.baxter@consensys.net>
pull/43/head
mbaxter 5 years ago committed by GitHub
parent 72941508c3
commit a16df352d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcMethodsFactory.java
  2. 8
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcApis.java

@ -74,7 +74,6 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.NetPeerCount;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.NetServices; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.NetServices;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.NetVersion; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.NetVersion;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.RpcModules; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.RpcModules;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.TraceReplayBlockTransactions;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.TxPoolBesuStatistics; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.TxPoolBesuStatistics;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.TxPoolBesuTransactions; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.TxPoolBesuTransactions;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.Web3ClientVersion; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.Web3ClientVersion;
@ -338,19 +337,20 @@ public class JsonRpcMethodsFactory {
new AdminChangeLogLevel(parameter)); new AdminChangeLogLevel(parameter));
} }
if (rpcApis.contains(RpcApis.TRACE)) { // Disable TRACE functionality while under development
addMethods( // if (rpcApis.contains(RpcApis.TRACE)) {
enabledMethods, // addMethods(
new TraceReplayBlockTransactions( // enabledMethods,
parameter, // new TraceReplayBlockTransactions(
new BlockTracer( // parameter,
new BlockReplay( // new BlockTracer(
protocolSchedule, // new BlockReplay(
blockchainQueries.getBlockchain(), // protocolSchedule,
blockchainQueries.getWorldStateArchive())), // blockchainQueries.getBlockchain(),
blockchainQueries, // blockchainQueries.getWorldStateArchive())),
protocolSchedule)); // blockchainQueries,
} // protocolSchedule));
// }
final boolean eea = rpcApis.contains(RpcApis.EEA); final boolean eea = rpcApis.contains(RpcApis.EEA);
final boolean priv = rpcApis.contains(RpcApis.PRIV); final boolean priv = rpcApis.contains(RpcApis.PRIV);

@ -30,7 +30,8 @@ public class RpcApis {
public static final RpcApi EEA = new RpcApi("EEA"); public static final RpcApi EEA = new RpcApi("EEA");
public static final RpcApi PRIV = new RpcApi("PRIV"); public static final RpcApi PRIV = new RpcApi("PRIV");
public static final RpcApi TX_POOL = new RpcApi("TXPOOL"); public static final RpcApi TX_POOL = new RpcApi("TXPOOL");
public static final RpcApi TRACE = new RpcApi("TRACE"); // Disable TRACE functionality while under development
// public static final RpcApi TRACE = new RpcApi("TRACE");
public static final List<RpcApi> DEFAULT_JSON_RPC_APIS = Arrays.asList(ETH, NET, WEB3); public static final List<RpcApi> DEFAULT_JSON_RPC_APIS = Arrays.asList(ETH, NET, WEB3);
@ -55,8 +56,9 @@ public class RpcApis {
return Optional.of(PRIV); return Optional.of(PRIV);
} else if (name.equals(TX_POOL.getCliValue())) { } else if (name.equals(TX_POOL.getCliValue())) {
return Optional.of(TX_POOL); return Optional.of(TX_POOL);
} else if (name.equals(TRACE.getCliValue())) { // Disable TRACE functionality while under development
return Optional.of(TRACE); // } else if (name.equals(TRACE.getCliValue())) {
// return Optional.of(TRACE);
} else { } else {
return Optional.empty(); return Optional.empty();
} }

Loading…
Cancel
Save