Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
91127c2
fix(build): skip errorprone publishing on JDK 8
halibobo1205 Aug 7, 2026
a23f217
Merge pull request #6924 from halibobo1205/fix/errorprone-publish-jdk8
lvs0075 Aug 31, 2026
d0d0425
refactor(http): add cursor filters on solidity and pbft http ports
Little-Peony Aug 3, 2026
2efd3a1
refactor(http): serve solidity http endpoints with base servlets
Little-Peony Aug 4, 2026
a09c395
refactor(http): serve pbft http endpoints with base servlets
Little-Peony Aug 4, 2026
c877ea8
refactor(http): serve soliditynode tx endpoints with base servlets
Little-Peony Aug 4, 2026
3ec4eb5
refactor(http): flatten solidity and pbft http service packages
Little-Peony Aug 4, 2026
e7b1ac4
refactor(http): group servlets into subpackage and flatten services
Little-Peony Aug 4, 2026
b3f7b43
refactor(http): drive pbft http endpoints from the api registry
Little-Peony Aug 5, 2026
ecf0ea8
refactor(http): drive solidity http endpoints from the api registry
Little-Peony Aug 5, 2026
4e0c5b0
refactor(http): drive soliditynode http endpoints from the api registry
Little-Peony Aug 5, 2026
5005c7b
fix(http): drop shielded trx endpoints missed on the pbft port
Little-Peony Aug 5, 2026
fecf2fe
refactor(http): add full surface rows to the http api registry
Little-Peony Aug 5, 2026
2b0f0a2
feat(http): validate api registry at startup and test endpoint parity
Little-Peony Aug 5, 2026
d715c9e
feat(http): expose two solidity read endpoints on pbft surface
Little-Peony Aug 18, 2026
4a99586
refactor(http): derive endpoint registry from @HttpApi annotations
Little-Peony Aug 24, 2026
84dbfa0
fix comment
Little-Peony Aug 25, 2026
bc7ad60
fix(http): set shielded contract parameter access to BUILD not READ
Little-Peony Aug 25, 2026
84170d7
refactor(http): derive endpoint registry from @HttpApi annotations
Little-Peony Aug 25, 2026
7209b8d
fix comments
Little-Peony Aug 25, 2026
74c2941
fix comments
Little-Peony Aug 25, 2026
8e6f059
test(http): drop pre-refactor route baseline and audit-matrix snapshot
Little-Peony Aug 25, 2026
f38f72e
fix(http): harden endpoint registry validation against silent mis-mounts
Little-Peony Aug 25, 2026
9e23145
fix(http): restore BUILD access on shielded contract parameter endpoints
Little-Peony Aug 28, 2026
d70a571
fix(http): route all HttpApiRegistry init failures to clean exit
Little-Peony Sep 1, 2026
085a2d2
test(http): drop registry tests the class initializer already enforces
Little-Peony Sep 1, 2026
04165b5
fix(http): idle out held connections once maxHttpConnectNumber is rea…
Little-Peony Sep 2, 2026
f934ae9
fix(http): align lite-fullnode history gate with the mounted endpoint…
Little-Peony Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions errorprone/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ if (!JavaVersion.current().isJava11Compatible()) {
// ErrorProne core requires JDK 11+; skip this module on JDK 8
tasks.withType(JavaCompile).configureEach { enabled = false }
tasks.withType(Jar).configureEach { enabled = false }
// No jar is produced, so the root maven-publish setup must not try to publish one
tasks.withType(AbstractPublishToMaven).configureEach { enabled = false }
} else {
dependencies {
compileOnly "com.google.errorprone:error_prone_annotations:${errorproneVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public abstract class HttpService extends AbstractService {

protected long maxRequestSize = 4 * 1024 * 1024; // 4MB

// Applied by ConnectionLimit only while maxHttpConnectNumber is reached: existing
// connections idle out after this long so the acceptor can resume. Jetty restores the
// connector default (30s) once the count drops back below the limit.
private static final long CONNECTION_LIMIT_IDLE_TIMEOUT_MS = 5000L;

@VisibleForTesting
public long getMaxRequestSize() {
return this.maxRequestSize;
Expand Down Expand Up @@ -80,7 +85,9 @@ protected void initServer() {
this.apiServer = new Server(this.port);
int maxHttpConnectNumber = Args.getInstance().getMaxHttpConnectNumber();
if (maxHttpConnectNumber > 0) {
this.apiServer.addBean(new ConnectionLimit(maxHttpConnectNumber, this.apiServer));
ConnectionLimit connectionLimit = new ConnectionLimit(maxHttpConnectNumber, this.apiServer);
connectionLimit.setIdleTimeout(CONNECTION_LIMIT_IDLE_TIMEOUT_MS);
this.apiServer.addBean(connectionLimit);
}
this.apiServer.setErrorHandler(new OversizedRequestErrorHandler());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import org.tron.core.config.args.Args;
import org.tron.core.db.RevokingDatabase;
import org.tron.core.db2.core.SnapshotManager;
import org.tron.core.services.interfaceOnPBFT.HttpApiOnPBFTService;
import org.tron.core.services.interfaceOnPBFT.RpcApiServiceOnPBFT;
import org.tron.core.services.interfaceOnPBFT.http.PBFT.HttpApiOnPBFTService;
import org.tron.core.services.interfaceOnSolidity.HttpApiOnSolidityService;
import org.tron.core.services.interfaceOnSolidity.RpcApiServiceOnSolidity;
import org.tron.core.services.interfaceOnSolidity.http.solidity.HttpApiOnSolidityService;

@Slf4j(topic = "app")
@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
import org.tron.core.exception.VMIllegalException;
import org.tron.core.exception.ZksnarkException;
import org.tron.core.metrics.MetricsApiService;
import org.tron.core.services.http.Util;
import org.tron.core.services.http.servlets.Util;
import org.tron.core.utils.TransactionUtil;
import org.tron.core.zen.address.DiversifierT;
import org.tron.core.zen.address.IncomingViewingKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ public static Set<String> getFilterPaths() {
filterPaths.add("/wallet/getblockbylatestnum");
filterPaths.add("/wallet/getblockbylimitnext");
filterPaths.add("/wallet/getblockbynum");
filterPaths.add("/wallet/getmerkletreevoucherinfo");
filterPaths.add("/wallet/gettransactionbyid");
filterPaths.add("/wallet/gettransactioncountbyblocknum");
filterPaths.add("/wallet/gettransactioninfobyid");
filterPaths.add("/wallet/gettransactionreceiptbyid");
filterPaths.add("/wallet/isspend");
filterPaths.add("/wallet/scanandmarknotebyivk");
filterPaths.add("/wallet/scannotebyivk");
filterPaths.add("/wallet/scannotebyovk");
filterPaths.add("/wallet/totaltransaction");
filterPaths.add("/wallet/gettransactioninfobyblocknum");
filterPaths.add("/wallet/getmarketorderbyaccount");
Expand All @@ -61,14 +56,9 @@ public static Set<String> getFilterPaths() {
filterPaths.add("/walletsolidity/getblockbylatestnum");
filterPaths.add("/walletsolidity/getblockbylimitnext");
filterPaths.add("/walletsolidity/getblockbynum");
filterPaths.add("/walletsolidity/getmerkletreevoucherinfo");
filterPaths.add("/walletsolidity/gettransactionbyid");
filterPaths.add("/walletsolidity/gettransactioncountbyblocknum");
filterPaths.add("/walletsolidity/gettransactioninfobyid");
filterPaths.add("/walletsolidity/isspend");
filterPaths.add("/walletsolidity/scanandmarknotebyivk");
filterPaths.add("/walletsolidity/scannotebyivk");
filterPaths.add("/walletsolidity/scannotebyovk");
filterPaths.add("/walletsolidity/gettransactioninfobyblocknum");
filterPaths.add("/walletsolidity/getmarketorderbyaccount");
filterPaths.add("/walletsolidity/getmarketorderbyid");
Expand All @@ -84,14 +74,10 @@ public static Set<String> getFilterPaths() {
filterPaths.add("/walletpbft/getblockbylatestnum");
filterPaths.add("/walletpbft/getblockbylimitnext");
filterPaths.add("/walletpbft/getblockbynum");
filterPaths.add("/walletpbft/getmerkletreevoucherinfo");
filterPaths.add("/walletpbft/gettransactionbyid");
filterPaths.add("/walletpbft/gettransactioncountbyblocknum");
filterPaths.add("/walletpbft/gettransactioninfobyid");
filterPaths.add("/walletpbft/isspend");
filterPaths.add("/walletpbft/scanandmarknotebyivk");
filterPaths.add("/walletpbft/scannotebyivk");
filterPaths.add("/walletpbft/scannotebyovk");
filterPaths.add("/walletpbft/gettransactioninfobyblocknum");
filterPaths.add("/walletpbft/getmarketorderbyaccount");
filterPaths.add("/walletpbft/getmarketorderbyid");
filterPaths.add("/walletpbft/getmarketpricebypair");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.tron.core.services.filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.tron.core.db.Manager;
import org.tron.core.db2.core.Chainbase;

@Component
public class PbftCursorFilter extends WalletCursorFilter {

@Autowired
public PbftCursorFilter(Manager dbManager) {
super(dbManager, Chainbase.Cursor.PBFT);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.tron.core.services.filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.tron.core.db.Manager;
import org.tron.core.db2.core.Chainbase;

@Component
public class SolidityCursorFilter extends WalletCursorFilter {

@Autowired
public SolidityCursorFilter(Manager dbManager) {
super(dbManager, Chainbase.Cursor.SOLIDITY);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package org.tron.core.services.filter;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.tron.core.db.Manager;
import org.tron.core.db2.core.Chainbase;

/**
* Selects which state view (HEAD / SOLIDITY / PBFT) the http servlets on this port read from.
*
* <p>The read cursor is a per-thread setting ({@code ThreadLocal} in {@code Chainbase}): it only
* decides from which snapshot the current thread starts its reads, and has no effect on any
* other thread. This filter sets the cursor before the servlet runs, so the same stateless
* servlet beans can serve {@code /wallet} (HEAD), {@code /walletsolidity} (SOLIDITY) and
* {@code /walletpbft} (PBFT) without per-port subclasses.
*
* <p>The cursor is always reset to HEAD in a finally block: jetty pools its worker threads, and
* a leftover cursor would leak into the next request served by the same thread. Only read-only
* endpoints may be mounted behind this filter — write paths must run with the HEAD cursor.
*/
public abstract class WalletCursorFilter implements Filter {

private final Manager dbManager;
private final Chainbase.Cursor cursor;

protected WalletCursorFilter(Manager dbManager, Chainbase.Cursor cursor) {
this.dbManager = dbManager;
this.cursor = cursor;
}

@Override
public void init(FilterConfig filterConfig) throws ServletException {
// do nothing
}

@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException {
try {
dbManager.setCursor(cursor);
filterChain.doFilter(servletRequest, servletResponse);
} finally {
dbManager.resetCursor();
}
}

@Override
public void destroy() {
// do nothing
}
}
Loading