Skip to content

[Access] Add compatibility override for v0.44.7#8281

Merged
j1010001 merged 1 commit intov0.44from
jan/add-compatibility-update-v0.44.7
Dec 30, 2025
Merged

[Access] Add compatibility override for v0.44.7#8281
j1010001 merged 1 commit intov0.44from
jan/add-compatibility-update-v0.44.7

Conversation

@j1010001
Copy link
Member

@j1010001 j1010001 commented Dec 30, 2025

Summary by CodeRabbit

  • New Features

    • Account restriction system enabling transaction authorization control for specified accounts
    • Service account override support for enhanced authorization handling
    • EVM SetCode authorization support (EIP-7702) for contract interactions
    • Transaction retrieval methods by block ID
    • Improved withdrawal validation with minimum amount enforcement
  • Bug Fixes

    • Fixed gas overflow handling in EVM batch transactions
    • Corrected state commitment calculations in bootstrap process
    • Enhanced RPC error consistency and conversion
  • Chores

    • Updated dependencies: Cadence, Atree, OpenTelemetry, and Go toolchain modules
    • Expanded functional test coverage for error scenarios
    • Updated linting and tooling configurations

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

@j1010001 j1010001 requested a review from a team as a code owner December 30, 2025 19:08
@j1010001 j1010001 changed the base branch from master to v0.44 December 30, 2025 19:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces restricted account validation, adds transaction retrieval methods to execution node providers, extends metering with computation remaining tracking, refactors EVM balance handling, implements service account override authorization logic, and updates multiple dependencies across the codebase.

Changes

