fix(evm): resolve account/ethaccount InvokeEVM calls via the Send fallback#325
Merged
Conversation
…lback
Messages using the exported EVM method InvokeEVM (method 3844450837,
= builtin.MethodsEVM.InvokeContract) sent to a plain account/ethaccount
actor were resolved to "<unknown>" instead of a meaningful method name,
even when value was transferred.
Root cause: the account/ethaccount fallback branch in GetMethodName was
unreachable. Its guard required GetMethodByActorName(actorName) to return
actors.UnknownStr, but that function returns a struct for "account" and
"ethaccount", so the branch never executed.
- Extract a pure resolveMethodName()/findMethodInActor() seam: look the
method number up in the recipient actor's own method set first, then
fall back to METHOD_FALLBACK ("Send") for account/ethaccount exported
methods (>= 1<<24). These value transfers now surface as Send ops.
- Add TestResolveMethodName covering evm/account/ethaccount/placeholder.
EVM contract recipients (evm actor) still resolve to InvokeContract /
EVM_CALL, unchanged. block.go and SupportedOperations are untouched
because METHOD_FALLBACK is "Send", already handled by the op switch.
emmanuelm41
force-pushed
the
fix/account-fallback-method
branch
from
July 7, 2026 16:58
89b2f1b to
cb7e2fe
Compare
Broaden TestResolveMethodName to lock in behavior around the fix: - EVM InvokeContractDelegate (the other EVM_CALL feeder) and non-EVM known methods (multisig Propose, init Exec) still resolve by name. - Exported-method threshold boundary for account (1<<24 -> Send, 1<<24-1 -> unknown). - Case-insensitive account fallback matching. Add TestGetMethodNameShortcuts covering the exported GetMethodName wrapper's infra-free branches (nil message -> error, method 0 -> Send, method 1 -> Constructor).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Messages using the exported EVM method
InvokeEVM(method number3844450837) sent to a plainaccountactor were parsed as operation typeunknowninstead of a meaningful method — even when value was transferred.Reported example tx:
bafy2bzacedyutaqjt2zw4kkldcjcj72l5qxll2dnwq3kjm5uzix3fdccetxco(tof03371596, anaccountactor, ~11.53 FIL).Note:
3844450837is a single method —FRC42("InvokeEVM")= go-state-typesbuiltin.MethodsEVM.InvokeContract. The label depends on the recipient actor type, not the method number.Root cause
The
account/ethaccountfallback branch inGetMethodName(added in #292) was unreachable dead code: its guard requiredGetMethodByActorName(actorName) == actors.UnknownStr, but that function returns a struct for"account"and"ethaccount", so the guard was never satisfied. The method therefore fell through to<unknown>.The value itself was never lost —
block.go's default branch still emits debit/credit ops forvalue != 0— so this was a labeling bug, not a balance-reconciliation bug.Change
resolveMethodName()/findMethodInActor()seam: look the method number up in the recipient actor's own method set first, then fall back toMETHOD_FALLBACKforaccount/ethaccountexported methods (>= 1<<24).METHOD_FALLBACKstays"Send"(unchanged), so these value transfers surface as ordinarySendoperations — the behavior the dead branch originally intended.TestResolveMethodName— the end-to-endGetMethodName-level coverage that was missing and let this bug hide (the prior test only exercisedFindMethodNameInAllActorsin isolation).block.goandSupportedOperationsare untouched:"Send"is already handled.evmcontract recipients still resolve toInvokeContract→EVM_CALL, unchanged.Behavior
3844450837— beforeevmEVM_CALLEVM_CALL(unchanged)accountunknownSendethaccountunknownSendplaceholderunknownunknown(see below)Verification
gofmtclean,go vetclean,golangci-lint(new-issues vsmaster) 0 issuesTestResolveMethodName(7 cases) passes;make test(./rosetta/services) passesNotes / possible follow-ups
ethaccount→Sendhere diverges from beryx, which labels ethaccountInvokeEVMasInvokeContract(it remaps ethaccount→EVM table). Grouped withaccountfor now.placeholderrecipients still resolve tounknown(not covered byisAccountActorFallback); fil-parser resolves these toInvokeContract. Documented by a test case.