Skip to content

Gasless transactions - RLN verifier & RPC updates - #3

Closed
nadeemb53 wants to merge 20 commits into
mainfrom
feat/gasless-module
Closed

nadeemb53 wants to merge 20 commits into
mainfrom
feat/gasless-module

Conversation

@nadeemb53

@nadeemb53 nadeemb53 commented Jun 3, 2025 •

Copy link
Copy Markdown

Implements key components of the gasless transaction system for Status Network, centered around RLN

RLN Verifier Validator (within LineaTransactionPoolValidatorPlugin):

  • Validates transactions using RLN ZK proofs via JNI bridge to Rust library using zerokit
  • Manages user quotas based on Karma tiers fetched via gRPC karma service
  • Implements a shared Deny List for users exceeding quotas, with TTL expiry and premium gas bypass
  • Designed to receive RLN proofs from the RLN Prover service via gRPC streaming with exponential backoff reconnection
  • Features LRU proof cache with automatic eviction and comprehensive error handling

linea_estimateGas RPC Modifications:

  • Provides zero gas estimates for eligible gasless users (when plugin-linea-rpc-gasless-enabled=true)
  • Applies configurable premium gas multiplier for users on the Deny List
  • Maintains backward compatibility for non-gasless transactions

Architecture Components:

  • JNI Bridge: Rust implementation for RLN proof verification using native cryptographic libraries
  • gRPC Services: Streaming proof distribution and karma service integration
  • Deny List Management: File-based storage with automatic refresh
  • Configuration System: Comprehensive CLI options for all gasless and RLN features

Key Features:

  • Thread-safe concurrent operations with proper resource management
  • Exponential backoff for service reconnections with configurable retry limits
  • LRU cache for proof validation with TTL support
  • Karma-based quota enforcement supporting multiple user tiers
  • Premium gas bypass mechanism for high-priority transactions

nadeemb53 added 20 commits May 20, 2025 16:49
- Introduced new configuration classes for RLN validation, including LineaRlnValidatorCliOptions and LineaRlnValidatorConfiguration.
- Enhanced the build.gradle file to include gRPC and Protobuf dependencies.
- Implemented the RlnBridge for native library integration and proof verification.
- Updated transaction pool validation to conditionally include RLN verification.
- Added CLI options for shared gasless configurations and integrated them into existing classes.
- Created tests for new configurations and validators to ensure functionality.
- Updated .gitignore to exclude .vscode directory.

This commit lays the groundwork for RLN validation in the transaction pool, enhancing the overall security and efficiency of the system.
…sion

- Updated RlnVerifierValidator to use Bytes.fromHexString for proof verification.
- Removed the hexToBytes method from RlnVerifierValidator and related test classes.
- Adjusted tests in RlnBridgeTest and RlnVerifierValidatorTest to utilize the new Bytes utility for hex string conversion.
- Improved error handling in test data loading for better clarity on failures.
…e registration

- Renamed CLI options in LineaRlnValidatorCliOptions, LineaRpcCliOptions, LineaSharedGaslessCliOptions to use a consistent prefix `--plugin-`.
- Commented out the direct registration of LineaSharedGaslessCliOptions in AbstractLineaSharedPrivateOptionsPlugin to resolve
- Introduced a new method for gas estimation in LineaEstimateGas, improving the handling of gasless transactions.
- Updated CLI option names across LineaRlnValidatorCliOptions and LineaRpcCliOptions to maintain consistency with the `--plugin-` prefix.
- Added logging for the startup of LineaTransactionPoolValidatorPlugin to improve visibility during initialization.
- Removed deprecated methods and cleaned up the code for better maintainability.
- Introduced new CLI options for configuring the Karma gRPC service, including host, port, TLS usage, timeout, and exponential backoff settings.
- Updated LineaRlnValidatorConfiguration and LineaRpcConfiguration to support the new Karma service parameters.
- Improved LineaEstimateGas and RlnVerifierValidator to utilize the Karma service for gasless transaction validation.
- Improved logging and error handling for Karma service interactions.
- Added unit tests to validate the new configurations and Karma service functionality.
- Removed outdated comments in AbstractLineaSharedPrivateOptionsPlugin to streamline the code and clarify the logic for sharedGaslessConfiguration retrieval.
- Cleaned up the Cargo.toml file by removing unnecessary comments and ensuring clarity in dependency management.
- Updated import statements in lib.rs for consistency and clarity.
- Simplified RlnBridgeTest by removing comments related to invalid proof handling, focusing on the core test functionality.
- Replaced gRPC-based Karma service implementation with a shared KarmaServiceClient for gasless transaction validation in LineaEstimateGas and RlnVerifierValidator.
- Introduced DenyListManager to manage deny list operations, enhancing code maintainability and clarity.
- Updated constructors and initialization logic across relevant classes to accommodate new shared service dependencies.
- Removed outdated comments and unused code related to previous gRPC implementations.
- Improved logging for better visibility during gasless transaction processing.
- Updated RlnVerifierValidator to accept KarmaServiceClient as a constructor parameter, improving dependency injection for quota validation.
- Removed outdated karma service initialization logic and related comments to streamline the code.
- Modified LineaTransactionPoolValidatorFactory to pass the KarmaServiceClient when creating RlnVerifierValidator instances.
- Enhanced unit tests to accommodate the new Karma service dependency, ensuring proper functionality during validation.
- Added Apache License headers to multiple Java files for compliance.
- Improved code formatting by adjusting line breaks and indentation for better readability.
- Ensured consistency in comments and removed unnecessary whitespace across various classes.
- Updated test files to include license headers and maintain formatting standards.
…ions

- Updated LineaRlnValidatorCliOptions to streamline configuration options, including renaming and consolidating parameters for clarity.
- Removed the LineaSharedGaslessCliOptions class, integrating its functionality directly into the RLN validator configuration.
- Enhanced sharedGaslessConfiguration retrieval logic in AbstractLineaSharedPrivateOptionsPlugin for better fallback handling.
- Improved unit tests to validate new configurations and ensure proper functionality of the RLN validator with the updated CLI options.
- Removed unnecessary blank lines and adjusted line breaks for better readability in multiple Java files.
- Enhanced comment formatting for consistency and clarity, particularly in the NullifierTracker and RlnVerifierValidator classes.
- Updated test files to maintain formatting standards and ensure consistency across the codebase.
@nadeemb53 nadeemb53 closed this Jul 7, 2026
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.

1 participant