Skip to content

add AN compatibility for v0.44.12#8287

Closed
j1010001 wants to merge 4 commits intompeter/disable-evm-state-mutationfrom
jan/pr-8286-with-AN-compatibility-for-v0.44.12
Closed

add AN compatibility for v0.44.12#8287
j1010001 wants to merge 4 commits intompeter/disable-evm-state-mutationfrom
jan/pr-8286-with-AN-compatibility-for-v0.44.12

Conversation

@j1010001
Copy link
Copy Markdown
Member

@j1010001 j1010001 commented Jan 2, 2026

adding AN compatibility on top of: #8286, commit: 4959dbb

Summary by CodeRabbit

Release Notes

  • New Features

    • Added account restriction system to prevent restricted accounts from executing transactions
    • Introduced restricted EOAs in EVM with early access controls
    • Added SetCode authorization support for EVM transactions
    • Expanded computation tracking with remaining computation queries
  • Bug Fixes

    • Improved gas overflow handling for EVM batch transactions
    • Enhanced storage limit validation with restricted account checks
    • Fixed balance validation in EVM withdrawals
  • Chores

    • Updated dependencies: golangci-lint, Cadence, atree, and related modules
    • Migrated linter configuration to latest schema

✏️ Tip: You can customize this high-level summary in your review settings.

@j1010001 j1010001 requested a review from a team as a code owner January 2, 2026 02:48
@j1010001 j1010001 changed the base branch from master to leo/check-msg-sender January 2, 2026 02:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 2, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Updates golangci-lint tooling and configuration, implements restricted account enforcement across transaction processing layers, adds computation remaining tracking to metering interfaces, extends EVM restricted EOA restrictions with test coverage, refactors transaction verification to support service account overrides, and bumps multiple Go module dependencies.

Changes