Cohort / File(s) Summary
Linter Configuration
.custom-gcl.yml, .github/workflows/ci.yml, .golangci.yml
Updated golangci-lint from v1.63.4 to v2.7.1, migrated CI workflow from action v6 to v9, and consolidated linter configuration to version 2 schema with new settings for gosec, structwrite, and gci import ordering.
Transaction Provider
engine/access/rpc/backend/transactions/provider/execution_node.go
Added three new public methods: TransactionsByBlockID, TransactionResultsByBlockID, and ScheduledTransactionsByBlockID to retrieve transactions and results by block; includes standardized RPC error handling and system collection integration.
Transaction Provider Tests
engine/access/rpc/backend/transactions/transactions_functional_test.go
Added comprehensive error-path tests for EN transaction retrieval; introduced helper methods for simulating EN event fetch behavior and error scenarios.
Restricted Accounts Feature
fvm/blueprints/contracts.go, fvm/environment/contract_updater*.go, fvm/environment/env.go, fvm/errors/codes.go, fvm/errors/execution.go
Added new public variable RestrictedAccountsPath, implemented GetRestrictedAccounts() method across environment and contract updater interfaces, and introduced ErrCodeAccountIsRestrictedError with corresponding error constructor.
Restricted Accounts in Transaction Processing
fvm/transactionInvoker.go, fvm/transactionStorageLimiter.go, fvm/transactionStorageLimiter_test.go
Extended transaction authorization and storage limit checks to fetch and validate restricted accounts; payer must not be restricted unless acting as service account; added early failure on restricted account detection.
Transaction Verification & Override Logic
fvm/transactionVerifier.go, fvm/fvm_blockcontext_test.go, fvm/fvm_test.go
Implemented service account override path in CheckAuthorization with relaxed weight checks; added chain context parameter; introduced TestServiceAccountOverrides and TestAccountRestricting test suites validating authorization relaxation and restriction enforcement.
Computation Remaining 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/testutils/backend.go
Added ComputationRemaining() method to Meter interface and implementations across multiple meter types; delegates to per-kind weight-based remaining computation calculation.
EVM Balance & Withdrawal Handling
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
Refactored value conversion helper, added AttoFlowBalanceIsValidForFlowVault validation, enforced minimum transferable unit (1e10 attoFlow); updated withdrawal tests with edge cases for rounding and overflow scenarios.
EVM SetCode Authorization & Gas Handling
fvm/evm/offchain/query/view.go, fvm/evm/offchain/query/view_test.go, fvm/evm/handler/handler.go, fvm/evm/handler/handler_test.go, fvm/evm/types/call.go
Added SetCodeAuthorizations field and method to DirectCall; extended DryCall signature to accept authorization list; replaced batch-wide gas accumulation with per-transaction remaining gas checks.
EVM Test Suite Expansion
fvm/evm/stdlib/contract.cdc, fvm/evm/stdlib/contract_test.go, fvm/evm/evm_test.go
Updated documentation for withdrawal minimum (1e10 attoFlow); expanded test coverage for gas overflow and COA withdrawal edge cases (rounding, truncation, balance validation).
Memory Weights & Compiler Tracking
fvm/meter/memory_meter.go
Extended ExecutionMemoryWeights with compiler-related memory kinds (Compiler, CompilerLocal, CompilerFunction, etc.) and adjusted existing weights for bound functions and iterators.
Version Compatibility & System Collection
engine/common/version/version_control.go, model/access/systemcollection/system_collection.go, model/access/systemcollection/system_collection_test.go
Added compatibility overrides for versions 0.37.11–0.44.7; introduced Mainnet-specific version boundary at height 133408444 for system collection versioning.
Bootstrap & State Management
engine/execution/state/bootstrap/bootstrap_test.go, utils/unittest/execution_state.go
Updated expected state commitment values in bootstrap tests; refreshed genesis state commitment constants.
Machine Account Configuration
module/epochs/machine_account.go, module/epochs/machine_account_test.go
Removed soft balance fields (SoftMinBalanceLN/SN) from MachineAccountValidatorConfig; replaced with unified recommended minimum constants; updated balance checks to use explicit refill targets.
State Synchronization Indexing
module/state_synchronization/indexer/indexer_core.go, module/state_synchronization/indexer/indexer_core_test.go
Added ErrAlreadyExists handling in protocol DB commit; treats reindexing existing blocks as no-op; updated mock utilities and added reindexing test scenario.
Mock & Test Utilities
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
Extended mocks with GetRestrictedAccounts and ComputationRemaining methods; introduced MatchLock matcher utility for lock-aware test assertions.
Miscellaneous Updates
fvm/environment/transaction_info.go, module/trace/constants.go, state/protocol/datastore/validity.go, storage/light_transaction_results.go, utils/unittest/fixtures.go
Simplified address conversion in transaction info; added FVMEnvGetRestrictedAccounts span constant; fixed variadic argument forwarding in error builder; updated machine account fixture balance; improved documentation.
Dependency Updates
go.mod, insecure/go.mod, integration/go.mod
Updated cadence v1.8.3→v1.8.10, atree v0.11.0→v0.12.0, OpenTelemetry v1.37.0→v1.38.0, and Go x/* modules (crypto, sync, sys, text, tools, mod, net, term); added x/telemetry as indirect dependency.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • #8240: Adds REST endpoints and transaction proxy conversions that invoke the new ENTransactionProvider.TransactionsByBlockID and TransactionResultsByBlockID methods introduced in this PR.

Poem

🐰 With bounded funds and accounts restricted now,
Transactions flow where service accounts allow,
Meters measure what remains to spend,
While EVM balances rightly comprehend—
A hop, skip, and jump through better FVM!

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0a94e9 and a6e883e.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • insecure/go.sum is excluded by !**/*.sum
  • integration/go.sum is excluded by !**/*.sum
📒 Files selected for processing (61)
  • .custom-gcl.yml
  • .github/workflows/ci.yml
  • .golangci.yml
  • cmd/util/ledger/util/nop_meter.go
  • engine/access/rpc/backend/transactions/provider/execution_node.go
  • engine/access/rpc/backend/transactions/transactions_functional_test.go
  • engine/common/version/version_control.go
  • engine/execution/state/bootstrap/bootstrap_test.go
  • fvm/blueprints/contracts.go
  • fvm/environment/contract_updater.go
  • fvm/environment/contract_updater_test.go
  • fvm/environment/env.go
  • fvm/environment/meter.go
  • fvm/environment/mock/contract_updater.go
  • fvm/environment/mock/contract_updater_stubs.go
  • fvm/environment/mock/environment.go
  • fvm/environment/mock/meter.go
  • fvm/environment/transaction_info.go
  • fvm/errors/codes.go
  • fvm/errors/execution.go
  • fvm/evm/backends/wrappedEnv.go
  • fvm/evm/emulator/emulator.go
  • fvm/evm/emulator/emulator_test.go
  • fvm/evm/emulator/state/collection.go
  • fvm/evm/evm_test.go
  • fvm/evm/handler/handler.go
  • fvm/evm/handler/handler_test.go
  • fvm/evm/impl/impl.go
  • fvm/evm/offchain/query/view.go
  • fvm/evm/offchain/query/view_test.go
  • fvm/evm/stdlib/contract.cdc
  • fvm/evm/stdlib/contract_test.go
  • fvm/evm/testutils/backend.go
  • fvm/evm/types/balance.go
  • fvm/evm/types/call.go
  • fvm/evm/types/errors.go
  • fvm/fvm_blockcontext_test.go
  • fvm/fvm_test.go
  • fvm/meter/computation_meter.go
  • fvm/meter/memory_meter.go
  • fvm/storage/state/execution_state.go
  • fvm/storage/state/transaction_state.go
  • fvm/transactionInvoker.go
  • fvm/transactionStorageLimiter.go
  • fvm/transactionStorageLimiter_test.go
  • fvm/transactionVerifier.go
  • go.mod
  • insecure/go.mod
  • integration/go.mod
  • model/access/systemcollection/system_collection.go
  • model/access/systemcollection/system_collection_test.go
  • 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
  • module/trace/constants.go
  • state/protocol/datastore/validity.go
  • storage/light_transaction_results.go
  • utils/unittest/execution_state.go
  • utils/unittest/fixtures.go
  • utils/unittest/mocks/matchers.go

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.

3 participants