0xMiden / 0xMiden/protocol

AggLayer: onchain verification of metadata hash during faucet registration

未关闭
#2,586 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
agglayer
主要语言
Rust
星标
132
派生
167
平均合并
1 天 23 小时
30 天内合并 PR
110

描述

During faucet registration (`register_faucet` in `bridge_config.masm`), the bridge should verify that the faucet's stored `metadata_hash` matches `keccak256(abi.encode(name, symbol, decimals))` computed from the faucet's actual storage values.

Currently the metadata hash is trusted from the faucet deployer with no on-chain verification. A malicious or misconfigured deployer could set an incorrect hash, causing bridge-out claims to fail on the EVM side.

Prerequisites:
- #2585 (token name in faucet storage)
- Implement `abi.encode(string, string, uint8)` in MASM

The verification would:
1. FPI to the faucet to read name, symbol, decimals
2. ABI-encode them in MASM
3. Keccak256 the encoded bytes
4. FPI to the faucet to read the stored metadata hash
5. Assert they match

There is a TODO in `bridge_config.masm::register_faucet` tracking as of PR #2583

Related: #2453

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。