Skip to content
Merged
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
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ start-env-with-rln:
start-env-with-rln-and-contracts:
@echo "Starting complete RLN environment with automated contract deployment..."
make start-env COMPOSE_FILE=docker/compose-tracing-v2-rln.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
@echo "Environment started. Beginning contract deployment with automatic RLN handling..."
make deploy-contracts LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
@echo "Complete RLN environment with contracts is ready!"

staterecovery-replay-from-block: L1_ROLLUP_CONTRACT_ADDRESS:=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/local-deployments-artifacts/L1RollupAddress.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0xa513E6E4b8f2a923D98304ec87F64353C4D5C853
0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
8 changes: 4 additions & 4 deletions docker/compose-spec-l2-services-rln.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
rln-prover:
hostname: rln-prover
container_name: rln-prover
image: docker.io/0xnadeem/status-rln-prover:20251029125050-dev
image: status-rln-prover:20251126193838
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo", "rln" ]
ports:
- "50051:50051" # RLN proof service
Expand Down Expand Up @@ -38,7 +38,7 @@ services:
karma-service:
hostname: karma-service
container_name: karma-service
image: docker.io/0xnadeem/status-rln-prover:20251029125050-dev
image: status-rln-prover:20251126193838
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo", "rln" ]
ports:
- "50053:50052"
Expand All @@ -63,7 +63,7 @@ services:
sequencer:
hostname: sequencer
container_name: sequencer
image: docker.io/0xnadeem/linea-besu-minimal-rln:20251029125050-dev
image: linea-besu-minimal-rln:20251126210242
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo" ]
ports:
- "8545:8545"
Expand Down Expand Up @@ -174,7 +174,7 @@ services:
l2-node-besu:
hostname: l2-node-besu
container_name: l2-node-besu
image: docker.io/0xnadeem/linea-besu-minimal-rln:20251029125050-dev
image: linea-besu-minimal-rln:20251126210242
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo" ]
depends_on:
sequencer:
Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"test:e2e:local": "TEST_ENV=local npx jest",
"test:e2e:dev": "TEST_ENV=dev npx jest --config ./jest.testnet.config.ts --bail --runInBand --testPathIgnorePatterns=restart.spec.ts",
"test:e2e:sepolia": "TEST_ENV=sepolia npx jest --config ./jest.testnet.config.ts --bail --runInBand --testPathIgnorePatterns=restart.spec.ts",
"test:rln:local": "TEST_ENV=local npx jest --testPathPattern=rln-gasless --runInBand --verbose",
"postinstall": "typechain --target ethers-v6 --out-dir ./src/typechain '../contracts/local-deployments-artifacts/**/*.json'",
"lint:fix": "pnpm run lint:ts:fix && pnpm run prettier:fix",
"clean": "rimraf node_modules src/typechain"
Expand Down
45 changes: 45 additions & 0 deletions e2e/src/rln-gasless/config/contract-loader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ethers } from "ethers";
import { RLN_CONFIG } from "./rln-config";

// Import ABIs - these should be generated by typechain
// For now, we'll use minimal ABIs for testing

const KARMA_ABI = [
"function balanceOf(address account) view returns (uint256)",
"function mint(address to, uint256 amount)",
"function totalSupply() view returns (uint256)",
"event Transfer(address indexed from, address indexed to, uint256 value)",
];

const RLN_ABI = [
"function register(bytes32 identityCommitment, address userAddress)",
"function members(uint256 index) view returns (bytes32)",
"function users(address user) view returns (tuple(bytes32 identityCommitment, uint256 index))",
"event MemberRegistered(address indexed user, bytes32 identityCommitment, uint256 index)",
];

const KARMA_TIERS_ABI = [
"function getTier(uint256 karmaBalance) view returns (tuple(string name, uint256 minKarma, uint256 maxKarma, uint32 txPerEpoch))",
"function updateTiers(tuple(string name, uint256 minKarma, uint256 maxKarma, uint32 txPerEpoch)[] tiers)",
"event TiersUpdated()",
];

/**
* Load deployed RLN contracts
*/
export function loadRlnContracts(provider: ethers.Provider, signer?: ethers.Signer) {
const providerOrSigner = signer || provider;

return {
karma: new ethers.Contract(RLN_CONFIG.contracts.karma, KARMA_ABI, providerOrSigner),
rln: new ethers.Contract(RLN_CONFIG.contracts.rln, RLN_ABI, providerOrSigner),
karmaTiers: new ethers.Contract(RLN_CONFIG.contracts.karmaTiers, KARMA_TIERS_ABI, providerOrSigner),
};
}

/**
* Get contract addresses
*/
export function getContractAddresses() {
return RLN_CONFIG.contracts;
}
73 changes: 73 additions & 0 deletions e2e/src/rln-gasless/config/rln-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* RLN Test Configuration
* Contains deployed contract addresses and service URLs
*/

export const RLN_CONFIG = {
// Contract addresses (deployed via make start-env-with-rln-and-contracts)
// Note: These addresses change on each fresh deployment - update after clean restart
contracts: {
karmaTiers: "0x729409fad88cafda895e41f9ed00ef4094f8d130",
karma: "0x35a5e43d3d3195b49cbfe78cd944115eaa2e09db",
rln: "0x9145615d34afba9f8ecb4e2384325646f2393dde",
stakeManager: "0x2f6daaf8a81ab675fbd37ca6ed5b72cf86237453",
karmaNFT: "0xcc1b08b17301e090cbb4c1f5598cbaa096d591fb",
},

// Service URLs
services: {
rpcUrl: "http://localhost:9045",
sequencerUrl: "http://localhost:8545",
karmaServiceUrl: "http://localhost:50053", // Docker maps 50052 -> 50053
rlnProverUrl: "http://localhost:50051",
},

// Test configuration
test: {
denyListPath: "/tmp/test-deny-list.txt",
premiumGasThresholdGwei: 10,
premiumGasMultiplier: 1.5,
epochMode: "TEST", // 60s epochs
testTimeout: 45000, // 45s per test - L2 should be fast
},

// Test accounts (from genesis file - private keys)
accounts: {
// Contract deployer account (has balance in genesis)
admin: "0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae",
user1: "0x8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63",
user2: "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
recipient: "0x627306090abaB3A6e1400e9345bC60c78a8BEf57", // Address
},

// Pre-registered RLN mock users (from rln-prover mock_users.json)
// These addresses are already registered in the RLN prover when running in mock mode
// Use these for gasless transaction tests
mockUsers: {
// Hardhat account #0 - pre-registered in RLN prover mock mode
user0: {
address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
privateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
txCount: 0,
},
// Hardhat account #1 - pre-registered in RLN prover mock mode
user1: {
address: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
privateKey: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
txCount: 0,
},
// Hardhat account #2 - pre-registered in RLN prover mock mode (has 2 tx_count)
user2: {
address: "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
privateKey: "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a",
txCount: 2,
},
// Special test user from genesis - pre-registered in RLN prover mock mode
testUser: {
address: "0x1B9AbEeC3215D8AdE8a33607f2cF0f4F60e5F0D0",
// Note: This key needs to be added if testing with this account
privateKey: null,
txCount: 0,
},
},
};
Loading
Loading