Skip to content

Conversation

@j1010001
Copy link
Member

@j1010001 j1010001 commented Jan 1, 2026

adding AN compatibility on top of: #8272, comit: aaefd3d

@j1010001 j1010001 requested a review from a team as a code owner January 1, 2026 22:52
@j1010001 j1010001 changed the base branch from master to mpeter/disable-evm-state-mutation January 1, 2026 22:53
@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This PR introduces account restriction enforcement, extends meters and environments with computation tracking, adds transaction provider methods for block-based retrieval, enhances EVM with withdrawal validations and authorization handling, and updates dependencies and configuration. Multiple interface methods are added across FVM, storage, and environment layers, along with corresponding implementations and test coverage.

Changes

Cohort / File(s) Change Summary
Configuration & Build Tools
.custom-gcl.yml, .github/workflows/ci.yml, .golangci.yml
Updated golangci-lint from v1.63.4 to v2.7.1; migrated workflow actions from v6 to v9; restructured golangci configuration schema with versioning, linter-specific settings, exclusions, and formatters sections.
Account Restriction System
fvm/blueprints/contracts.go, fvm/errors/codes.go, fvm/errors/execution.go, fvm/environment/contract_updater*.go, fvm/environment/env.go, fvm/environment/mock/* (contract_updater*.go, environment.go), fvm/transactionInvoker.go, fvm/transactionStorageLimiter*.go, fvm/evm/emulator/emulator*.go, fvm/fvm_test.go
Added RestrictedAccountsPath constant; introduced ErrCodeAccountIsRestrictedError and NewAccountRestrictedError; added GetRestrictedAccounts() method to ContractUpdater, ContractUpdaterStubs, and Environment interfaces; implemented restriction checks in transaction invoker and storage limiter; added enforcement in EVM emulator for restricted EOAs.
ComputationRemaining Interface Chain
cmd/util/ledger/util/nop_meter.go, fvm/environment/meter.go, fvm/environment/mock/meter.go, fvm/storage/state/transaction_state.go, fvm/storage/state/execution_state.go, fvm/meter/computation_meter.go, fvm/evm/backends/wrappedEnv.go, fvm/evm/testutils/backend.go
Added ComputationRemaining(kind common.ComputationKind) uint64 method across meter and environment interfaces; implemented in multiple layers with delegation patterns and math.MaxUint64 fallbacks.
Transaction Provider & Event Handling
engine/access/rpc/backend/transactions/provider/execution_node.go, engine/access/rpc/backend/transactions/transactions_functional_test.go
Added TransactionsByBlockID, TransactionResultsByBlockID, and ScheduledTransactionsByBlockID methods to ENTransactionProvider; replaced error construction with rpc.ConvertError; added test cases for EN error paths with new helper methods setupExecutionGetEventsRequest and setupExecutionGetEventsRequestFailed.
EVM Withdrawal & Balance Validations
fvm/evm/emulator/emulator.go, fvm/evm/emulator/emulator_test.go, fvm/evm/emulator/state/collection.go, fvm/evm/impl/impl.go, fvm/evm/types/balance.go, fvm/evm/types/errors.go, fvm/evm/types/call.go
Replaced convertAndCheckValue with checkAndConvertValue; added AttoFlowBalanceIsValidForFlowVault validation; updated ErrWithdrawBalanceRounding message; added SetCodeAuthorizations field and method to DirectCall; updated MaxInlineSize parameter type in ByteStringValue.Storable from uint64 to uint32; expanded withdrawal tests with boundary and edge-case scenarios.
EVM Handler & Offchain Query
fvm/evm/handler/handler.go, fvm/evm/handler/handler_test.go, fvm/evm/offchain/query/view.go, fvm/evm/offchain/query/view_test.go
Changed batchRun to use per-transaction gas check via ComputationRemaining instead of accumulation; added authList parameter to View.DryCall method; updated handler test expectations for deposit/withdraw amounts to OneFlow().
EVM Contract & Stdlib
fvm/evm/stdlib/contract.cdc, fvm/evm/stdlib/contract_test.go
Added reclaimFundsFromAttackerEOAs function to EVM contract and CadenceOwnedAccount; updated documentation reference from inAttoFlow to inAttoFLOW; adjusted test assertion for withdrawal balance.
Transaction Verification & Invocation
fvm/transactionVerifier.go, fvm/transactionInvoker.go
Added chain parameter to CheckAuthorization and verifyTransaction; introduced serviceAccountOverride condition for signature verification flow; extended calls to CheckPayerBalanceAndReturnMaxFees and CheckStorageLimits with restrictedAccounts parameter.
Memory Meter & Computation Costs
fvm/meter/memory_meter.go
Reweighted memory kinds: BoundFunctionVMValue (17→57), ArrayIterator (9→49), DictionaryKeyIterator (9→17), StringIterator (9→17); removed and added compiler-related memory kinds with explicit weights.
Bootstrap & Execution State
engine/execution/state/bootstrap/bootstrap_test.go, fvm/storage/state/execution_state.go
Updated state commitment hex values in bootstrap tests; added ComputationRemaining implementation with meter delegation and math.MaxUint64 fallback.
Version Management & System Collection
engine/common/version/version_control.go, model/access/systemcollection/system_collection*.go
Added "0.37.11" and "0.42.3" to defaultCompatibilityOverrides; introduced Mainnet height-version mappings (133408444→Version1); updated testnet version boundary from 288677777 to 290050888.
State Synchronization & Indexing
module/state_synchronization/indexer/indexer_core*.go
Updated comment about reindexing race condition; added ErrAlreadyExists handling in protocol and block data commit paths for idempotent reindexing.
Machine Account & Balance Handling
module/epochs/machine_account*.go
Replaced soft/hard balance threshold model with unified limits; introduced cdcRecommendedMinBalance* and recommendedRefillToBalance* constants; removed SoftMinBalance fields; updated validation and error messaging.
Test Fixtures & Utilities
utils/unittest/execution_state.go, utils/unittest/fixtures.go, utils/unittest/mocks/matchers.go, fvm/fvm_blockcontext_test.go, fvm/evm/evm_test.go
Updated genesis state commitment hex values; changed MachineAccountFixture balance from 0.5 to 5.0; added MatchLock function for test locking assertions; added TestServiceAccountOverrides and TestAccountRestricting; expanded EVM test scenarios for overflow and COA withdrawals.
Dependency & Module Updates
go.mod, insecure/go.mod, integration/go.mod
Updated multiple dependencies: onflow/cadence (v1.8.3→v1.8.10), onflow/atree (v0.11.0→v0.12.0), fxamacker/cbor/v2, golang.org/x cryptographic and utility modules, OpenTelemetry components to v1.38.0, and added golang.org/x/telemetry.
Error Handling & Utilities
state/protocol/datastore/validity.go, storage/light_transaction_results.go, module/trace/constants.go
Fixed variadic argument forwarding in validateVersionBeacon; updated light transaction result documentation; added FVMEnvGetRestrictedAccounts span constant.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • peterargue
  • vishalchangrani
  • illia-malachyn

Poem

🐰 A hop through restrictions and meters so keen,
Where accounts are checked and limits are seen,
Transactions now gather by blocks they belong,
EVM withdrawals sung loud and strong,
With computation we track every bound—
A flow-full of features, quite safe and quite sound!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% 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 'add AN compatibility for v0.44.11' is overly vague and generic. It uses non-descriptive terms that don't clearly convey what 'AN compatibility' means or what substantive changes are being made. Consider a more specific title that explains the actual changes, such as 'Add version beacon compatibility overrides for v0.44.11' or a title describing the primary functional changes (account restrictions, transaction validation, etc.).
✅ 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.

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