The Leap v5.0.0 stable release introduces several exciting enhancements and addresses a security issue.
| 📝 | This release includes a change to base64 encoding that is incompatible with versions of leap prior to 3.2.5.For more details, see PR 1888. |
|---|
At a Glance:
Leap v5.0.0 is designed to be more performant, efficient, and reliable. Some notable achievements with this release include:
- Up to 5x faster execution of system contracts (including EOS EVM)
- Up to 4X speed improvement and more reliable atomic API calls with non-blocking serialization
- Up to 20% reduction in system memory consumption by state database
- High scale read-only-transactions with parallel processing up to 128 parallel threads
- Support for larger transactions with relaxed constraints
- More reliable block production by optimizing block start time to reduce latency between rounds
- Customizable endpoints for more control over networking
See the Upgrade Guide for details on required/recommended configuration changes, deprecations and new Benefit
Achieved by
Enabled by
Leap 5 modifies the behavior controlled by two parameters that constrained the execution of smart contracts.
The first parameter is Since the objective The second parameter is Since the objective When upgrading to Leap 5+, node operators:
Benefits
Achieved by
Enabled by
Leap 4 introduced parallel execution for both read only transactions (made by smart contracts) and read only RPC APIs (like get_block_info, get_transaction_id, etc). However, this initial implementation had to restrict the number of read-only threads up to 8 due to large memory usage.
Leap 5 restructures the underlying execution engine EOS VM, reducing memory usage and making parallelism more natural. The limit has been increased up to 128 threads. This unlocks another option for developers. Read-only solutions are a cheap, fast, and easy way to access data, cutting down on the need for additional history solutions and secondary data caches. Combined with natively supported tables and indexing EOS blockchain can be your one and only distributed database.
Benefits
Achieved by
Leap 5 enhances EOS node performance by moving ABI serialization off the main thread and introducing improved time constraints. Most notably, ABI intensive requests (like get_block) are up to 4X faster.
Previously Leap would error out to avoid long running deserialization processes that tie up reasources. In Leap 5.0 this behaviour changes. In Leap 5, when a specific object deserialization takes longer than Benefits
Achieved by
Leap v5.0.0 includes changes to the Leap Producer Plugin aimed at optimizing block start and release timings. The updates are designed to maximize transaction throughput while minimizing latency, delayed block starts, and other inefficiencies by introducing a more dynamic and efficient block production strategy.
Prior to this update, the block production was strictly timed to the config::block_interval_us (e.g., 500 ms), with a designated cpu-effort-percent (e.g., 80%), resulting in a mandatory idle time between block productions. This rigid schedule often led to delayed starts for subsequent blocks and underutilized CPU time.
The update introduces a new configuration parameter, With the new update, blocks are now produced and released back-to-back without any idle time, allowing the last block of each production round to be transmitted to the next producer more promptly ensuring that subsequent producers can commence their block production exactly on schedule. Overall, this update ensures that blockchain networks with nodes running Leap v5.0.0 are more responsive and efficient, especially in scenarios with high transaction volumes.
See PR 867 & PR 1800 for complete details on the change. BP Documentation has been updated.
Benefits
Achieved By
With Leap 5, Benefits
Achieved By
Leap 5 enables node operators to sync more efficiently. Peer Latency Tracking prioritizes peers with the lowest latency for faster and more reliable sync. Block Buffering ensures maximum CPU utilization by fetching the next block batch while applying the current one.
Smarter block deadlines optimize transactions scheduled in a block to reduce micro-forking. In previous Leap versions, speculative transaction would be queued up until a new block arrives, causing stale or aborted blocks and unnecessarily delaying read-only transaction. In Leap v5.0.0 speculative blocks scheduling is optimized to prevent unneeded block aborts, and increase liveliness of transactions.
Summary of changes
Benefits
Achieved By
Chainbase is the database which holds all the smart contract state in memory (RAM) for Antelope blockchains. The state is stored in (key, value) maps implemented using red-black trees. Each (key, value) pair is stored in a node, and requires three pointers (parent, left, right) and a color (a small integer able to store at least three different values).
In all versions of Leap until 5.0, these four members occupied 32 bytes of memory (three eight byte pointers, and the small integer also used 8 bytes because of alignment).
In Leap 5.0, these four members are stored in a compressed form occupying only 16 bytes, where each pointer is represented by a 42 bit offset for a total of 126 bits, leaving 2 bytes for the color member (allowing for four different values).
Our measurements show that this compressed representation allows for a Chainbase memory reduction of about 20%, with a negligible performance impact. This is one of the ways that Leap 5.0 will better utilize a given hardware, and be able to run higher blockchain loads than previous versions.
Benefits Achieved by Caution Leap 5.0 supports a new Similar to Similar to This reduces the wear-and-tear on the disk used to hold the chain state database. Also startup and termination times should be faster than with A potential issue with the new Please note that using a Loading the chain state database to and from RAM (in the In Leap 5.0 this requirement was lowered to one time Benefits
Achieved by
Leap 5 leverages OC for the EOS VM by implementing an Auto OC Mode as the default setting. This new mode, Benefits
Achieved By
For endpoint configuration purposes, API endpoints are now grouped into several categories. You can specify different server addresses for each category. Server address can be IPv4 and port: Example configuration:
See PR #1137 for the full list of categories and configuration options.
Benefits
Achieved By
In Leap 5, Prometheus metrics are now tracked for each peer. These stats can be rendered in a terminal with a text-based user interface similar to Changes
Deferred Transactions have been removed. The configuration option Nodes running Leap 5 will not execute or process scheduled transactions. Instead, scheduled transactions will expire without execution releasing the RAM when they expire.
Version 5.0 additionally introduces protocol features that impact the validation of blocks with deferred transactions. Once activated, blocks with deferred transactions will no longer be considered valid.
Remove Deferred Transactions A security vulnerability has been mitigated, preventing errors in Node Operators that depend on snapshots or Reproducible Builds: Pinned builds are no longer built via a script ( CICD: Enhanced branch protection and integration with CI Build & Test workflow for more stable builds.
Changes to Ubuntu Support: Support for Ubuntu 18.04 has been dropped. Due to changes in the build process, separate replace pinned builds with reproducible pinned builds Benefits
Achieved by
The C++ standard has been upgraded to C++20 for Leap 5. This will provide an array of benefits for core development. C++20 allows for simpler, cleaner code and provides new standard features and libraries.
Here are some examples of future improvements that are now possible:
Update C++ standard to C++20 Fix Benefits
Achieved by
Leap 5 introduces a new implementation of a math library for the BLS12-381 elliptic curve to enabling creation and validation of BLS signatures (including aggregate signatures) ultimately in support of Instant Finality. BLS12-381 can also serve as the foundation for zero-knowledge proof systems such as Groth16 in Zcash's Sapling upgrade. The BLS host functions empower EOS contract developers to validate zero-knowledge proofs more efficiently, unlocking new possibilities for systems that can protect the privacy of users' financial data.
New Host Functions:
Availability of these host functions is controlled with a new protocol feature Before this change, these wasm config settings were included in the response regardless of the protocol features in use. However, it has been recognized that these settings are only valid and relevant when the With this update, a change has been made to the behavior of the This modification ensures that clients requesting consensus parameters receive only the information that is applicable to the current protocol configuration, making the responses more accurate and relevant.
For complete details on this change see PR 1770.
Avoid port remapping hassles for multi node setups with Leap 5's full support for IPv6 in all HTTP endpoints for all nodeos plugins. Disable Replay Opts by default if statehist plugin enabled
Prometheus: Add speculative block metrics Make transaction generator a configurable option to Tra Full Changelog: v4.0.5...v5.0.0
nodeos options.
Leap v5.0.0 Release Notes
Relaxed Constraints
Larger Transactions
Quick Summary
max-nonprivileged-inline-action-size
max-transaction-time
Details
max-nonprivileged-inline-action-size which, while technically configurable, in practice capped the size of inline actions sent by regular contracts to 4 KiB. This parameter has been removed from Leap 5 so that the only constraint on inline action size comes from the objective limit (max_inline_action_size) that is managed on-chain.
max_inline_action_size limit is typically higher (it is 512 KiB on EOS), the removal of the max-nonprivileged-inline-action-size unlocks behavior in smart contracts that was previously constrained. For example, on the EOS network, EOS EVM’s new call action could be used to deploy EVM contracts greater in size than 4 KiB from an EOS smart contract.
max-transaction-time which limits the duration a transaction is allowed to execute as measured by wall-clock time. This parameter is not removed from Leap 5 but its default value is changed to instead effectively drive the transaction wall-clock deadline by the objective limit (max_transaction_cpu_usage) that is managed on-chain.
max_transaction_cpu_usage limit is typically higher (it is 150 ms on EOS), the change of default value for max-transaction-time allows transactions to do more work within the longer time duration allotted to them. For example, on the EOS network, EOS EVM can take advantage of the relaxed transaction wall-clock deadline to successfully execute more computationally-heavy EVM transactions that may have been rejected previously.
max-nonprivileged-inline-action-size parameter is not in config.ini so nodeos can start.
max-transaction-time parameter to allow enforcement of the transaction wall-clock deadline to be driven by the objective on-chain limit.
Related Development
max-transaction-time
Increased Speed
Improved Read Performance
Quick Summary
Details
Related Development
Non-blocking ABI Serialization
Quick Summary
Details
abi-serializer-max-time-ms, it will be returned in binary form. This applies to requests that return multiple item. This includes get_block, get_account, and get_table_rows.
Related Development
chain_plugin: get_table_rows and get_account
Improved Efficiency
Optimized Block Start Time
Details
produce-block-offset-ms, which dictates the time reserved at the end of a 12-block production round for the last block to reach the next producer. This parameter can be set to more than 500 milliseconds if necessary, allowing greater flexibility in block production timing. The new system calculates the early release of each block in a round, adjusting the production timing dynamically based on network conditions and the fullness of each block. This method ensures that blocks are transmitted and validated more efficiently, accommodating network latencies and varying block sizes.
Related Development
Asynchronous Block Fetching
Details
nodeos now pulls downs new blocks independantly of block processing, allowing seemless and continuous processing of blocks
Related Development
P2P Latency Optimizations
Details
sync-peer-limit) to limit the number of peers to sync from (default 3).
time_message
sync-peer-limit
sync-fetch-span is now 1000 (up from 100)
Related Development
Memory Optimized Chainbase
Quick Summary
Details
Related Development
New mode for managing in-state memory
Quick Summary
Much lower disk IO resulting in higher throughput and lower write operations.
Limits memory usage to state database that is actually accessed, and not the full configured chain-state-db-size-mb, while persisting state to disk during shutdown.
If there is not enough memory to hold the state database nodeos will crash, and the state will be lost.
Details
New chain_plugin option for
database-map-modemapped_private option for database-map-mode, which attemps to combine most of the benefits of mapped and heap modes, but opens the possibility of nodeos crashing in constrained memory environments.
mapped mode, the resident memory usage is limited to the part of the state database that is actually accessed, and not the full configured chain-state-db-size-mb as in heap and locked modes.
heap and locked modes, the database modified pages are not written back to disk during nodeos execution. Only at nodes normal termination are the modified pages written back to disk, updating the chain state database.
heap and locked modes.
mapped_private option is that, if the system does not have enough available RAM to hold the accessed part of the state database (around 20GB for EOS today), nodeos can crash with an out of memory error. So we recommend using this option on systems with sufficient RAM, but which may not have quite as much as is required for heap and locked modes.
tmpfs file system provides only benefits in mapped mode, it is mostly a waste of RAM in all other modes. nodeos now checks when this mismatch occurs, and will error at startup.
Improvement in
locked and heap modeslocked and heap modes) was memory intensive, accessing a virtual memory space of two times chain-state-db-size-mb.
chain-state-db-size-mb + 1GB.
Related Development
CPU Optimized Smart Contracts
Quick Summary
Details
eos-vm-oc-enable=auto, automatically applies OC when appropriate, optimizing the execution of transactions and improving overall throughput.
Context
OC?
Building block
baseline, but OC if account is eosio.*
Applying block
OC, or
if producer: baseline, but OC if account is eosio.*
Speculatively executing trx from p2p or HTTP
baseline, but OC if account is eosio.*
Compute transaction
baseline, but OC if account is eosio.*
Read only transaction
OC
Related Developement
Enhanced Control
Customizable Peer Networking
Quick Summary
--p2p-listen-endpoint and --p2p-server-address to be specified multiple times
Details
27.0.0.1:8080, IPv6 and port: [2001:db8:3c4d:15::1a2f:1a2b]:8080, Hostname and port: example.com:8080, or unix socket path: ./relative/unix_path.sock. For backward compatibility, the HTTP category facility has to be opted in by specifying http-server-address = http-category-address explicitly. When http-server-address = http-category-address, all the unspecified categories are considered disabled.
http-server-address = http-category-address
http-category-address = chain_ro,127.0.0.1:8081
http-category-address = chain_ro,:9090
http-category-address = chain_rw,[::1]:8082
http-category-address = net_ro,127.0.0.1:8081
http-category-address = net_rw,[::]:8083
http-category-address = producer_ro,/tmp/absolute_unix_path.sock
http-category-address = producer_rw,./relative/unix_path.sock
http-category-address = snapshot,./relative/unix_path.sock
Related Development
Peer-level tracking in Prometheus
Quick Summary
Details
top or ntop.
nodeos_p2p_connections
accepting_blocks
last_received_block
first_available_block
last_available_block
unique_first_block_count
latency
bytes_received
bytes_sent
connection_start_time
Related Development
Other Changes
Deprecations & Removals
Deferred Transactions Removed
max-scheduled-transaction-time-per-block-ms has been removed, and Leap now behaves as if this option had been set to 0. As stated in the upgrade guide, node operators must remove this configuration option.
Default Behavior for Scheduled Transactions:
Protocol Feature and Block Validation:
Related Development
Remove defer transaction configuration options and block incoming delayed transactions
Implement DISABLE_DEFERRED_TRXS_STAGE_1 and DISABLE_DEFERRED_TRXS_STAGE_2 protocol features
Get Block Header State Deprecated
v1/chain/get_block_header_state is deprecated in v5.0.0 and will be removed in v6.0.0
Security Updates
Mitigation of Potential Denial of Service for Snapshots & SHiP
state_history_plugin and snapshot functionality in certain edge case conditions (PR 1964).
state_history_plugin with chain-state-history enabled should upgrade. Users running state_history_plugin with only trace-history are not affected.
Build, Binaries & Platform Support
pinned_build.sh) but now via Docker. The containerization of the build allows the resulting .deb package to be reproducible. README.md contains updated instructions for those wanting to perform a reproducible pinned build.
.deb packages for different Ubuntu versions are no longer required. Only a single .deb package will be released which can be installed on all versions of Ubuntu that Leap supports.
Related Development
fix "All Required Tests Passed" CI Branch Protection
integrate reproducible build with CI Build & Test workflow
automatically create experimental-binaries package on release
fix release workflow's artifact download to wait-for-exact-target not wait-for-exact-target-workflow
Upgrade to C++20
Quick Summary
Details
Related Development
C++20 support - add boost 1.82 as a submodule
Bug Fixes
http_port in boot script
fix leaky EOS VM OC executor code mapping
Smarter block deadlines for speculative blocks
Fix base64 encoding
Guard Against crashes in HTTP when making addition nodeos calls
Make sure all exceptions are caught when executing code
Signal accepted_block after it is marked valid
Miscellaneous
New BLS Cryptographic Primitives
Quick Summary
Details
bls_g1_add
bls_g2_add
bls_g1_weighted_sum
bls_g2_weighted_sum
bls_pairing
bls_g1_map
bls_g2_map
bls_fp_mod
bls_fp_mul
bls_fp_exp
BLS_PRIMITIVES2.
Related Development
n=0
Only return wasm config settings if configurable wasm limits enabled
CONFIGURABLE_WASM_LIMITS2 protocol feature is active.
/v1/chain/get_consensus_parameters endpoint. The wasm config settings, which include various parameters related to WebAssembly execution, will now only be returned if the protocol feature CONFIGURABLE_WASM_LIMITS2 is enabled.
Full IPv6 Support
See the complete details of this change
Changes to Options
Changes to Logging & Help
Prometheus: Add stable identifier for P2P connections(#1750)
Added stable identifiers for P2P connections and ensured valid unique_conn_node_id. (PRs #1879).
Print non-default options on startup/shutdown
Changes to Performance Harness
Create performance harness module
Create workflow for manually dispatching performance harness runs
Create workflow to test backward compatibility of performance harness
Performance test - use 475ms for max_transact
Create stub workflow for manual dispatch performance harness runs
Create stub workflow ph_backward_compatibility.yaml
Read-Only transaction support
Complete Change Log
ignoring packed attribute warning on IR::ControlStructureImm by @spoonincode in #866
ctest --test-dir usage that is cmake 3.20+ by @spoonincode in #961
next_function and its variant parameter by @greg7mdp in #973
get_account by @greg7mdp in #1004
const & instead of by value. by @greg7mdp in #1038
string include for some newer libc++ versions by @spoonincode in #1044
chain_plugin: get_table_rows and get_account by @greg7mdp in #1054
-std=c++20 by @greg7mdp in #1086
std::result_of was deprecated in C++17, removed in C++20. by @greg7mdp in #1107
subprocess_results.log around when test fails by @oschwaldp-oci in #1161
onblock and update saved log file for tests by @greg7mdp in #1183
} in log statement by @spoonincode in #1211
i256 key type conversion by initialize buffer before usage by @learnforpractice in #1252
net_plugin by @greg7mdp in #1253
FC_USE_PTHREAD_NAME_NP & pthread_getname_np() usage by @spoonincode in #1317
EINVAL a fatal accept error in fc's listener; fixing keosd on macOS by @spoonincode in #1318
*.gdb_history to .gitignore by @greg7mdp in #1367
DEBIAN_FRONTEND & TZ globally during libtester job by @spoonincode in #1444
.gitignore cleanup - mostly stop ignoring *.cmake files. by @greg7mdp in #1460
bn256 submodule to tip. by @greg7mdp in #1474
-Wsign-compare warnings by @greg7mdp in #1471
bad_alloc_test when ASAN enabled by @spoonincode in #1479
string from test contract's _abi() call instead of vector to avoid non-null terminated char* access by @spoonincode in #1478
n=0 by @spoonincode in #1473
[[nodiscard]] attributes and remove unused type by @greg7mdp in #1500
const to operator== & operator!= to avoid c++20 warning in chainbase by @spoonincode in #1524
http_port in boot script by @YaroShkvorets in #1567
bls12-381 submodule to tip (comparison operators) by @greg7mdp in #1564
COMPILE_FLAGS for INCLUDE_DIRECTORIES in fc's rapidjson cmake by @spoonincode in #1591
cfile's fclose() to avoid warning on latest glibc by @spoonincode in #1592
to_string() call by @spoonincode in #1627
typename for newer clang compilers by @spoonincode in #1628
BLS_PRIMITIVES to bios boot tutorial script by @spoonincode in #1647
nullptr inside WAVM serialization by @spoonincode in #1654
ATOMIC_VAR_INIT from eos-vm by @spoonincode in #1673
custom_appbase_tests by @spoonincode in #1674
platform-cache-workflow to manage Dockerfile caching in CI by @spoonincode in #1703
.tar.zst out of cpack instead of .tar.gz by @spoonincode in #1714
--eos-vm-oc-enable option in tests when OC is available, and tweak/fix location of its usage by @spoonincode in #1792
cpu-effort-percent with produce-block-offset-ms by @heifner in #1800
experimental-binaries package on release by @spoonincode in #1797
snapshot_scheduler_test by @spoonincode in #1821
mapped mode when loading a snapshot in mapped_private mode. by @greg7mdp in #1825
wait-for-exact-target not wait-for-exact-target-workflow by @spoonincode in #1867
experimental-binaries creation on releases: lowercase org name in image tag by @spoonincode in #1972
fp::operator==() by @heifner in #1994
free() -- not delete -- for aligned_alloc() pointer by @spoonincode in #1978
tellp() during snapshot creation boosting performance by @spoonincode in #2026