# Changelog ## [unreleased] ### Protocol Changes ### Non-protocol Changes * Raised the minimum supported Rust version to 1.100.0. Building `nearcore` from source now requires a Rust 1.100.0 toolchain. ## [2.15.0] ### Protocol Changes * External contract calls ([NEP-667](https://github.com/near/NEPs/pull/667)): a new kind of transaction with no signer, key or nonce, which the called contract authorizes in its reserved method `__external_call` and pays for from its own balance. A refused call is rolled back and nobody pays, and its outcome keeps the error and the run's logs. * A call may carry a universal account's state init, installed before the run when the account is not initialized yet and ignored otherwise. * Limits: 20 Tgas, 20 KiB of size and 50 KiB of recorded state per call; per chunk, at most 100 calls, one per contract, and shares of the chunk's compute, storage proof and transaction bytes. New errors: `ContractNotFound`, `ExternalCallChunkShareReached`, `ProhibitedInExternalCall`, `DepositInExternalCall`, `RecordedStorageExceeded` and `ReservedMethodName`. * In the run, `predecessor_account_id`, `prepaid_gas`, `random_seed`, `signer_account_pk`, `promise_yield_create` and `promise_yield_create_with_id` fail. In the receipts an accepted call starts, `signer_account_pk` fails and gas refunds go to the contract. * Clients send a call through `send_tx` in the field `external_call_base64` and look it up through `tx` by the copy's unique id. Transaction views carry `kind`, `"signed"` or `"external_call"`; action receipt views carry `authorization_context`, beside `signer_public_key` for a receipt a signed transaction started; an accepted call's state changes carry the cause `ExternalCallProcessing`. The indexer streams external calls with their outcomes. A view call of `__external_call` runs the call as the chunk producer would and returns its value and logs, or why the contract refuses it. * A new access key starts at nonce `h * 1e6 - 1`, where `h` is the height of the block that creates it, instead of `(h - 1) * 1e6`. This applies to keys added with `AddKey`, gas key nonces, NEAR implicit account keys and the universal account bootstrap nonce. A transaction or delegate action executed at or before the creation height is not valid for the new key, so a transaction that deletes and re-adds its own key cannot execute again with the same hash. Clients that read the key nonce and add 1 are not affected; clients that compute the nonce from the creation height must use the new value. * A `FunctionCall` to an account whose contract is a global contract that was never deployed on the chain now fails with `CodeDoesNotExist`, the same error as calling an account with no contract, on chunk producers and chunk validators alike. Only ETH implicit (`0x`) accounts can reach this state: they are created with a hardcoded wallet contract hash and no existence check, so on a chain whose wallet contract has not been deployed the first such call stalled the shard (the producer's apply job panicked in builds with debug assertions, and chunk validators rejected the state witness with `MissingTrieValue`). When the code is missing the runtime now looks up the global contract key, so the proof of absence is part of the state witness and validators reach the same outcome. Behavior is unchanged whenever the contract exists. * Limit the number of allowed globals per WASM contract to 65,536. [#16422](https://github.com/near/nearcore/pull/16422) * Fixed a bandwidth request over-reservation for shards that were not split in the most recent resharding. Such shards requested roughly double the bandwidth they needed, and the scheduler reserved sender bandwidth for receipts that did not exist. ([#16432](https://github.com/near/nearcore/pull/16432)) * Stabilized early contract-loading gas charging. A `FunctionCall` now charges `contract_loading_base` before resolving and loading contract code, then charges `contract_loading_bytes` before compilation. Calls that cannot afford loading abort before the work is performed, and calls to a missing contract burn the base cost. No gas cost changes for successful calls. [#16632](https://github.com/near/nearcore/pull/16632) * Raised `per_receipt_storage_proof_size_limit` from 4,000,000 to 4,500,000 bytes. Reading, writing or removing a key records the whole value in the storage proof. With a 4 MB limit, a receipt can't touch a value of `max_length_storage_value` (4 MiB) and its trie path within the budget. 4.5 MB leaves room for both. The worst-case state witness grows by 0.5 MB. ([#16704](https://github.com/near/nearcore/pull/16704)) * Action receipts now record the protocol version they were created at, and the runtime charges and refunds their static fees (the receipt fee, the execution fees of their actions and the send fees a meta transaction forwards) with the fees of that version, also when they execute after a fee change. Previously the refund was computed with the current fees, so a receipt created before a fee increase and executed after it could be refunded gas it never purchased. Receipts created before this upgrade don't record a version and are priced with the current fees, as before. New action receipts use the new `ReceiptEnum::ActionV3` and `ReceiptEnum::PromiseYieldV3` variants, which carry `creation_protocol_version`; tools that decode receipts from Borsh should expect them. The RPC view of such a receipt has two new optional fields, `authorization_context` and `creation_protocol_version`; the view of an older receipt is unchanged. ([#16758](https://github.com/near/nearcore/pull/16758), [#16847](https://github.com/near/nearcore/pull/16847)) * Host functions `bls12381_p1_sum`, `bls12381_p2_sum`, `bls12381_g1_multiexp`, `bls12381_g2_multiexp`, `bls12381_map_fp_to_g1`, `bls12381_map_fp2_to_g2`, `bls12381_p1_decompress`, `bls12381_p2_decompress`, `promise_yield_resume` and `promise_yield_resume_with_yield_id` now accept input from a register (`len == u64::MAX`). Before, they charged gas for `u64::MAX` input bytes before they read the register and failed with `IntegerOverflow`. They now charge from the length of the input they read, as all other host functions do. Gas costs for memory input do not change, except that a call that fails while it reads its inputs (for example, an out-of-bounds memory input) no longer pays the per-element or per-byte cost. * Host functions `bls12381_p1_sum`, `bls12381_p2_sum`, `bls12381_p1_decompress` and `bls12381_p2_decompress` now accept the points `(0, ±2)`, which are on the curve but outside the subgroup. Before, they returned an error for these points, which NEP-488 requires them to accept. ([#14550](https://github.com/near/nearcore/pull/14550)) * Capped the number of gas key nonces one receipt may add or remove at 1_024, which is `MAX_NONCES_FOR_GAS_KEY`, the most one gas key can have. Nonces added by `AddKey` actions are counted across the receipt and into nested delegate actions, and a new receipt over the limit is rejected at action validation with the new `ActionsValidationError::TotalNumberOfGasKeyNoncesAddedExceeded` error. Nonces removed by `DeleteKey` and `DeleteAccount` actions are counted when the receipt runs, and a receipt that removes more fails with the new `ActionErrorKind::TotalNumberOfGasKeyNoncesRemovedExceeded` error, with all of its changes reverted. Deleting several gas keys that have many nonces now takes one receipt per key. Clients that decode `ActionsValidationError` or `ActionErrorKind` should expect the new variants. * A `DeleteKey` of a gas key now reads each of the key's nonces before removing it, so the per-receipt and per-chunk storage proof limits count the trie nodes of the removed nonces. Before, those nodes were recorded only when the chunk's state changes were finalized, after the limits were checked. A receipt that deletes a gas key can now fail with `ActionErrorKind::ReceiptStorageProofSizeExceeded`, and a chunk can stop taking receipts sooner. * A chunk now skips a transaction whose signer, or for an external contract call whose contract, is in another shard. The skipped transaction gets no execution outcome. Before, it failed with `InvalidSignerId` or `SignerDoesNotExist`. * Blocks whose body carries a non-empty deprecated `challenges` field are now invalid. Honest block producers always leave it empty. Before, the field was decoded and hashed but never checked, so a block producer could fill it with content that releases decode differently, and nodes on different releases would disagree on the block's validity. ([#16808](https://github.com/near/nearcore/pull/16808)) ### Non-protocol Changes * The `ExternalCallTransactions` database column, which maps an external call's unique id and block to the call's hash, raises `DB_VERSION` from 52 to 53. A node migrates on startup by creating the column; no data is rewritten. ([#16791](https://github.com/near/nearcore/pull/16791)) * Two node settings for external contract calls: `ecc_pool_size_share`, the share of `transaction_pool_size_limit` external calls may fill (1/10 by default), and `ecc_time_share`, the share of `produce_chunk_add_transactions_time_limit` they may take (1/2 by default). Zero keeps them out of the pool or out of chunks. * A node no longer takes its Tier 3 state sync address, which it puts in its state requests and snapshot host advertisements, from whichever peer reports it first. Each Tier 2 peer reports the IP at which it sees the node, and the node uses the IP reported from the most network groups of peers (/16 for IPv4, /32 for IPv6), together with its own listen port. The address is re-evaluated as peers connect and disconnect, and the `near_tier3_public_addr` metric follows it. The new `near_tier3_public_addr_groups` and `near_tier3_public_addr_runner_up_groups` metrics show how many network groups report the chosen IP and the runner-up. Loopback, private, link-local, carrier-grade NAT and unique local IPs are ignored unless `network.allow_private_ip_in_public_addrs` is set, so a node whose peers reach it only over a private network needs that option or `network.experimental.tier3_public_addr`. Reported IPs in the other address family than the listen address are ignored too, unless the node listens on `[::]`. * Removed the deprecated `AnnounceAccount` mechanism. Validators no longer broadcast `AnnounceAccount`s, and the `accounts` field is removed from the `SyncRoutingTable` network message; messages from older nodes that still set it are accepted and the field is ignored. Routing to a validator now relies only on the `AccountData` it broadcasts, which covers every validator of the current and next epoch. The `known_producers` field of the `network_info` RPC is now built from `AccountData`. The `AccountAnnouncements` database column is no longer used, and a migration that raises `DB_VERSION` from 51 to 52 deletes its rows on startup. The rows were a cache that older releases rebuild, so a node can roll back to a release at version 51 after running `neard database set-version --version 51`. `neard ping` now pings only the node it connects to, and its `--account-filter-file` option is removed. The `near_account_announcement_dropped` metric is removed, and `near_account_to_peer_lookups` no longer has a `source` label. **Config change:** `network.ttl_account_id_router` and `network.experimental.network_config_overrides.routing_graph_max_accounts_per_message` are removed, and `ttl_account_id_router` is no longer part of the `client_config` RPC response. A `config.json` that still sets either field keeps loading; the field is ignored with a warning. * Removed the obsolete top-level `neard state-parts` testing tool and the direct Tier 2 state header/part requests that only it sent. Node-to-node state sync and `neard view-state state-parts` are unaffected. **Breaking config change:** `network.experimental.network_config_overrides.received_messages_rate_limits.rate_limits` no longer accepts the `StateRequestHeader`, `StateRequestPart` and `StateResponse` keys; a node whose `config.json` still lists any of them will fail to start. Remove those entries before upgrading. ([#16482](https://github.com/near/nearcore/pull/16482)) * Fixed the cold store loop on archival nodes stalling or stopping after the RocksDB 10 upgrade: RocksDB's default compaction-debt write stall thresholds (64 GiB soft / 256 GiB hard) were exceeded while the engine reshaped the multi-TB cold `State` column, and 30-day TTL compactions rewrote gigabytes of cold data to relocate megabytes. The cold store now disables TTL/periodic compactions and uses new `cold_store.rocksdb` defaults: `soft_pending_compaction_bytes_limit` 512 GiB, `hard_pending_compaction_bytes_limit` 2 TiB, `compaction_readahead_size` 32 MiB (a DB-level option; the previous per-tier `compaction_readahead_size` under `cf_*_load_overrides` never had any effect and is removed) and `use_direct_io_for_flush_and_compaction` enabled. All four are new optional `rocksdb` config fields for both `store` and `cold_store`; the hot store keeps RocksDB's defaults unless set. Direct I/O requires a filesystem with `O_DIRECT` support (ext4, xfs): if the cold store fails to open with "Direct I/O is not supported", set `cold_store.rocksdb.use_direct_io_for_flush_and_compaction` to `false`. After the first restart on this version each archival node drains its accumulated compaction backlog, throttled but no longer stopped. ([#16502](https://github.com/near/nearcore/pull/16502)) * Added the opt-in `EXPERIMENTAL_indexer_block` RPC to fetch indexer messages by block hash. Enable it with `rpc.enable_indexer_rpc`; `rpc.indexer_max_concurrent_requests` controls request concurrency. * Added an experimental `enable_compiler_daemon` node setting for compiling Wasmtime contracts in isolated, memory-limited subprocesses. It is disabled by default. On Linux, enabling it requires Landlock support and causes startup to fail if the sandbox cannot be activated. ([#16067](https://github.com/near/nearcore/pull/16067)) * View queries on a funded but uninitialized universal (`0u`) account now fail with the new `UNINITIALIZED_ACCOUNT` error. This covers `call_function`, `view_code`, `view_state`, `view_access_key`, `view_access_key_list` and `view_gas_key_nonces`, which used to answer as if the account had no contract, keys or data. `view_account` is unchanged and still reports `state: "uninitialized"`. * `call_function` queries (`query` and `EXPERIMENTAL_call_function`) take an optional `state_init` for a deterministic or universal account: `{"universal": ""}` or `{"deterministic": {"code": ..., "data": {...}}}`. Unless the account already has its state, the call runs as if `state_init` were installed; otherwise `state_init` is only validated. An invalid `state_init` fails with the new `INVALID_STATE_INIT` error, and one whose global contract is missing with `NO_GLOBAL_CONTRACT_CODE`. * When a transaction or receipt has execution outcomes in several blocks, the node now returns the one that changed state, or the earliest one if none did. Before, it returned the first one in block hash order. ## [2.14.0] ### Protocol Changes * Remove gas rewards: executing a `FunctionCall` no longer pays part of the burned gas back to the contract account as a reward. The `burnt_gas_reward` parameter is changed from 30% (3/10) to 0%. See [HSP-027](https://gov.near.org/t/hsp-027-remove-the-near-developer-gas-rebate/42213) * Added an `ml_dsa_verify` host function so contracts can verify FIPS 204 ML-DSA-65 signatures on-chain. It takes the signature (3309 bytes), an arbitrary-length message, and the raw 1952-byte public key, each passed either from memory or from a register, and returns 1 for a valid signature or 0 for an invalid one; a wrongly-sized signature or public key aborts the call with `MlDsaVerifyInvalidInput`. The message is verified as-is with an empty context string, so callers must not pre-hash it. It costs a fixed base cost of 540 Ggas and a dynamic per-byte cost of 11 Mgas per byte. * The per-receipt storage proof limit now applies to every action in a receipt, not just `FunctionCall`. The recorded proof is checked after each action, and a receipt that goes over `per_receipt_storage_proof_size_limit` (4 MB) fails at that action with the new `ReceiptStorageProofSizeExceeded` error; the actions after it do not run. Clients that decode `ActionErrorKind` should expect the new variant. ([#16171](https://github.com/near/nearcore/pull/16171)) * Removed the `DelegateV2` meta-transaction action introduced in 2.13.0. A new transaction or receipt carrying it is now rejected at action validation with the new `ActionsValidationError::RemovedProtocolFeature` error. Its inner nonce advances a gas key of the delegate sender, which the SPICE pending transaction queue does not track, because that queue reads only the outer transaction's signer, public key and nonce index. Gas keys ([NEP-611](https://github.com/near/NEPs/pull/611)) therefore can no longer sign meta transactions at all, since the older `Delegate` action already rejects a gas key signer with `DelegateActionRequiresNonGasKey`. Receipts created before the upgrade keep executing, so meta transactions already in flight across the upgrade boundary still complete. The `Action::DelegateV2` and `VersionedDelegateActionPayload` types stay in the codebase to hold a place for a future delegate action version. Clients that decode `ActionsValidationError` should expect the new variant. * Early chunk producer reassignment. A chunk producer that stops producing used to keep its chunk slots until the end of the epoch, because the kickout set only applies at an epoch boundary. The protocol now tracks per-shard production stats within the epoch and stops assigning new chunks to a producer on a shard once it has missed at least 100 chunks there and its produced-to-expected ratio on that shard has fallen below 80%. The freed slot goes to a healthy producer. Stats never cross an epoch boundary, and a 1000-block grace window at the start of each epoch delays the first possible exclusion to roughly block 1000 of the epoch. A safety valve keeps the least-bad producer eligible when the rule would exclude every distinct producer on a shard, so a shard can never run out of chunk producers. The resulting assignment is precomputed per block and persisted in the `ChunkProducers` database column, keyed by the chunk's grandparent block, and chunk validation reads that row verbatim instead of re-sampling. Partial state witness, contract-accesses and contract-deploys network messages switch to their V2 wire variants at the same protocol version, since they now carry the grandparent anchor needed to resolve the producer. See [Early chunk producer reassignment](https://github.com/near/nearcore/blob/master/docs/ChainSpec/EpochAndStaking/EpochManager.md#early-chunk-producer-reassignment). * Rejected a `WithdrawFromGasKey` action nested inside a delegate action, with the new `ActionsValidationError::WithdrawFromGasKeyNotAllowedInDelegate` error. `WithdrawFromGasKey` stays valid as a top-level action; only the nesting is refused. The SPICE pending transaction queue scans only a transaction's top-level actions for `WithdrawFromGasKey`, so a nested one drains a gas key that the queue still counts as funded. Receipts created before the upgrade keep executing, so delegate actions already in flight across the upgrade boundary still complete. Clients that decode `ActionsValidationError` should expect the new variant. * A `FunctionCall` to a contract whose compiled module fails to load now charges the contract-loading fee and aborts, instead of finalizing as a zero-gas no-op. The fee is `contract_loading_base` plus `contract_loading_bytes` per byte of contract code, and it is burned even though the call runs no contract code. The call failed before this change too, so the only difference is that the caller now pays for the loading work. ([#15923](https://github.com/near/nearcore/pull/15923), [#16315](https://github.com/near/nearcore/pull/16315)) * Fixed a `FunctionCall` to a just-distributed global contract failing when the call runs in the same chunk as the distribution receipt and the compiled contract is not in the node's contract cache. The distribution now records the code with the chunk's contract tracker, as a regular `DeployContract` already does, so the call finds the code instead of failing with `CodeDoesNotExist`. ([#16371](https://github.com/near/nearcore/pull/16371)) * Fixed two ML-DSA-65 cost-charging issues, both of which are no-ops for the classical signature schemes where the relevant quantities coincide. Gas keys now price the exec (storage) fee on the on-trie identifier length (32-byte key hash for ML-DSA-65) and the send (transmission) fee on the wire length, instead of pricing the exec fee on the wire length. Meta transactions now meter the inner `DelegateAction` signature verification compute on the receiver shard that actually runs the verification, instead of the signer shard, so it counts against the right shard's compute limit. ([#16064](https://github.com/near/nearcore/pull/16064)) * Added the `sha3_256`, `sha3_384` and `sha3_512` host functions so contracts can compute FIPS-202 SHA-3 digests. Each takes the input either from memory or from a register and writes the digest (32, 48 or 64 bytes respectively) into a register. `sha3_256` costs a base of ~5.88 Ggas plus ~21.5 Mgas per input byte; `sha3_384` and `sha3_512` cost a base of ~5.81 Ggas plus ~36.6 Mgas per input byte. ([#16006](https://github.com/near/nearcore/pull/16006), [#16029](https://github.com/near/nearcore/pull/16029)) * Limited the total number of WASM locals in a contract to at most one local per two bytes of contract code. This size-dependent limit applies alongside the existing absolute limit of 1,000,000 locals per contract. [#16348](https://github.com/near/nearcore/pull/16348) * Stabilized universal accounts: a `0u` account scheme that unifies implicit and contract-created (deterministic) account creation under one post-quantum-safe derivation. See [#16096](https://github.com/near/nearcore/issues/16096) for the full set of changes. * A `FunctionCall` action with an empty `method_name` is now rejected at action validation with the new `ActionsValidationError::FunctionCallEmptyMethodName` error, so the transaction is refused before it is admitted. Previously such a transaction was admitted and failed on-chain in the VM with `MethodResolveError::MethodEmptyName`, still burning gas. Clients that decode `ActionsValidationError` should expect the new variant. ([#16089](https://github.com/near/nearcore/pull/16089)) * Capped the total number of storage entries carried by the state-init actions in one receipt at 1_500, counted across the receipt and into nested delegate actions. A receipt over the limit is rejected at action validation with the new `ActionsValidationError::TotalNumberOfStateInitEntriesExceeded` error. ([#16408](https://github.com/near/nearcore/pull/16408)) ### Non-protocol Changes * The `ChunkProducers` database column is now created by every build rather than only by nightly builds, which raises `DB_VERSION` from 49 to 50. A node started read-write migrates its hot and cold databases in place on startup; the migration only creates the column family and rewrites no data. A read-only process cannot create a column family, so a node opened read-only against a version-49 database will refuse to start. Start the node read-write once before pointing a read-only process at the data directory. ([#16301](https://github.com/near/nearcore/pull/16301)) * State sync now verifies reconstructed shard data against the next new chunk before block sync. A mismatch stops the node and preserves the data directory for diagnosis instead of attributing the failure to the chunk producer. ([#15994](https://github.com/near/nearcore/issues/15994)) * Removed the option to disable state snapshots. Nodes now always take a state snapshot every epoch, which is what lets them serve state parts to peers over decentralized state sync and is required by cloud archival. **Config change:** the `store.state_snapshot_config` field is gone, along with its `state_snapshot_type` values `Enabled`/`Disabled` and the legacy aliases `EveryEpoch`/`ForReshardingOnly`. A `config.json` that still contains `store.state_snapshot_config` keeps loading (the field is ignored), but a node that previously set it to `Disabled` (or `ForReshardingOnly`) will now take snapshots every epoch. Offline tools such as `fork-network` continue to run without snapshots. * Removed the long-deprecated `num_block_producer_seats_per_shard`, `avg_hidden_validator_seats_per_shard`, and `num_chunk_only_producer_seats` fields from `EpochConfig`. They were given serde defaults in 2.12 and are unused. Existing epoch-config JSON files that still contain these keys keep loading, as the keys are now ignored. ([#15481](https://github.com/near/nearcore/issues/15481)) * Removed centralized (external-storage) state sync. Nodes now always sync state from peers, which has been the default for a long time. **Breaking config change:** `state_sync.sync` no longer accepts `ExternalStorage`; a node whose `config.json` still sets `"state_sync": {"sync": {"ExternalStorage": ... }}` will fail to start. Remove the `state_sync.sync` block (peer-based sync is the default) before upgrading. The deprecated `--state-sync-bucket` flag and the `state-parts-dump-check` tool are also removed. Dumping state to external storage (`state_sync.dump`) is unchanged. * Added optional pagination to `EXPERIMENTAL_view_access_key_list` and the `view_access_key_list` query. The request takes `after_key` and `limit`, and the response returns `last_key` to fetch the following page. A new node-config knob `view_access_keys_limit` (default 100) bounds the number of keys returned per response; when unset (`null`) it falls back to the default of 100. **Behavioral change:** an *unpaginated* `view_access_key_list` request (no `limit`/`after_key`) now fails for any account holding more than `view_access_keys_limit` (default 100) access keys; such callers must switch to paginated requests. A paginated request whose `limit` exceeds the configured bound is clamped down to it rather than rejected. Operators can raise or lower the bound via `view_access_keys_limit`. * Transaction-status timeouts (`tx`, `EXPERIMENTAL_tx_status`, and `send_tx`/`broadcast_tx_commit` with `wait_until`) now carry a `cause` in the `TIMEOUT_ERROR`'s `info` payload explaining how far the transaction got: `NOT_OBSERVED`, `PENDING` (with the last-known status), `DOES_NOT_TRACK_SHARD`, or `ERROR` (with `debug_info`). The `info` payload is absent on responses from older nodes, so clients should treat it as optional. Previously the timeout gave no detail. * `view_access_key` queries now report a missing *account* rather than a missing *key* when the queried account does not exist, so callers such as NEP-641 off-chain resolvers no longer need a second `view_account` request to tell a not-yet-created implicit account apart from a deleted key. `EXPERIMENTAL_view_access_key` returns the structured `UNKNOWN_ACCOUNT` error instead of `UNKNOWN_ACCESS_KEY`. The `query` method with `request_type: view_access_key` returns the structured `UNKNOWN_ACCOUNT` error for a missing account instead of its backward-compatible flat response (`{"error": ..., "logs": [], "block_height": ..., "block_hash": ...}`); the flat shape is kept for an account that exists but does not hold the key. Clients recognize the flat shape by matching its message text, so a new message there would have been read as a contract execution error, while the structured error deserializes into the `UnknownAccount` variant those clients already carry. `view_access_key_list` (both the `query` request type and `EXPERIMENTAL_view_access_key_list`) likewise now returns `UNKNOWN_ACCOUNT` for an account that does not exist, instead of an empty key list; an empty list now unambiguously means the account exists and holds no access keys. `view_gas_key_nonces` (both the `query` request type and `EXPERIMENTAL_view_gas_key_nonces`) returns `UNKNOWN_ACCOUNT` instead of `UNKNOWN_GAS_KEY` for an account that does not exist. ([#16185](https://github.com/near/nearcore/issues/16185)) * Added three Prometheus metrics for the blocks delay tracker: `near_blocks_delay_tracker_entries` (gauge, labelled by map), `near_blocks_delay_tracker_refused_blocks_total` (labelled by reason), and `near_blocks_delay_tracker_missing_entries_total` (labelled by mark). The tracker now records a block only while its height is within `[head - 50, head + 500)` and only up to 8 blocks per height, so `/debug/api/chain_processing_status` no longer lists blocks far from the head. Its `blocks_delay_tracker` error logs about a block that "was not marked received" are now a counter and a debug log, since a missing entry is expected once tracking is bounded. * Raised the minimum supported Rust version to 1.95.0. Building `nearcore` from source now requires a Rust 1.95.0 toolchain. * `tools/debug-ui` now builds with Vite instead of the unmaintained Create React App (`react-scripts`). Build output layout and the port 3000 dev server are unchanged, so deployment needs no change. Building now requires Node `^20.19.0 || >=22.12.0`. ([#16175](https://github.com/near/nearcore/pull/16175)) * Stabilized `EXPERIMENTAL_tx_status` and renamed it to `tx_status`. `EXPERIMENTAL_tx_status` keeps working as a deprecated alias, with the same request and response types. **Metrics change:** the `near_rpc_wait_until_count` metric now labels `tx`, `tx_status` and `EXPERIMENTAL_tx_status` separately; previously both `tx` and `EXPERIMENTAL_tx_status` were counted under the `tx_status` label. ([#16270](https://github.com/near/nearcore/pull/16270)) * `DBCol::EpochLightClientBlocks` now holds a versioned `StoredLightClientBlock` instead of the `LightClientBlockView` RPC type, which raises `DB_VERSION` from 50 to 51. A node started read-write migrates its hot database in place on startup, rewriting one row per epoch; the column holds a few thousand rows in total. The column is never garbage collected, so its rows were written by binaries going back to 2020 and appear in several borsh layouts; the migration reads each of them and rewrites it as the versioned type. A row that no layout reads stops the migration and names its epoch id rather than being guessed at. ([#16394](https://github.com/near/nearcore/pull/16394)) ## [2.13.0] ### Protocol Changes * Opt-in strict nonce mode for transactions. A transaction may opt in to require its nonce be exactly the previous nonce for that access key plus one; such transactions are rejected when the nonce repeats or skips a value. Transactions that do not opt in keep the existing monotonic nonce behavior. ([#15361](https://github.com/near/nearcore/pull/15361), [#15402](https://github.com/near/nearcore/pull/15402)) * Stabilized the FIPS 204 ML-DSA-65 post-quantum signature scheme as a third transaction-signature and access-key scheme alongside ed25519 and secp256k1. Public keys are stored on-trie as a 32-byte SHA3-256 hash rather than the full 1952 bytes, and ML-DSA-65 signature verification is charged an extra 100 Ggas at transaction conversion to cover its higher verification cost. ([#15731](https://github.com/near/nearcore/pull/15731)) * Ensure delegate action returns the correct error consistently. ([#15458](https://github.com/near/nearcore/pull/15458)) * Fix `action_delete_account` not accounting for the global contract identifier when checking the account deletion storage limit. For accounts using a global contract, the check overcounted storage usage by the identifier size (32 bytes, or the account id length for `GlobalByAccount`), so they were slightly harder to delete. ([#15752](https://github.com/near/nearcore/pull/15752)) * Fix a bug in `receiver` verification for a `DeterministicStateInitAction` inside a `DelegateAction` that made it impossible to create deterministic accounts through meta transactions. ([#15812](https://github.com/near/nearcore/pull/15812)) * Stabilized gas keys ([NEP-611](https://github.com/near/NEPs/pull/611)): a new access key type that carries a pre-funded NEAR balance and up to 1,024 independent nonce sequences. Transactions signed with a gas key pay gas costs from the key's balance rather than the signer's account balance. ([#15183](https://github.com/near/nearcore/pull/15183)) * Added a new `DelegateV2` meta-transaction action that lets gas keys ([NEP-611](https://github.com/near/NEPs/pull/611)) sign relayed (meta) transactions. Unlike the existing `Delegate` action, whose `nonce` is the signing access key's plain nonce, `DelegateV2` carries a `TransactionNonce` that selects either the access key's nonce or one of a gas key's parallel nonce sequences by index. The signed payload is versioned so future variants can be added without a new action type. ([#15904](https://github.com/near/nearcore/pull/15904), [#15905](https://github.com/near/nearcore/pull/15905), [#15906](https://github.com/near/nearcore/pull/15906)) * Stabilized the `promise_yield_create_with_id` and `promise_yield_resume_with_yield_id` host functions, which let a contract supply its own deterministic 32-byte yield ID when creating a yield/resume promise instead of storing the runtime-generated `data_id` in state. This avoids the storage cost of tracking yields, enabling use cases such as in-contract mempools. ([#15602](https://github.com/near/nearcore/pull/15602)) * Increased the cost of creating new accounts from `~0.0008` NEAR to `~0.007 NEAR` ([NEP-642](https://github.com/near/NEPs/pull/642)), paid in gas. The gas will now be purchased at a higher price than before (at least `min_gas_purchase_price = 0.001 NEAR/TGas`) to cover the cost of creating new accounts. Gas will still be burned at the same price as before (usually `min_gas_price = 0.0001 NEAR/TGas`) and the price difference will be refunded, so the total cost of a transaction will stay the same. However the balance required to start a transaction will be 10x higher than before, as the price at which gas is purchased will be 10x higher than before. For any operation which creates an account, the protocol will deduct `~0.007 NEAR` from the gas refund to cover the cost of creating an account. * Meta transactions with gas key support via `Action::DelegateV2`. ([#15183](https://github.com/near/nearcore/pull/15183)) * Extend the existing sticky chunk-producer-to-shard assignment to resharding boundaries. Previously stickiness was keyed by `ShardIndex`, which is unstable across a shard layout change; switch to keying by `ShardId`, and when a shard splits distribute the parent's chunk producers across its child shards using greedy stake-balanced bin-packing. Reduces unnecessary state sync after resharding. * Skip transactions whose hash already appeared earlier in the same chunk. A transaction hash is also its outcome id, and outcomes are committed (via the chunk outcome root) keyed by that id. * Recompute `block_ordinal` and `epoch_sync_data_hash` against local chain state when validating received block headers. * Emit `ExecutionMetadata::V4` from chunk producers. V4 carries a per-action `Vec`: one entry per action in the receipt, recording the contract attached to the receiver account immediately before that action ran. Captured for every action kind (not just `FunctionCall`), so consumers can see what code an account had even on receipts that did not invoke a contract. `AccountContract::None` is emitted when the account has no contract deployed, when it did not exist (e.g. the `CreateAccount` slot that materialized it), or for unexecuted trailing slots after a mid-receipt failure. Order matches the receipt's `actions` vector. ([#15822](https://github.com/near/nearcore/pull/15822)) * Authenticate `ContractCodeResponse` messages with a chunk-producer signature, matching the signed-message pattern already used by `ChunkContractAccesses` and `ContractCodeRequest`. * Stabilized continuous epoch sync: epoch sync proofs are maintained incrementally at each epoch boundary, and block headers are garbage-collected on non-archival nodes. Enabling this feature performs a DB migration (48 → 49) to store the compressed proof. ([#15476](https://github.com/near/nearcore/pull/15476)) * Stabilized dynamic resharding: shards are now split automatically at epoch boundaries based on runtime state size, without requiring a protocol upgrade to ship a new hard-coded shard layout. ([#15823](https://github.com/near/nearcore/pull/15823)) * Clamp the gas admission check used when forwarding buffered receipts under congestion control to `allowed_shard_outgoing_gas`, so a receipt whose gas exceeds the per-shard outgoing budget can still be forwarded when the shard is in the "allowed" set. ([#15924](https://github.com/near/nearcore/pull/15924)) ### Non-protocol Changes * `EXPERIMENTAL_receipt_to_tx` accepts optional `block_height`, `shard_id`, `window` hint params. On a column miss with a hint set, the handler scans execution outcomes around the hint. Best-effort: long emit-to-execute delays may return `UnknownReceipt` instead of a terminal tx. Resharding boundaries are handled. New node-config knobs: `receipt_to_tx_max_hint_window` (default 20), `receipt_to_tx_max_hop_distance` (default 20), `receipt_to_tx_max_outcomes_per_request` (default 20_000). Operators serving cold-archival queries should consider raising these. * Added pagination to `EXPERIMENTAL_view_state` and the `view_state` query. The request takes `after_key_base64` and `limit`, and the response returns `last_key` to fetch the following page. ([#15743](https://github.com/near/nearcore/pull/15743)) ## [2.12.0] ### Protocol Changes * The contract runtime has been upgraded to use the new Wasmtime-based runtime. * The contract runtime now allows for bulk memory instructions in Wasm code. ### Non-protocol Changes * Fix VM compilation and cache metrics (`near_vm_runner_compilation_seconds`, `near_vm_compiled_contract_cache_*`) not being reported for contract deployment, global contract distribution, and pipelining code paths. Add new `near_vm_compiled_contract_memory_cache_hits_total` metric to distinguish in-memory cache hits from disk hits. ([#15580](https://github.com/near/nearcore/pull/15580)) * Removed deprecated fields from `GenesisConfig` and `ProtocolConfigView`: `num_block_producer_seats_per_shard`, `avg_hidden_validator_seats_per_shard`, `num_chunk_only_producer_seats`. * New `EXPERIMENTAL_receipt_to_tx` RPC method that resolves a receipt ID back to the originating transaction hash and sender account. Requires `save_receipt_to_tx` config enabled and all-shards tracking. ([#15414](https://github.com/near/nearcore/pull/15414)) * New sync handler (sync-v2) replaces the legacy sync implementation with a clean state machine. Nodes are routed through one of two paths based on how far behind they are: near-horizon nodes sync blocks directly, while far-horizon nodes follow the full pipeline (epoch sync, header sync, state sync, block sync). ([#15335](https://github.com/near/nearcore/pull/15335)) * Epoch sync proofs are now maintained incrementally at each epoch boundary instead of being derived on demand. Block headers are garbage collected alongside block bodies on non-archival nodes, reducing disk usage. ([#15412](https://github.com/near/nearcore/pull/15412)) * Validator key consistency check runs once per epoch to detect mismatches between the node's validator key and the key registered on chain. Misconfigured nodes will exit via panic. ([#15417](https://github.com/near/nearcore/pull/15417)) * State sync status now shows download and apply parts progress. ([#15391](https://github.com/near/nearcore/pull/15391)) * Fix: allow `Disconnect` message on Tier3 connections. ([#15405](https://github.com/near/nearcore/pull/15405)) * Fix: gracefully handle expired peer in `peer_connection_attempt`. ([#15390](https://github.com/near/nearcore/pull/15390)) * Archival nodes with split storage (cold store) will run a one-time migration on startup that is expected to take **1–2 hours** depending on disk performance. Expect downtime. Nodes without cold store are not affected. ([#15503](https://github.com/near/nearcore/pull/15503)) ## [2.11.0] ### Protocol Changes * Contract gas limit is increased from 300 TGas to 1 PGas. * Yield/Resume improvements - from now on, calling `promise_yield_resume` after `promise_yield_create` will always work. Previously there were some cases where calling `resume` would fail if called too quickly after `create`. See the [github issue](https://github.com/near/nearcore/issues/14904) for details. Strictly speaking, this could be a breaking change for contracts which expected the resume to fail in these situations, but it shouldn't affect normal use cases. * A promise with a single `DeleteAccount` action and no input promises will be executed immediately after the receipt that created it, before any other receipts for this account. * ETH implicit accounts now use a globally deployed contract instead of a contract embedded in the neard binary. * Invalid transactions now generate execution outcomes, allowing indexers and RPC to report outcomes for all transactions including failed ones. * Existing contract code is excluded from chunk state witnesses for deploy-contract and delete-account actions, reducing witness size by using internal trie nodes to check code size instead. * Fix access key allowance being incorrectly decremented before validation checks that could fail. Previously, allowance was mutated in-place before storage stake and function call permission checks, so a failed transaction could incorrectly reduce the allowance. * Include tokens burnt as part of global contract deploys in the corresponding execution outcome's `tokens_burnt` field. * Fix deterministic account ID creation to allow creation by any incoming transfer (unless it's a refund) and correctly check whether the feature is enabled. * Add nonce-based idempotency for global contract distribution receipts. Each distribution carries an auto-incremented nonce, and any distribution receipt with a stale nonce is dropped, preventing race conditions during multiple distribution attempts for the same contract. ### Non-protocol Changes * Replace polling for transaction status with event notifications to improve jsonrpc response latency * Added a database migration to backfill trie data lost due to a bug in resharding. The migration runs automatically on node startup and takes approximately 5 minutes on an archival node. Non-archival nodes are not affected. ([#15044](https://github.com/near/nearcore/pull/15044)) * Fix `sandbox_fast_forward` RPC returning success before blocks are actually produced, by tracking target height explicitly instead of relying on the delta field which could be temporarily zero during processing. ([#14899](https://github.com/near/nearcore/pull/14899)) * Fix `sandbox_patch_state` RPC silently dropping patches when a block was being processed concurrently, by removing an unnecessary `clear()` call that raced with new patches. ([#14893](https://github.com/near/nearcore/pull/14893)) * Added `experimental.tier3_public_addr` network config option to manually override the auto-discovered Tier3 public address. ## [2.10.0] ### Protocol Changes * Introducing deterministic account IDs: Account IDs starting with the prefix `0s` can only be created with the new action `DeterministicStateInit`. Its name is derived from the initial state and global contract it uses. [#14307](https://github.com/near/nearcore/pull/14307) * New host functions for deterministic initialization: Three new host functions `promise_batch_action_state_init`, `promise_batch_action_state_init_by_account_id` and `set_state_init_data_entry` allow creating the new action `DeterministicStateInit` from within a smart contract. [#14364](https://github.com/near/nearcore/pull/14364) * Accessing the current contract code: The new host function `current_contract_code` allows smart contracts to read the currently deployed code hash or global contract identifier. [#14372](https://github.com/near/nearcore/pull/14372) * Controlling balance refunds: The new host function `promise_set_refund_to` allows smart contracts to redirect balance refunds of outgoing receipts to other accounts. [#14285](https://github.com/near/nearcore/pull/14285) * Querying refund receivers: The new host function `refund_to_account_id` returns the receiver of balance refunds, which is either `predecessor_id` or the refund receiver set by the predecessor using `promise_set_refund_to`. [#14372](https://github.com/near/nearcore/pull/14372) * Gas optimization: Calls to the existing host functions `input` and `promise_result` no longer charge gas per byte (`wasm_write_memory_byte`), thanks to an optimization that eliminates unnecessary data copying. [#14405](https://github.com/near/nearcore/pull/14405) * Introduce versioned StatePart in state sync and update protocol messages to support compressed state parts. [#14013](https://github.com/near/nearcore/pull/14013) * Reduce gas cost for `wasm_touching_trie_node` (from `16_101_955_926` to `2_280_000_000`) and increase the compute cost of `wasm_read_cached_trie_node` (from `0` to `4_000_000_000`), making them equal so they can be interchangeable in the future, enabling potential performance optimizations. [#14046](https://github.com/near/nearcore/pull/14046) ### Non-protocol Changes * Indexer changes, including breaking changes in the API. See the [indexer changelog](https://github.com/near/nearcore/blob/master/chain/indexer/CHANGELOG.md) for details. * Stabilize `EXPERIMENTAL_changes_in_block`, `EXPERIMENTAL_genesis_config`, and `EXPERIMENTAL_maintenance_windows` RPC methods and rename them to `block_effects`, `genesis_config` and `maintenance_windows` respectively. https://github.com/near/nearcore/pull/13763 * Batch ed25519 signature verification for transaction processing. [#14196](https://github.com/near/nearcore/pull/14196) * New `/actors` page in debug-ui, showing utilization of actors and dequeue time of recently processed messages. [#14452](https://github.com/near/nearcore/pull/14452) * Fix to avoid re-applying state parts in case state sync was interrupted and resumed. [#14232](https://github.com/near/nearcore/pull/14232) * Moved Tier1 configuration from experimental to top level config. No action is necessary as the default values are the recommended ones. ([#13575](https://github.com/near/nearcore/pull/13575)) * Add a new configuration option `save_tx_outcomes` ([#13610](https://github.com/near/nearcore/pull/13610)). When set to `false`, per-transaction outcomes are not written to the db to improve validator throughput. Disabling this config means transactions processed by the node will not be queryable by transaction hash, however this is not needed for validators to perform their duties. The default for archive and RPC nodes is `true`. * Updated the recommended operating system network settings for running `neard` ([#14012](https://github.com/near/nearcore/pull/14012)). ## [2.9.0] ### Protocol Changes * Maximum inflation rate moved to epoch config * Inflation rate reduction from 5% to 2.5% ## [2.8.0] ### Protocol Changes * Increase number of validators from 300 to 500. To maintain the chain safety, we increase the number of mandates per shard to 105. ([#14033](https://github.com/near/nearcore/pull/14033)) ### Non-protocol Changes * Added a neard subcommand tool that can be used to recover data that was lost due to bug in resharding. ([#14185](https://github.com/near/nearcore/pull/14185)) ## [2.7.1] ### Non-protocol changes * Add a new configuration option `protocol_version_check_config_override`. This determines which epoch the client uses to determine version compatibility with the network. The default is `NextNext`, which causes the node to exit instead of persisting potentially incorrect epoch info and corrupting the database in case the node operator does not update the client in time for the network upgrade. The prior behavior only checked the protocol version in the next epoch, which can be restored by setting this option to `Next` and allows a validator that did not upgrade their node to participate in the final epoch the client is compatible with the network. ## [2.7.0] ### Protocol Changes * A new shard layout for production networks ([#13324](https://github.com/near/nearcore/pull/13324)). Use split boundary from [#13609](https://github.com/near/nearcore/pull/13609). * When the protocol update version voting takes place, validators that did not upgrade to the latest version will be scheduled for removal (aka kickout) in the epoch the new version takes effect. This helps avoid missed blocks in the first epoch of the new version, as un-upgraded validators would produce invalid blocks. Technically this is a protocol change as it impacts the validator set, however it will take effect during the next version upgrade therefore does not require its own protocol version. ([#13375](https://github.com/near/nearcore/issues/13375)) * Implement [NEP-536](https://github.com/near/NEPs/pull/536): Reduce the number of refund receipts by adding removing pessimistic gas pricing. Also introduce a gas refund penalty but set it to 0 to avoid potential negative impact. ([#13397](https://github.com/near/nearcore/issues/13397)) * Implement P2P sync for state sync headers. ([#13377](https://github.com/near/nearcore/pull/13377)) * Enable saturating float-to-int conversions in runtime. ([#13414](https://github.com/near/nearcore/pull/13414)) ### Non-protocol Changes * Add RPC query for viewing global contract code. ([#13547](https://github.com/near/nearcore/pull/13547)) * Add promise batch host functions for global contracts. ([#13565](https://github.com/near/nearcore/pull/13565)) * Stabilize `EXPERIMENTAL_changes` RPC method and rename it to `changes`. ([#13722](https://github.com/near/nearcore/pull/13722)) * Rename `TxRequestHandlerActor` to `RpcHandlerActor` to reflect the change in the scope of its responsibilities. Otherwise its API change is fully backward-compatible, so the dependent services can handle it by simply renaming the type where it is mentioned explicitly. ([#13259](https://github.com/near/nearcore/pull/13259)) ## [2.6.0] ### Protocol Changes * Implemented support for global contracts: [NEP-591](https://github.com/near/NEPs/pull/591) * Implemented Optimistic Block to remove doubled chunk execution latency from block & chunk production flow [#10584](https://github.com/near/nearcore/issues/10584) * Changed receipt id computation to enable chunk execution based on Optimistic Block. More specifically, primitive [`create_hash_upgradable`](https://github.com/near/nearcore/blob/700735b/core/primitives/src/utils.rs#L292-L309) is changed to use `block_height` instead of `extra_hash`. ### Non-protocol Changes **No Changes** ## [2.5.0] ### Protocol Changes * Add cross-shard bandwidth scheduler which manages transferring receipts between shards, enabling higher throughput of cross-shard receipts and better horizontal scalability. NEP-584 (https://github.com/near/NEPs/pull/584) * Resharding V3 - a new implementation for resharding and two new shard layouts for the production networks. NEP-568 (https://github.com/near/NEPs/pull/568) ### Non-protocol Changes * Parallelize transaction validation (including signature checks) before `verify_and_charge_transaction`, significantly improving throughput for transaction processing on the nodes. [#12654](https://github.com/near/nearcore/pull/12654) * Current Epoch State Sync - Moves the sync point from the previous epoch to the current epoch. [#12102](https://github.com/near/nearcore/pull/12102) ## 2.4.0 ### Protocol Changes * Fixing invalid cost used for `wasm_yield_resume_byte`. [#12192](https://github.com/near/nearcore/pull/12192) * Relaxing Congestion Control to allow accepting and buffering more transactions. [#12241](https://github.com/near/nearcore/pull/12241) [#12430](https://github.com/near/nearcore/pull/12430) * Exclude contract code out of state witness and distribute it separately. [#11099](https://github.com/near/nearcore/issues/11099) ### Non-protocol Changes * **Epoch Sync V4**: A capability to bootstrap a node from another active node. [#73](https://github.com/near/near-one-project-tracking/issues/73) * **Decentralized state sync**: Before, nodes that needed to download state (either because they're several epochs behind the chain or because they're going to start producing chunks for a shard they don't currently track) would download them from a centralized GCS bucket. Now, nodes will attempt to download pieces of the state from peers in the network, and only fallback to downloading from GCS if that fails. Please note that in order to participate in providing state parts to peers, your node may generate snapshots of the state. These snapshots should not take too much space, since they're hard links to database files that get cleaned up on every epoch. [#12004](https://github.com/near/nearcore/issues/12004) ## 2.3.0 ### Protocol Changes * Sets `chunk_validator_only_kickout_threshold` to 70. Uses this kickout threshold as a cutoff threshold for contribution of endorsement ratio in rewards calculation: if endorsement ratio is above 70%, the contribution of endorsement ratio in average uptime calculation is 100%, otherwise it is 0%. Endorsements received are now included in `BlockHeader` to improve kickout and reward calculation for chunk validators. ### Non-protocol Changes * Added [documentation](./docs/misc/archival_data_recovery.md) and a [reference](./scripts/recover_missing_archival_data.sh) script to recover the data lost in archival nodes at the beginning of 2024. * **Archival nodes only:** Stop saving partial chunks to `PartialChunks` column in the Cold DB. Instead, archival nodes will reconstruct partial chunks from the `Chunks` column. * Enabled state snapshots on every epoch to allow the nodes to take part in decentralized state sync in future releases. ## 2.2.1 This release patches a bug found in the 2.2.0 release # Non-protocol changes There was a bug in the integration between ethereum implicit accounts and the compiled contract cache which sometimes caused the nodes to get stuck. This would most often happen during state sync, but could also happen by itself. Please update your nodes to avoid getting stuck. A node that hits this bug will print an error about an `InvalidStateRoot` in the logs and then it'll be unable to sync. It's possible to recover a stalled node by clearing the compiled contract cache and rolling back one block: 1. Stop the neard process 2. Download the new version of neard 3. Clear the compiled contract cache: rm -rf ~/.near/data/contracts 4. Undo the last block: ./neard undo-block 5. Start neard After that the node should be able to recover and sync with the rest of the network. ## 2.2.0 ### Protocol Changes * The minimum validator stake has been set to a lower value. The small-stake validators that were kicked out during the shift to stateless validation will be able to rejoin the network. * Better algorithm for validator kickouts * (Testnet only) update the eth-implicit accounts contract on testnet to match the one on mainnet. ### Non-protocol Changes * Fix spammy messages about calculating gas for PromiseYield receipts. * Don't crash when the CPU doesn't have SHA-NI instructions. It's still a hardware requirement, there is no guarantee that nodes without this instruction will be able to keep up with the network, but `neard` will now be able to run (slowly) on CPUs without this instruction. ## 2.1.0 ### Protocol Changes * Eth-Implicit Accounts [NEP-0518](https://github.com/near/NEPs/pull/518) * Host Functions for BLS12-381 Curve Operations [NEP-0488](https://github.com/near/NEPs/pull/488) ### Non-protocol Changes * Enforce rate limits to received network messages [#11617](https://github.com/near/nearcore/issues/11617). Rate limits are configured by default, but they can be overridden through the experimental configuration option `received_messages_rate_limits`. * Increase sync blocks requested and make it configurable through a parameter in the client config [#11820](https://github.com/near/nearcore/pull/11820). Increase default max sync block requests to 10 from 5. ## 2.0.0 ### Protocol Changes * Congestion Control [NEP-0539](https://github.com/near/NEPs/pull/539) * Stateless Validation [NEP-0509](https://github.com/near/NEPs/pull/509) ### Non-protocol Changes **No Changes** ## 1.40.0 ### Protocol Changes **No Changes** ### Non-protocol Changes ## 1.39.0 ### Protocol Changes * Use more precise gas costs for function calls [#10943](https://github.com/near/nearcore/pull/10943) that should lead to more efficient chunk utilization. ### Non-protocol Changes * Limit overcharging by decoupling minimum_new_receipt_gas from the function call and setting it to a constant value. [#10941](https://github.com/near/nearcore/pull/10941) * These PRs introduce a change in the default behaviour of `broadcast_tx_commit`,`send_tx`, `tx, EXPERIMENTAL_tx_status` RPC methods. The default behaviour no longer waits for refund receipts. If you do need to wait for refund receipts, you need ask about it explicitly by using TxExecutionStatus::Final option ("wait_until": "FINAL" in the json request). More information in the [#10792](https://github.com/near/nearcore/pull/10792) [#10948](https://github.com/near/nearcore/pull/10948) * Adds improvements to the `sweat` contract prefetcher logic. Add new prefetcher logic for `kaiching` contract. [#10899](https://github.com/near/nearcore/pull/10899) * Improves prefetcher logic to speedup chunk finalization by prefetching keys related to refund receipts and actions such as: Delegate, AddKey, DeleteKey. [#10936](https://github.com/near/nearcore/pull/10936) * Add more metrics for receipt processing. [#10944](https://github.com/near/nearcore/pull/10944) ## 1.37.0 ### Protocol Changes * Resharding v2 - new implementation for resharding and a new shard layout for production networks. [#10303](https://github.com/near/nearcore/pull/10303), [NEP-0508](https://github.com/near/NEPs/pull/508) * Restrict the creation of non-implicit top-level account that are longer than 32 bytes. Only the registrar account can create them. [#9589](https://github.com/near/nearcore/pull/9589) * Adjust the number of block producers and chunk producers on testnet to facilitate testing of chunk-only producers [#9563](https://github.com/near/nearcore/pull/9563) ### Non-protocol Changes * Add prometheus metrics for the internal state of the doomslug. [#9458](https://github.com/near/nearcore/pull/9458) * Fix `EXPERIMENTAL_protocol_config` to apply overrides from `EpochConfig`. [#9692](https://github.com/near/nearcore/pull/9692) * Add config option `tx_routing_height_horizon` to configure how many chunk producers are notified about the tx. [#10251](https://github.com/near/nearcore/pull/10251) ## 1.36.0 ### Protocol Changes * The support for fixed shards in shard layout was removed. [#9219](https://github.com/near/nearcore/pull/9219) ### Non-protocol Changes * New option `transaction_pool_size_limit` in `config.json` allows to limit the size of the node's transaction pool. By default the limit is set to 100 MB. [#3284](https://github.com/near/nearcore/issues/3284) * Database snapshots at the end of an epoch. This lets a node obtain state parts using flat storage. [#9090](https://github.com/near/nearcore/pull/9090) * Number of transactions included in a chunk will be lowered if there is a congestion of more than 20000 delayed receipts in a shard. [#9222](https://github.com/near/nearcore/pull/9222) * Our more efficient and scalable V2 routing protocol is implemented. It shadows the V1 protocol for now while we verify its performance. [#9187](https://github.com/near/nearcore/pull/9187) * The default config now enables TIER1 outbound connections by default. [#9349](https://github.com/near/nearcore/pull/9349) * State Sync from GCS is available for experimental use. [#9398](https://github.com/near/nearcore/pull/9398) ## 1.35.0 ### Protocol Changes * Upgrade the contract preparation code to use [finite-wasm](https://github.com/near/finite-wasm), which guarantees deterministic limits on execution time and space of compiled contracts ### Non-protocol Changes * Dump state by multiple nodes, each node will refer to s3 for which parts need to be dumped. [#9049](https://github.com/near/nearcore/pull/9049) * Small values in the flat storage trie are inlined for faster accesses [#9029](https://github.com/near/nearcore/pull/9029) * A current protocol version metric is added to the prometheus metrics under near_current_protocol_version [#9030](https://github.com/near/nearcore/pull/9030) * The transaction pool size is tracked, and if the `transaction_pool_size_limit` config option is set, we now avoid storing more than the specified size of transactions in each shard's transaction pool [#8970](https://github.com/near/nearcore/pull/8970) and [#9036](https://github.com/near/nearcore/pull/9036) ## 1.34.0 ### Protocol Changes * Flat Storage for reads, reducing number of DB accesses for state read from `2 * key.len()` in the worst case to 2. [#8761](https://github.com/near/nearcore/pull/8761), [NEP-399](https://github.com/near/NEPs/pull/399) * Contract preparation and gas charging for wasm execution also switched to using our own code, as per the finite-wasm specification. Contract execution gas costs will change slightly for expected use cases. This opens up opportunities for further changing the execution gas costs (eg. with different costs per opcode) to lower contract execution cost long-term. [#8912](https://github.com/near/nearcore/pull/8912) * Compute Costs are implemented and stabilized. Compute usage of the chunk is now limited according to the compute costs. [#8915](https://github.com/near/nearcore/pull/8915), [NEP-455](https://github.com/near/NEPs/blob/master/neps/nep-0455.md). * Write related storage compute costs are increased which means they fill a chunk sooner but gas costs are unaffected. [#8924](https://github.com/near/nearcore/pull/8924) ### Non-protocol Changes * undo-block tool to reset the chain head from current head to its prev block. Use the tool by running: `./target/release/neard undo-block`. [#8681](https://github.com/near/nearcore/pull/8681) * Add prometheus metrics for expected number of blocks/chunks at the end of the epoch. [#8759](https://github.com/near/nearcore/pull/8759) * Node can sync State from S3. [#8789](https://github.com/near/nearcore/pull/8789) * Node can sync State from local filesystem. [#8913](https://github.com/near/nearcore/pull/8913) * Add per shard granularity for chunks in validator info metric. [#8934](https://github.com/near/nearcore/pull/8934) ## 1.33.0 ### Protocol Changes ### Non-protocol Changes * State-viewer tool to dump and apply state changes from/to a range of blocks. [#8628](https://github.com/near/nearcore/pull/8628) * Experimental option to dump state of every epoch to external storage. [#8661](https://github.com/near/nearcore/pull/8661) * Add prometheus metrics for tracked shards, block height within epoch, if is block/chunk producer. [#8728](https://github.com/near/nearcore/pull/8728) * State sync is disabled by default [#8730](https://github.com/near/nearcore/pull/8730) * Node can restart if State Sync gets interrupted. [#8732](https://github.com/near/nearcore/pull/8732) * Merged two `neard view-state` commands: `apply-state-parts` and `dump-state-parts` into a single `state-parts` command. [#8739](https://github.com/near/nearcore/pull/8739) * Add config.network.experimental.network_config_overrides to the JSON config. [#8871](https://github.com/near/nearcore/pull/8871) ## 1.32.2 ### Fixes * Fix: rosetta zero balance accounts [#8833](https://github.com/near/nearcore/pull/8833) ## 1.32.1 ### Fixes * Fix vulnerabilities in block outcome root validation and total supply validation [#8790](https://github.com/near/nearcore/pull/8790) ## 1.32.0 ### Protocol Changes * Stabilize `ed25519_verify` feature: introducing a host function to verify ed25519 signatures efficiently. [#8098](https://github.com/near/nearcore/pull/8098) [NEP-364](https://github.com/near/NEPs/pull/364) * Added STUN-based self-discovery to make configuration of TIER1 network easier in the simplest validator setups. [#8472](https://github.com/near/nearcore/pull/8472) * Stabilize zero balance account feature: allows account to not hold balance under certain conditions and enables a more smooth onboarding experience where users don't have to first acquire NEAR tokens to pay for the storage of their accounts. [#8378](https://github.com/near/nearcore/pull/8378) [NEP-448](https://github.com/near/NEPs/pull/448) * Stabilize meta transactions on the protocol level. [NEP-366](https://github.com/near/NEPs/blob/master/neps/nep-0366.md), [Tracking issue #8075](https://github.com/near/nearcore/issues/8075), [Stabilization #8601](https://github.com/near/nearcore/pull/8601) ### Non-protocol Changes * Config validation can be done by following command: `./target/debug/neard --home {path_to_config_files} validate-config`. This will show error if there are file issues or semantic issues in `config.json`, `genesis.json`, `records.json`, `node_key.json` and `validator_key.json`. [#8485](https://github.com/near/nearcore/pull/8485) * Comments are allowed in configs. This includes `config.json`, `genesis.json`, `node_key.json` and `validator_key.json`. You can use `//`, `#` and `/*...*/` for comments. [#8423](https://github.com/near/nearcore/pull/8423) * `/debug` page now has client_config linked. You can also check your client_config directly at /debug/client_config [#8400](https://github.com/near/nearcore/pull/8400) * Added cold store loop - a background thread that copies data from hot to cold storage and a new json rpc endpoint - split_storage_info - that exposes debug info about the split storage. [#8432](https://github.com/near/nearcore/pull/8432) * `ClientConfig` can be updated while the node is running. `dyn_config.json` is no longer needed as its contents were merged into `config.json`. [#8240](https://github.com/near/nearcore/pull/8240) * TIER2 network stabilization. Long-lasting active connections are persisted to DB and are re-established automatically if either node restarts. A new neard flag `--connect-to-reliable-peers-on-startup` is provided to toggle this behavior; it defaults to true. The PeerStore is no longer persisted to DB and is now kept in-memory. [#8579](https://github.com/near/nearcore/issues/8579), [#8580](https://github.com/near/nearcore/issues/8580). ## 1.31.0 ### Non-protocol Changes * Enable TIER1 network. Participants of the BFT consensus (block & chunk producers) now can establish direct TIER1 connections between each other, which will optimize the communication latency and minimize the number of dropped chunks. To configure this feature, see [advanced\_configuration/networking](./docs/advanced_configuration/networking.md). [#8141](https://github.com/near/nearcore/pull/8141) [#8085](https://github.com/near/nearcore/pull/8085) [#7759](https://github.com/near/nearcore/pull/7759) * [Network] Started creating connections with larger nonces, that are periodically refreshed Start creating connections (edges) with large nonces [#7966](https://github.com/near/nearcore/pull/7966) * `/status` response has now two more fields: `node_public_key` and `validator_public_key`. The `node_key` field is now deprecated and should not be used since it confusingly holds validator key. [#7828](https://github.com/near/nearcore/pull/7828) * Added `near_node_protocol_upgrade_voting_start` Prometheus metric whose value is timestamp when voting for the next protocol version starts. [#7877](https://github.com/near/nearcore/pull/7877) * neard cmd can now verify proofs from JSON files. [#7840](https://github.com/near/nearcore/pull/7840) * In storage configuration, the value `trie_cache_capacities` now is no longer a hard limit but instead sets a memory consumption limit. For large trie nodes, the limits are close to equivalent. For small values, there can now fit more in the cache than previously. [#7749](https://github.com/near/nearcore/pull/7749) * New options `store.trie_cache` and `store.view_trie_cache` in `config.json` to set limits on the trie cache. Deprecates the never announced `store.trie_cache_capacities` option which was mentioned in previous change. [#7578](https://github.com/near/nearcore/pull/7578) * New option `store.background_migration_threads` in `config.json`. Defines number of threads to execute background migrations of storage. Currently used for flat storage migration. Set to 8 by default, can be reduced if it slows down block processing too much or increased if you want to speed up migration. [#8088](https://github.com/near/nearcore/pull/8088), * Tracing of work across actix workers within a process: [#7866](https://github.com/near/nearcore/pull/7866), [#7819](https://github.com/near/nearcore/pull/7819), [#7773](https://github.com/near/nearcore/pull/7773). * Scope of collected tracing information can be configured at run-time: [#7701](https://github.com/near/nearcore/pull/7701). * Attach node's `chain_id`, `node_id`, and `account_id` values to tracing information: [#7711](https://github.com/near/nearcore/pull/7711). * Change exporter of tracing information from `opentelemetry-jaeger` to `opentelemetry-otlp`: [#7563](https://github.com/near/nearcore/pull/7563). * Tracing of requests across processes: [#8004](https://github.com/near/nearcore/pull/8004). * Gas profiles as displayed in the `EXPERIMENTAL_tx_status` are now more detailed and give the gas cost per parameter. ## 1.30.0 ### Protocol Changes * Stabilize `account_id_in_function_call_permission` feature: enforcing validity of account ids in function call permission. [#7569](https://github.com/near/nearcore/pull/7569) ### Non-protocol Changes * `use_db_migration_snapshot` and `db_migration_snapshot_path` options are now deprecated. If they are set in `config.json` the node will fail if migration needs to be performed. Use `store.migration_snapshot` instead to configure the behaviour [#7486](https://github.com/near/nearcore/pull/7486) * Added `near_peer_message_sent_by_type_bytes` and `near_peer_message_sent_by_type_total` Prometheus metrics measuring size and number of messages sent to peers. [#7523](https://github.com/near/nearcore/pull/7523) * `near_peer_message_received_total` Prometheus metric is now deprecated. Instead of it aggregate `near_peer_message_received_by_type_total` metric. For example, to get total rate of received messages use `sum(rate(near_peer_message_received_by_type_total{...}[5m]))`. [#7548](https://github.com/near/nearcore/pull/7548) * Few changes to `view_state` JSON RPC query: - The request has now an optional `include_proof` argument. When set to `true`, response’s `proof` will be populated. - The `proof` within each value in `values` list of a `view_state` response is now deprecated and will be removed in the future. Client code should ignore the field. - The `proof` field directly within `view_state` response is currently always sent even if proof has not been requested. In the future the field will be skipped in those cases. Clients should accept responses with this field missing (unless they set `include_proof`). [#7603](https://github.com/near/nearcore/pull/7603) * Backtraces on panics are enabled by default, so you no longer need to set `RUST_BACKTRACE=1` environmental variable. To disable backtraces, set `RUST_BACKTRACE=0`. [#7562](https://github.com/near/nearcore/pull/7562) * Enable receipt prefetching by default. This feature makes receipt processing faster by parallelizing IO requests, which has been introduced in [#7590](https://github.com/near/nearcore/pull/7590) and enabled by default with [#7661](https://github.com/near/nearcore/pull/7661). Configurable in `config.json` using `store.enable_receipt_prefetching`. ## 1.29.0 [2022-08-15] ### Protocol Changes * Stabilized `protocol_feature_chunk_only_producers`. Validators will now be assigned to blocks and chunks separately. * The validator uptime kickout threshold has been reduced to 80% * Edge nonces between peers can now optionally indicate an expiration time ### Non-protocol Changes * The logic around forwarding chunks to validators is improved * Approvals and partial encoded chunks are now sent multiple times, which should reduce stalls due to lost approvals when the network is under high load * We now keep a list of "TIER1" accounts (validators) for whom latency/reliability of messages routed through the network is critical * /debug HTTP page has been improved * Messages aren't routed through peers that are too far behind * Log lines printed every 10 seconds are now less expensive to compute * message broadcasts have been improved/optimized * `network.external_address` field in config.json file is deprecated. In fact it has never been used and only served to confuse everyone [#7300](https://github.com/near/nearcore/pull/7300) * Due to increasing state size, improved shard cache for Trie nodes to put more nodes in memory. Requires 3 GB more RAM [#7429](https://github.com/near/nearcore/pull/7429) ## 1.28.0 [2022-07-27] ### Protocol Changes * Stabilized `alt_bn128_g1_multiexp`, `alt_bn128_g1_sum`, `alt_bn128_pairing_check` host functions [#6813](https://github.com/near/nearcore/pull/6813). ### Non-protocol Changes * Added `path` option to `StoreConfig` which makes location to the RocksDB configurable via `config.json` file (at `store.path` path) rather than being hard-coded to `data` directory in neard home directory [#6938](https://github.com/near/nearcore/pull/6938) * Removed `testnet` alias for `localnet` command; it’s been deprecated since 1.24 [#7033](https://github.com/near/nearcore/pull/7033) * Removed undocumented `unsafe_reset_all` and `unsafe_reset_data` commands; they were deprecated since 1.25 * Key files can use `private_key` field instead of `secret_key` now; this improves interoperability with near cli which uses the former name [#7030](https://github.com/near/nearcore/issues/7030) * Latency of network messages is now measured [#7050](https://github.com/near/nearcore/issues/7050) ## 1.27.0 [2022-06-22] ### Protocol Changes * Introduced protobuf encoding as the new network protocol. Borsh support will be removed in two releases as per normal protocol upgrade policies [#6672](https://github.com/near/nearcore/pull/6672) ### Non-protocol Changes * Added `near_peer_message_received_by_type_bytes` [#6661](https://github.com/near/nearcore/pull/6661) and `near_dropped_message_by_type_and_reason_count` [#6678](https://github.com/near/nearcore/pull/6678) metrics. * Removed `near__{total,bytes}` [#6661](https://github.com/near/nearcore/pull/6661), `near__dropped`, `near_drop_message_unknown_account` and `near_dropped_messages_count` [#6678](https://github.com/near/nearcore/pull/6678) metrics. * Added `near_action_called_count` metric [#6679]((https://github.com/near/nearcore/pull/6679) * Removed `near_action__total` metrics [#6679]((https://github.com/near/nearcore/pull/6679) * Added `near_build_info` metric which exports neard’s build information [#6680](https://github.com/near/nearcore/pull/6680) * Make it possible to update logging at runtime: [#6665](https://github.com/near/nearcore/pull/6665) * Use correct cost in gas profile for adding function call key [#6749](https://github.com/near/nearcore/pull/6749) ## 1.26.0 [2022-05-18] ### Protocol Changes * Enable access key nonce range for implicit accounts to prevent tx hash collisions [#5482](https://github.com/near/nearcore/pull/5482) * Include `promise_batch_action_function_call_weight` host function on the runtime [#6285](https://github.com/near/nearcore/pull/6285) [#6536](https://github.com/near/nearcore/pull/6536) * Increase deployment cost [#6397](https://github.com/near/nearcore/pull/6397) * Limit the number of locals per contract to 1_000_000 * Ensure caching all nodes in the chunk for which touching trie node cost was charged, reduce cost of future reads in a chunk [#6628](https://github.com/near/nearcore/pull/6628) * Lower storage key limit to 2 KiB ### Non-protocol Changes * Switch to LZ4+ZSTD compression from Snappy in RocksDB [#6365](https://github.com/near/nearcore/pull/6365) * Moved Client Actor to separate thread - should improve performance [#6333](https://github.com/near/nearcore/pull/6333) * Safe DB migrations using RocksDB checkpoints [#6282](https://github.com/near/nearcore/pull/6282) * [NEP205](https://github.com/near/NEPs/issues/205): Configurable start of protocol upgrade voting [#6309](https://github.com/near/nearcore/pull/6309) * Make max_open_files and col_state_cache_size parameters configurable [#6584](https://github.com/near/nearcore/pull/6584) * Make RocksDB block_size configurable [#6631](https://github.com/near/nearcore/pull/6631) * Increase default max_open_files RocksDB parameter from 512 to 10k [#6607](https://github.com/near/nearcore/pull/6607) * Use kebab-case names for neard subcommands to make them consistent with flag names. snake_case names are still valid for existing subcommands but kebab-case will be used for new commands. ## 1.25.0 [2022-03-16] ### Protocol Changes * `max_gas_burnt` has been increased to 300. ### Non-protocol Changes * More Prometheus metrics related to epoch, sync state, node version, chunk fullness and missing chunks have been added. * Progress bar is now displayed when downloading `config.json` and `genesis.json`. * Status line printed in logs by `neard` is now more descriptive. - `view_state` is now a command of `neard`; `state-viewer` is no longer a separate binary. - `RUST_LOG` environment variable is now correctly respected. - `NetworkConfig::verify` will now fail if configuration is invalid rather than printing error and continuing. - Fixed a minor bug which resulted in DB Not Found errors when requesting chunks. - Updated to wasmer-near 2.2.0 which fixes a potential crash and improves cost estimator working. - `neard init` will no longer override node or validator private keys. - Rosetta RPC now populates `related_transactions` field. - Rosetta RPC support is now compiled in by default. The feature still needs to be explicitly turned on and is experimental. - Rosetta RPC /network/status end point correctly works on non-archival nodes. - `unsafe_reset_all` and `unsafe_reset_data` commands are now deprecated. Use `rm` explicitly instead. ## 1.24.0 [2022-02-14] ### Protocol Changes * Enable access key nonce range for implicit accounts to prevent tx hash collisions. * Upgraded our version of pwasm-utils to 0.18 -- the old one severely under-counted stack usage in some cases. ### Non-protocol Changes * Fix a bug in chunk requesting where validator might request chunks even if parent block hasn’t been processed yet. * Fix memory leak in near-network. * Change block sync to request 5 blocks at a time * Change NUM_ORPHAN_ANCESTORS_CHECK to 3 ## 1.23.0 [2021-12-13] ### Protocol Changes * Further lower regular_op_cost from 2_207_874 to 822_756. * Limit number of wasm functions in one contract to 10_000. [#4954](https://github.com/near/nearcore/pull/4954) * Add block header v3, required by new validator selection algorithm * Move to new validator selection and sampling algorithm. Now we would be able to use all available seats. First step to enable chunk only producers. ### Non-protocol Changes * Increase RocksDB cache size to 512 MB for state column to speed up blocks processing [#5212](https://github.com/near/nearcore/pull/5212) ## 1.22.0 [2021-11-15] ### Protocol Changes * Upgrade from Wasmer 0 to Wasmer 2, bringing better performance and reliability. [#4934](https://github.com/near/nearcore/pull/4934) * Lower regular_op_cost (execution of a single WASM instruction) from 3_856_371 to 2_207_874. [#4979](https://github.com/near/nearcore/pull/4979) * Lower data receipt cost and base cost of `ecrecover` host function. * Upgrade from one shard to four shards (Simple Nightshade Phase 0) ## 1.21.0 [2021-09-06] ### Protocol Changes * Fix some receipts that were stuck previously due to #4228. [#4248](https://github.com/near/nearcore/pull/4248) ### Non-protocol Changes * Improve contract module serialization/deserialization speed by 30% [#4448](https://github.com/near/nearcore/pull/4448) * Make `AccountId` strictly typed and correct by construction [#4621](https://github.com/near/nearcore/pull/4621) * Address test dependency issue #4556 [#4606](https://github.com/near/nearcore/pull/4606). [#4622](https://github.com/near/nearcore/pull/4622). * Fix neard shutdown issue [#4429](https://github.com/near/nearcore/pull/4429). #[4442](https://github.com/near/nearcore/pull/4442) ## 1.20.0 [2021-07-26] ### Protocol Changes * Introduce new host functions `ecrecover` and `ripemd160`. [#4380](https://github.com/near/nearcore/pull/4380) * Make `Account` a versioned struct. [#4089](https://github.com/near/nearcore/pull/4089) * Limit the size of transactions to 4MB. [#4107](https://github.com/near/nearcore/pull/4107) * Cap maximum gas price to 20x of minimum gas price. [#4308](https://github.com/near/nearcore/pull/4308), [#4382](https://github.com/near/nearcore/pull/4382) * Fix `storageUsage` for accounts that were affected by [#3824](https://github.com/near/nearcore/issues/3824). [#4272](https://github.com/near/nearcore/pull/4274) * Fix a bug in computation of gas for refunds. [#4405](https://github.com/near/nearcore/pull/4405) ### Non-protocol Changes * Compile contracts after state sync. [#4344](https://github.com/near/nearcore/pull/4344) * Introduce `max_gas_burnt_view` config for rpc. [#4381](https://github.com/near/nearcore/pull/4381) * Fix wasmer 0.17 memory leak [#4411](https://github.com/near/nearcore/pull/4411)