Skip to content

Conversation

@tim-hm
Copy link
Contributor

@tim-hm tim-hm commented Dec 11, 2025

No description provided.

BREAKING CHANGE: Payments now use Ethereum ERC-20 token burns instead of nilchain transactions. Configuration schema has changed.

Note the test suite is broken in this commit but will be fixed shorlty.

New Ethereum RPC integration:
- Add AlloyBurnWithDigestEventRetriever for querying burn events
- Verify chain Iid at startup to prevent testnet/mainnet misconfigurations
- Use RFC 8785 (JCS) canonical JSON for consistent payload hashing
- Add chain_id to payment payload for cross-chain verification

Configuration changes:
- Replace nilchain_url with ethereum_rpc_url
- Add nil_token_address, burn_contract_address, chain_id

Startup improvements:
- Add structured logging of configuration at startup
- Log chain ID verification success

Removed:
- nilauth_client dependency (nilchain client)
- Legacy migrations (replaced with consolidated init schema)
- Docker nilchain service from compose
- Add PaymentRecord struct to capture all required payment fields (chain_id, amount_wei, digest, payer_address, etc.)
- Update credit_payment and store_invalid_payment to insert all NOT NULL columns required by the new ERC-20 payment schema
- Add serial_test crate and mark integration tests that use Ethereum transactions with #[serial] to prevent nonce conflicts when tests run in parallel
- Fix expected error code in pay_too_soon test (CANNOT_RENEW_YET)
- Fix deprecation warning by using as_ref() instead of as_slice()
- Replace runtime query()/query_as() with query!() macros for compile-time SQL validation and type checking
- Convert lookup_revocations from dynamic placeholders to ANY($1) array syntax compatible with query! macro
- Generate .sqlx/ offline query data for CI builds without a database
- Remove unused imports (itertools, FromRow, Executor, etc.)
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.

2 participants