Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public class LineaRlnValidatorCliOptions implements LineaCliOptions {
private String karmaService = "localhost:50052";

@CommandLine.Option(
names = "--plugin-linea-rln-deny-list-path",
description = "Path to the gasless deny list file (default: ${DEFAULT-VALUE})",
names = "--plugin-linea-rln-nullifier-storage-path",
description = "Path to the nullifier storage file (default: ${DEFAULT-VALUE})",
arity = "1")
private String denyListPath = "/var/lib/besu/gasless-deny-list.txt";
private String nullifierStoragePath =
LineaSharedGaslessConfiguration.DEFAULT_NULLIFIER_STORAGE_PATH;

// === ADVANCED OPTIONS (most users won't need to change these) ===

Expand Down Expand Up @@ -107,13 +108,13 @@ public LineaRlnValidatorConfiguration toDomainObject() {
proofPort == 443 || proofPort == 8443 || karmaPort == 443 || karmaPort == 8443);

// Create shared gasless config with simplified settings
// Note: Deny list is now stored in the RLN prover's PostgreSQL database and accessed via gRPC
LineaSharedGaslessConfiguration sharedConfig =
new LineaSharedGaslessConfiguration(
denyListPath,
60L, // 1 minute refresh interval (good default)
60L, // denyListCacheRefreshSeconds - 1 minute (local cache cleanup interval)
premiumGasThresholdGWei,
60L // 1 hour expiry (good default)
);
60L, // denyListEntryMaxAgeMinutes - 1 hour TTL for deny list entries
nullifierStoragePath);

return new LineaRlnValidatorConfiguration(
rlnValidationEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ public record LineaRlnValidatorConfiguration(
Optional.empty() // rlnJniLibPath
);

// Accessor for deny list path for convenience
public String denyListPath() {
return sharedGaslessConfig.denyListPath();
}

// Accessor for premium gas price threshold in Wei for convenience (converting from GWei)
public long premiumGasPriceThresholdWei() {
return sharedGaslessConfig.premiumGasPriceThresholdGWei()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,53 @@
/**
* Shared configuration parameters for gasless transaction features (RLN, RPC modifications).
*
* @param denyListPath Path to the text file storing addresses of users on the deny list. This file
* is read by the RPC estimateGas method and read/written by the RLN Validator.
* @param denyListRefreshSeconds Interval in seconds at which the deny list file should be reloaded
* by components.
* <p>The deny list is stored in the RLN Prover's PostgreSQL database and accessed via gRPC. The
* sequencer connects to the prover service using the RLN proof service host/port configuration.
*
* @param denyListCacheRefreshSeconds Interval in seconds for local cache cleanup of expired
* entries.
* @param premiumGasPriceThresholdGWei Minimum gas price (in GWei) for a transaction to be
* considered premium.
* considered premium. Users on the deny list can bypass restrictions by paying this amount.
* @param denyListEntryMaxAgeMinutes Maximum age in minutes for an entry on the deny list before it
* expires.
* expires. This TTL is enforced by the prover's database.
* @param nullifierStoragePath Path to the file for storing nullifier tracking data.
*/
public record LineaSharedGaslessConfiguration(
String denyListPath,
long denyListRefreshSeconds,
long denyListCacheRefreshSeconds,
long premiumGasPriceThresholdGWei,
long denyListEntryMaxAgeMinutes)
long denyListEntryMaxAgeMinutes,
String nullifierStoragePath)
implements LineaOptionsConfiguration {

public static final String DEFAULT_DENY_LIST_PATH = "/var/lib/besu/gasless-deny-list.txt";
public static final long DEFAULT_DENY_LIST_REFRESH_SECONDS = 300L; // 5 minutes
public static final long DEFAULT_DENY_LIST_CACHE_REFRESH_SECONDS = 60L; // 1 minute
public static final long DEFAULT_PREMIUM_GAS_PRICE_THRESHOLD_GWEI = 100L; // 100 Gwei
public static final long DEFAULT_DENY_LIST_ENTRY_MAX_AGE_MINUTES = 10L; // 10 minutes
public static final String DEFAULT_NULLIFIER_STORAGE_PATH = "/var/lib/besu/nullifiers.txt";

public static LineaSharedGaslessConfiguration V1_DEFAULT =
new LineaSharedGaslessConfiguration(
DEFAULT_DENY_LIST_PATH,
DEFAULT_DENY_LIST_REFRESH_SECONDS,
DEFAULT_DENY_LIST_CACHE_REFRESH_SECONDS,
DEFAULT_PREMIUM_GAS_PRICE_THRESHOLD_GWEI,
DEFAULT_DENY_LIST_ENTRY_MAX_AGE_MINUTES);
DEFAULT_DENY_LIST_ENTRY_MAX_AGE_MINUTES,
DEFAULT_NULLIFIER_STORAGE_PATH);

// Constructor allowing easy overriding of the path if needed from other config sources
public LineaSharedGaslessConfiguration {
if (denyListPath == null || denyListPath.isBlank()) {
throw new IllegalArgumentException("Deny list path cannot be null or blank.");
}
if (denyListRefreshSeconds <= 0) {
throw new IllegalArgumentException("Deny list refresh seconds must be positive.");
if (denyListCacheRefreshSeconds <= 0) {
throw new IllegalArgumentException("Deny list cache refresh seconds must be positive.");
}
if (premiumGasPriceThresholdGWei <= 0) {
throw new IllegalArgumentException("Premium gas price threshold GWei must be positive.");
}
if (denyListEntryMaxAgeMinutes <= 0) {
throw new IllegalArgumentException("Deny list entry max age minutes must be positive.");
}
if (nullifierStoragePath == null || nullifierStoragePath.isBlank()) {
throw new IllegalArgumentException("Nullifier storage path cannot be null or blank.");
}
}

// Backward compatibility getter for code still using the old name
public long denyListRefreshSeconds() {
return denyListCacheRefreshSeconds;
}
}
Loading
Loading