Announcing Version 1.3 of casper-node
This version of casper-node introduces smart contracting features that enable contract authors to validate the immediate caller of the contract via a new method ‘get_call_stack’ and improved support for large data structures in contracts (improved local key support) along with several networking improvements.
We also introduce the base NFT contract for the Casper system.
Details about the Release
Node RPC Enhancements
Validator rotation in Casper takes place via the on-chain auction contract. The state of this system contract can be queried via the state_get_auction_info RPC method. Previously, it was not possible to obtain historical information. The RPC now accepts a ‘block-identifier’ argument, enabling querying of historical auction information.
In prior versions, querying the global state for account information required using the generic state_get_item RPC call, creating unnecessary overhead to obtain account information. After 1.3 a new RPC call state_get_account_info will directly return account details.
Smart Contracting and Application Development Updates
The casper-node emits blockchain events via an event stream. The system emits 3 broad categories of events, deploy (transaction) events, finality signatures (sent by consensus participants signifying acceptance of a block) and system events. Previously, all of these events were emitted from a single endpoint. After 1.3, the old endpoint will no longer work, and the node will now have 3 event streams, one for each category. Please visit GitHub(GH &GH) for the new endpoint and details on the deploy stream changes.
The Casper protocol supports turing complete smart contracts using wasm. It is possible to create contracts that invoke other contracts via the ‘call-contract’ method in the smart contracting API. However, when doing this, it was not possible to validate the caller of the contract, which could pose security risks. A new method get_call_stack is available that validates the immediate caller of the contract. The auction contract has been updated to use this method to authenticate its functions based on the immediate caller of the contract, versus the user account that originates the deploy.
Before version 1.3, the global state had versioning issues between local keys and contracts because these were stored on different layers — 2 different contract versions could access data under duplicate local keys. As part of CEP 39, local keys are deprecated and a dictionary keys API is added as a separate keyspace to the storage layer. Contract developers will use this to store data in a separate keyspace, prefixed by the URef address provisioned to the contract. More details are available in GitHub(GH).
Networking Optimizations:
In networks running both bonded (validating) nodes and unbonded nodes, the network component will now check during handshake if the key belongs to a bonded validator, and prioritize message passing between validating nodes over unbonded nodes. In the event bandwidth conditions become constrained in a network, preference will be given to bonded validators for all communications, ensuring that consensus messages have the best chance to be delivered. This request rate can be configured on a given node via the config.toml file.
Previously, in instances where a large number of new peers attempt to join a network, these peers would not be considered an alternative source of block information. These kinds of peers will now be considered as candidates for downloading blocks when syncing the linear chain.
Liveness Improvements
In Casper CBC Highway protocol, validators take turns at proposing blocks, the sequence of proposal is determined pseudo randomly based on validator weights, with an auction delay between auction and beginning of an era. Since any faulty validators can eschew the proposer sequence, we introduce a new feature where a validator who was inactive/faulty in one era will be prevented from proposing blocks in the next era, giving up their slots to other validators. This improves liveness by reducing missed proposals.
About Casper
Casper lets organizations of all kinds realize the power and potential of blockchain technology. The Casper protocol powers the first fully decentralized, proof-of-stake blockchain network. Casper allows businesses to create new markets and unlock value by tokenizing nearly any asset, without compromising on performance or security. Learn more here.
Casper.network | Twitter | Telegram | Discord
About the Casper Association
The Casper Association is the nonprofit entity that oversees the ongoing evolution and decentralization of the Casper Network. It provides resources to help accelerate the adoption of Casper and its growing ecosystem of decentralized applications. Learn more here.