Skip to content

feat: eth_call/eth_estimateGas 跳过 sender 验证 - #6560

Merged
LinZexiao merged 1 commit into
masterfrom
feat/eth-call-skip-sender-validation
Jul 30, 2026
Merged

feat: eth_call/eth_estimateGas 跳过 sender 验证#6560
LinZexiao merged 1 commit into
masterfrom
feat/eth-call-skip-sender-validation

Conversation

@LinZexiao

Copy link
Copy Markdown
Collaborator

背景

eth_call 和 eth_estimateGas 在 sender 不存在或 sender 为 EVM 合约时,会因 sender 验证失败而无法执行。此 PR 实现了 sender 验证跳过机制,当检测到 sender 验证相关错误时,自动 fallback 到跳过验证的执行路径。

Ref: lotus#13470, lotus#13724

改动

statemanger 层 (pkg/statemanger/call.go)

  • callInternal 新增 skipSenderValidation bool 参数
  • skipSenderValidation=true 且 sender 不存在时,通过 ApplyImplicitMessage 创建 ephemeral placeholder actor
  • 新增方法:ApplyOnStateWithGasSkipSenderValidationCallWithGasSkipSenderValidation
  • 所有现有调用传 skipSenderValidation=false,行为不变

ETH API 层 (app/submodule/eth/eth_api.go)

  • 新增 isSenderValidationError 辅助函数
  • EthCall:正常执行失败且为 sender 验证错误时 fallback
  • EthEstimateGas:正常 gas 估算失败且为 sender 验证错误时 fallback

测试

  • pkg/statemanger/call_test.go:接口断言、兼容性测试、错误模式验证
  • app/submodule/eth/eth_call_fallback_test.go:错误语义验证、接口兼容性验证

审查

  • 方案审查 ✅ → 测试审查 ✅ → 代码审查 ✅

@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 22%. Comparing base (30e71cd) to head (d6afedf).

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #6560   +/-   ##
======================================
- Coverage      22%     22%   -1%     
======================================
  Files         790     790           
  Lines       83767   83795   +28     
======================================
- Hits        18603   18602    -1     
- Misses      62293   62323   +30     
+ Partials     2871    2870    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@elvin-du
elvin-du self-requested a review July 25, 2026 09:33
elvin-du
elvin-du previously approved these changes Jul 27, 2026

@elvin-du elvin-du left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGM

@LinZexiao
LinZexiao force-pushed the feat/eth-call-skip-sender-validation branch from fd3ce90 to 4d0a0d7 Compare July 28, 2026 16:07
- callInternal 新增 skipSenderValidation 参数
- 新增 ApplyOnStateWithGasSkipSenderValidation / CallWithGasSkipSenderValidation
- isSenderValidationError 辅助函数
- EthCall fallback:sender 验证失败时自动跳过重试
- EthEstimateGas fallback:sender 验证失败时自动跳过重试
@LinZexiao
LinZexiao force-pushed the feat/eth-call-skip-sender-validation branch from 13c8aef to d6afedf Compare July 28, 2026 16:29
@elvin-du
elvin-du self-requested a review July 30, 2026 01:25

@elvin-du elvin-du left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGM

@LinZexiao
LinZexiao merged commit 3e20c0d into master Jul 30, 2026
2 checks passed
@LinZexiao
LinZexiao deleted the feat/eth-call-skip-sender-validation branch July 30, 2026 02:54
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.

3 participants