Cohort / File(s) Summary
Tooling & Build Configuration
.custom-gcl.yml, .github/workflows/ci.yml, .golangci.yml
Updated golangci-lint from v1.63.4 to v2.7.1 and CI workflow from v6 to v9; migrated .golangci.yml from version 1 to version 2 schema with restructured linter settings, exclusions, and formatter blocks (goimports enablement, gci/goimports configuration)
Restricted Accounts Feature
fvm/blueprints/contracts.go, fvm/environment/contract_updater.go, fvm/environment/env.go, fvm/errors/codes.go, fvm/errors/execution.go, fvm/transactionInvoker.go, fvm/transactionStorageLimiter.go, fvm/transactionStorageLimiter_test.go, module/trace/constants.go
Added RestrictedAccountsPath variable, GetRestrictedAccounts() method across ContractUpdater/Environment interfaces with Cadence storage reading logic, new error code ErrCodeAccountIsRestrictedError (1119) with NewAccountRestrictedError constructor, and integrated restriction checks into transaction flow with restricted accounts retrieval and validation
Computation Metering
cmd/util/ledger/util/nop_meter.go, fvm/environment/meter.go, fvm/meter/computation_meter.go, fvm/storage/state/execution_state.go, fvm/storage/state/transaction_state.go, fvm/evm/backends/wrappedEnv.go, fvm/evm/testutils/backend.go
Added ComputationRemaining(kind) uint64 method across Meter interface and implementations (returns remaining computation budget or MaxUint64 for unbounded cases)
EVM Restricted EOA & Balance Validation
fvm/evm/emulator/emulator.go, fvm/evm/emulator/emulator_test.go, fvm/evm/emulator/restricted_eoa_test.go, fvm/evm/emulator/state/collection.go, fvm/evm/types/balance.go, fvm/evm/types/call.go, fvm/evm/types/errors.go, fvm/evm/types/result.go, fvm/evm/impl/impl.go, fvm/evm/handler/handler.go
Introduced restrictedEOAs enforcement with early-return invalid results for restricted senders, refactored NewInvalidResult signature to accept txType/txHash directly, updated balance validation to use AttoFlowBalanceIsValidForFlowVault, replaced convertAndCheckValue with checkAndConvertValue, added SetCodeAuthorizations support to DirectCall, and refactored per-transaction gas checking in batch handler
EVM DryCall & Query
fvm/evm/offchain/query/view.go, fvm/evm/offchain/query/view_test.go
Added authList parameter to DryCall method for SetCodeAuthorization support; updated test invocations to pass empty/non-empty authorization lists
EVM Cadence Stdlib
fvm/evm/stdlib/contract.cdc, fvm/evm/stdlib/contract_test.go
Added reclaimFundsFromAttackerEOAs method to EVM contract and CadenceOwnedAccount resource; updated withdraw balance documentation and adjusted test expectations
Transaction Verification & Authorization
fvm/transactionVerifier.go
Extended CheckAuthorization to accept chain parameter, introduced serviceAccountOverride logic filtering signatures to service account only when payer, proposer, and first authorizer all match service account, adjusted weight validation to bypass per-authorizer checks under override
Transaction Functional Tests
engine/access/rpc/backend/transactions/transactions_functional_test.go
Added error path tests for Execution Node (TestTransactionResultByIndex_ExecutionNode_Errors, TestTransactionsByBlockID_ExecutionNode_Errors, TestScheduledTransactionsByBlockID_ExecutionNode_Errors) with helpers setupExecutionGetEventsRequest and setupExecutionGetEventsRequestFailed
RPC Backend Transactions
engine/access/rpc/backend/transactions/provider/execution_node.go
Added TransactionsByBlockID and TransactionResultsByBlockID public methods on ENTransactionProvider for block-scoped transaction retrieval with error mapping (NotFound, Unavailable, Internal)
Memory & Version Management
fvm/meter/memory_meter.go, engine/common/version/version_control.go, model/access/systemcollection/system_collection.go
Updated DefaultMemoryWeights with increased iterator weights (ArrayIterator, DictionaryKeyIterator, StringIterator) and added compiler-related memory kinds; expanded defaultCompatibilityOverrides with versions 0.37.11, 0.42.3, 0.44.0/0.44.1/0.44.7/0.44.10/0.44.12; added Mainnet height-version mapping (0 → Version0, 133408444 → Version1)
Bootstrap & Ledger State
engine/execution/state/bootstrap/bootstrap_test.go, utils/unittest/execution_state.go
Updated expected state commitment hex values in bootstrap tests and genesis state commitment constants for changed ledger state
Test Utilities & Mocks
fvm/environment/contract_updater_test.go, fvm/environment/mock/contract_updater.go, fvm/environment/mock/contract_updater_stubs.go, fvm/environment/mock/environment.go, fvm/environment/mock/meter.go, utils/unittest/mocks/matchers.go, utils/unittest/fixtures.go
Added GetRestrictedAccounts and ComputationRemaining mock methods to stubs/mocks; introduced MatchLock helper for lock matching in tests; increased MachineAccountFixture initial balance from 0.5 to 5.0
Transaction & Account Management Tests
fvm/fvm_blockcontext_test.go, fvm/fvm_test.go, fvm/evm/evm_test.go
Added TestServiceAccountOverrides and TestAccountRestricting tests; expanded TestCadenceOwnedAccountFunctionalities with COA withdrawal scenarios (rounding, limits, balance validation); added Batch run evm gas overflow test
Module & Storage Updates
module/epochs/machine_account.go, module/epochs/machine_account_test.go, module/state_synchronization/indexer/indexer_core.go, module/state_synchronization/indexer/indexer_core_test.go
Refactored machine account balance validation to use recommended minimums instead of soft/hard split, removed SoftMinBalance fields, updated error messaging; treated storage.ErrAlreadyExists as no-op in indexing commits; updated test mock usage patterns
Transaction Invoker & Storage Limiter
fvm/transactionInvoker.go, fvm/transactionStorageLimiter.go
Added restrictedAccounts parameter propagation through transaction processing; integrated GetRestrictedAccounts retrieval and restriction enforcement (null when payer is service account); updated CheckStorageLimits signature to accept restrictedAccounts map
Infrastructure & Utilities
fvm/environment/transaction_info.go, state/protocol/datastore/validity.go, storage/light_transaction_results.go, model/access/systemcollection/system_collection_test.go
Refactored address conversion in NewTransactionInfo, fixed variadic argument forwarding in validateVersionBeacon, documented ErrAlreadyExists behavior in batch store, updated system collection height-version test boundaries
Dependency Updates
go.mod, insecure/go.mod, integration/go.mod
Updated multiple Go module dependencies including cadence (v1.8.3→v1.8.10), atree (v0.11.0→v0.12.0), OTel components (v1.37.0→v1.38.0), golang.org/x/* packages (crypto, sync, sys, text, tools, mod, net, term), cbor/v2, and bitset; added golang.org/x/telemetry as indirect

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly Related PRs

Suggested Reviewers

  • peterargue
  • vishalchangrani
  • illia-malachyn

Poem

🐰 A rabbit hops through restricted domains,
where accounts and computations dance,
EVM emulators and EOAs confined,
metering flows through every branch.
Build tools gleam with v2 shine—
such grand refactoring, sublime!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.27% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The PR title is vague and generic. It lacks specificity about the primary change and uses unclear notation ('AN compatibility') without explaining what was actually changed or why. Clarify the title to explicitly describe the main changes, such as 'Add account restriction and remediation features for v0.44.12 compatibility' or similar, making the primary purpose clear to reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@j1010001 j1010001 changed the base branch from leo/check-msg-sender to mpeter/disable-evm-state-mutation January 2, 2026 02:51
@j1010001 j1010001 closed this Jan 2, 2026
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.

2 participants