bug(rln-relay): RLN DB should be aware of chain and contract address #1921
Labels
bug
Something isn't working
E:3.2: Basic DoS protection in production
See https://github.com/waku-org/pm/issues/70 for details
Problem
Currently the RLN metadata only saves the last processed block. If we change the RPC endpoint to point to a different chainID, or change the contract address, the information stored in RLN SledDB then the information stored in the database is not useful anymore, as the event logs that populate the database are associated to an specific chainID and contract address. However, rln-relay in its current version does not verify the chainID, so it will reuse the same database information even tho it is incorrect.
Impact
Merkle tree with incorrect data is generated. RLN validation will be done incorrectly.
Expected behavior
--rln-relay-eth-contract-address
flag against the contract address stored in the metadata, AND the result from callingeth_chainId
RPC method with the chainID stored in the metadata. If there is no match, drop the information of the DBThe text was updated successfully, but these errors were encountered: