Claim a gossip block's slot and proposer before its stateful checks
维护者通常 6 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- backend, networking, security
调研方向
Start with crates/net/p2p/src/beacon/verdict.rs and gossip::block::cheap_checks, then trace the stateful checks run on spawn_blocking under gossip_validation_permits. Review payload_hash::tests::verify_block_cost for the hash cost and the validation behavior described in docs/spec_deviations.md. Add a concurrent test for two signed blocks with the same (slot, proposer) and confirm only one is hashed; the issue leaves the fix design open.
由索引模型根据 Issue 内容生成。
描述
Beacon gossip records a block's (slot, proposer) in P2PServer::seen_blocks only when its verdict reaches the p2p actor (settle in crates/net/p2p/src/beacon/verdict.rs). The stateful checks run before that, on spawn_blocking threads under gossip_validation_permits (128). So several distinct blocks for one slot and proposer that arrive together all pass the cheap checks' AlreadySeen rule (gossip::block::cheap_checks) and are each checked in full:
- the parent-state lookup and the proposer's BLS signature (on
mainalready); - since lambdaclass/ethlambda#770, the payload block hash on an
Accept: a transactions trie and keccak, measured at up to 0.6 s for a block at the 10 MiB gossip limit filled with 1,048,576 tiny transactions (payload_hash::tests::verify_block_cost).
It takes the slot's proposer signing equivocations (slashable) and sending them directly, since honest peers relay only the first. The work is bounded by the permit count: past it, blocks are forwarded unchecked under Overloaded. lambdaclass/ethlambda#770 documents the window in docs/spec_deviations.md and leaves the fix out, because it changes how every block is validated, not only the hash.
Possible fixes:
- A shared claim set keyed by
(slot, proposer)(an LRU sized likeSEEN_BLOCKS_CAPACITY), taken by the blocking task before its signature check, or at least before the hash. A second block for a claimed key answersIgnore(AlreadySeen)without further work. A claim is released when its block fails its signature or an earlier rule, so it never stands for an invalid block, which keeps the specification's "first block with a valid signature". - Independently, a transaction-count budget above which
block_verdictdoes not hash, leaving the block to the execution client. Mainnet's gas limit allows a few thousand transactions, so a cap such as 2^14 would bound the trie without touching real blocks.
A test should send two signed blocks for one key through the stateful checks at once and assert that only one is hashed.
- 主要语言
- Rust
- 星标
- 86
- 派生
- 34
- 平均合并
- 9 天 20 小时
- 30 天内合并 PR
- 77
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lambdaclass/ethlambda 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
lambdaclass/ethlambda#850 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
lambdaclass/ethlambda#777 · 1 个 reaction ·
维护者通常 6 天内回复
-
Run all gossip validation tests可能重新可做 @dicethedev 于 9 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
lambdaclass/ethlambda#725 · 2 条评论 ·
维护者通常 6 天内回复
-
Handle malformed DB data可能重新可做 @dicethedev 于 115 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
lambdaclass/ethlambda#529 · 4 条评论 ·
维护者通常 6 天内回复
-
Document architectural choices可能重新可做 @dicethedev 于 115 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
lambdaclass/ethlambda#521 · 2 条评论 ·
维护者通常 6 天内回复
查看 lambdaclass/ethlambda 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
bytecodealliance/wrpc#1785 ·
维护者通常 1 天内回复
-
2 advisory ignore entries no longer match anything (`quick-xml` already patched in `Cargo.lock`)未关闭
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
longbridge/nsh#2758 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
antithesishq/bombadil#473 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
libracoder/kiri#669 ·
维护者通常 1 天内回复