Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions condor/jsonrpc-comp/rpc-2.0/schema.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"title": "Client API of Casper Node",
"description": "This describes the JSON-RPC 2.0 API of a node on the Casper network.",
"contact": {
"name": "Casper Labs",
"url": "https://casperlabs.io"
"name": "Casper Association",
"url": "https://docs.casper.network"
},
"license": {
"name": "APACHE LICENSE, VERSION 2.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/economics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The fee elimination model will be different from the refund model introduced on

## Ecosystem {#ecosystem}

The ecosystem layer encompasses dApp design and operation. Casper Labs maintains multiple partnerships with prospective dApp developers, and we anticipate devoting significant resources to research the economics of prospective dApps.
The ecosystem layer encompasses dApp design and operation. Casper Association maintains multiple partnerships with prospective dApp developers, and we anticipate devoting significant resources to research the economics of prospective dApps.

## Macroeconomy {#macroeconomy}

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/glossary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /glossary

# Glossary

These definitions are correct in the context of the Casper Labs. They may (and probably will) have slightly different semantics in other contexts, including other blockchain contexts.
These definitions are correct in the context of the Casper Association. They may (and probably will) have slightly different semantics in other contexts, including other blockchain contexts.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/serialization/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum CLType {
String, // e.g. "Hello, World!"
URef, // unforgeable reference (see above)
Key, // global state key (see above)
PublicKey // A Casper system PublicKey type
PublicKey, // A Casper system PublicKey type
Option(CLType), // optional value of the given type
List(CLType), // list of values of the given type (e.g. Vec in rust)
ByteArray(CLType, u32), // same as `List` above, but number of elements
Expand Down
214 changes: 88 additions & 126 deletions docs/concepts/serialization/structures.md

Large diffs are not rendered by default.

34 changes: 8 additions & 26 deletions docs/concepts/serialization/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Hex-encoded bytes serialized as a `u32` value describing the length of the bytes

## ByteCodeKind

The type of byte code, serialized as a single `u8` value. A `0` indicates empty byte code, while a `1` indicates a `V1CasperWasm` to be executed with the first version of the Casper execution engine.
The type of byte code, serialized as a single `u8` value. A `0` indicates empty byte code. `1` indicates a `V1CasperWasm` to be executed with the first version of the Casper execution engine. `2` indicates a `V2CasperWasm` to be executed with the second version of the Casper execution engine.

## Caller {#caller}

Expand Down Expand Up @@ -252,6 +252,9 @@ ChainspecRegistry is a unique key variant which contains a mapping of file names

The checksum registry. It serializes as a `BTreeMap` where the first 4 bytes represent a `u32` value describing the number of checksum names as strings and [digests](#digest) held within. The remainder consists of a repeating pattern of serialized strings and then digests of the length dictated by the first four bytes.

## ContractRuntimeTag {#contract-runtime-tag}
A tag for the contracts runtime tag, serialized as a single `u8` tag of 0 for `VmCasperV1`, 1 for `VmCasperV2`.

## Delegator {#delegator}

Represents a party delegating their stake to a validator (or "delegatee"). The structure consists of the following fields:
Expand Down Expand Up @@ -378,9 +381,9 @@ The context of method execution. It serializes as one of the following:

- `Caller`: Serializes as a single `u8`, `0b00000000`

- `Called`: Serializes as a single `u8`, `0b00000001`
- `DirectInvocationOnly`: Serializes as a single `u8`, `0b00000001`

- `Factory`: Serializes as a single `u8`, `0b10000000`
- `SelfOnward`: Serializes as a single `u8`, `0b10000000`

## EntrypointV2

Expand Down Expand Up @@ -486,10 +489,6 @@ A (labeled) "user group". Each method of a versioned contract may be associated

They are serialized as a `BTreeMap` where the first 4 bytes represent a `u32` value describing the number of user groups and `BTreeSets` of [`URef`](./primitives.md#clvalue-uref)s held within. The remainder consists of a repeating pattern of serialized user groups and `BTreeSets` of the length dictated by the first four bytes.

## InitiatorAddr {#initiatoraddr}

The address of the initiator of a [`TransactionV1`](./structures.md#transactionV1), which serializes as a `u8` of `0` followed by a [`PublicKey`](#publickey) or a `1` followed by an [`AccountHash`](#account-hash).

## Keys {#serialization-standard-state-keys}

A _key_ in [Global State](../design/casper-design.md) is one of the following data types:
Expand Down Expand Up @@ -687,23 +686,6 @@ The lock status of the package, serialized as a [`boolean`](./primitives.md#clva

Parameter to a method, structured as a name followed by a `CLType`. It is serialized as a [`String`](./primitives.md#clvalue-string) followed by a [`CLType`](./primitives.md#clvalue-cltype).

## PricingMode {#pricingmode}

The pricing mode of a transaction, with two possible variants. It serializes as a `u8` tag followed by additional data based on the following table:

| Tag | PricingMode| Description |
| --- | ---------- | ----------- |
| 0 | Classic | The original payment model, in which the creator of a transaction specifies how much they will pay and at which gas price. |
| 1 | Fixed | The cost of the transaction is determined by the cost table, per the transaction kind. |

### Classic {#pricingmode-classic}

After the `0` tag, a `Classic` `PricingMode` serializes as the [`u64`](./primitives.md#clvalue-numeric) `payment_amount` followed by the `u64` value of the `gas_price`.

### Fixed {#pricingmode-fixed}

After the `1` tag, a `Fixed` `PricingMode` serializes as the [`u64`](./primitives.md#clvalue-numeric) `gas_price_tolerance`.

## ProtocolVersion {#protocolversion}

A newtype indicating the Casper Platform protocol version. It is serialized as three [`u32`](./primitives.md#clvalue-numeric) values indicating major, minor and patch versions in that order.
Expand Down Expand Up @@ -770,9 +752,9 @@ Entity types for system contracts, serialized as a single `u8` tag identifying t
| Tag | System Contract |
| --- | --------------- |
| 0 | `Mint` |
| 1 | `Auction` |
| 1 | `HandlePayment` |
| 2 | `StandardPayment` |
| 3 | `HandlePayment` |
| 3 | `Auction` |

## TimeDiff {#timediff}

Expand Down
160 changes: 160 additions & 0 deletions docs/developers/cli/opcode-costs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,166 @@ The static cost is a **fixed cost for each opcode that is hardcoded** and **vali

If you are building for a private network or other instance of Casper, you will need to verify these costs in the associated `chainspec.toml`.

## OpCodeCosts

|Attribute |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|bit | Bit operations multiplier. | 300 |
|add | Arithmetic add operations multiplier. | 210|
|mul | Mul operations multiplier. | 240|
|div | Div operations multiplier. | 320|
|load | Memory load operation multiplier. | 2_500|
|store |Memory store operation multiplier. | 4_700|
|const | Const store operation multiplier. | 110|
|local | Local operations multiplier. | 390|
|global | Global operations multiplier. | 390|
|integer_comparison | Integer operations multiplier. | 250|
|conversion | Conversion operations multiplier. | 420|
|unreachable | Unreachable operation multiplier. | 270|
|nop | Nop operation multiplier. | 200|
|current_memory | Get the current memory operation multiplier. | 290|
|grow_memory | Grow memory cost per page (64 kB). | 240_000|

## ControlFlowCost

|Attribute |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|block | Cost for `block` opcode. | 440|
|loop | Cost for `loop` opcode. | 440|
|if | Cost for `if` opcode. | 440|
|else | Cost for `else` opcode. | 440|
|end | Cost for `end` opcode. | 440|
|br | Cost for `br` opcode. | 35_000|
|br_if | Cost for `br_if` opcode. | 35_000|
|return | Cost for `return` opcode. | 440|
|select | Cost for `select` opcode. | 440|
|call | Cost for `call` opcode. | 68_000|
|call_indirect | Cost for `call_indirect` opcode. | 68_000|
|drop | Cost for `drop` opcode. | 440|

## `Br_Table` OpCode Costs

|Attribute |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|cost | Fixed cost per `br_table` opcode. | 35_000|
|size_multiplier | Size of target labels in the `br_table` opcode will be multiplied by `size_multiplier`. | 100|

## External Function Costs

The following costs are for low-level bindings for host-side ("external") functions. More information on the Casper external FFI can be found [here](https://docs.rs/casper-contract/latest/casper_contract/ext_ffi/index.html).

|Host-Side Function| Cost | Arguments |
| ---------------- | ---- | --------- |
| add | 5_800 | [0, 0, 0, 0] |
| add_associated_key | 1_200_000 | [0, 0, 0] |
| add_contract_version | 200 | [0, 0, 0, 0, 120_000, 0, 0, 0, 30_000, 0, 0] |
| blake2b | 1_200_000 | [0, 120_000, 0, 0] |
| call_contract | 300_000_000 | [0, 0, 0, 120_000, 0, 120_000, 0] |
| call_versioned_contract | 300_000_000 | [0, 0, 0, 0, 120_000, 0, 120_000, 0] |
| create_contract_package_at_hash | 200 | [0, 0] |
| create_contract_user_group | 200 | [0, 0, 0, 0, 0, 0, 0, 0] |
| create_purse | 2_500_000_000 | [0, 0] |
| disable_contract_version | 200 | [0, 0, 0, 0] |
| get_balance | 3_000_000 | [0, 0, 0] |
| get_blocktime | 330 | [0] |
| get_caller | 380 | [0] |
| get_key | 2_000 | [0, 440, 0, 0, 0] |
| get_main_purse | 1_300 | [0] |
| get_named_arg | 200 | [0, 120_000, 0, 120_000] |
| get_named_arg_size | 200 | [0, 0, 0] |
| get_phase | 710 | [0] |
| get_system_contract | 1_100 | [0, 0, 0] |
| has_key | 1_500 | [0, 840] |
| is_valid_uref | 760 | [0, 0] |
| load_named_keys | 42_000 | [0, 0] |
| new_uref | 17_000 | [0, 0, 590] |
| random_bytes | 200 | [0, 0] |
| print | 20_000 | [0, 4_600] |
| provision_contract_user_group_uref | 200 | [0, 0, 0, 0, 0] |
| put_key | 100_000_000 | [0, 120_000, 0, 120_000] |
| read_host_buffer | 3_500 | [0, 310, 0] |
| read_value | 60_000 | [0, 120_000, 0] |
| read_value_local | 5_500 | [0, 590, 0] |
| remove_associated_key | 4_200 | [0, 0] |
| remove_contract_user_group | 200 | [0, 0, 0, 0] |
| remove_contract_user_group_urefs | 200 | [0, 0, 0, 0, 0, 120_000] |
| remove_key | 61_000 | [0, 3_200] |
| ret | 23_000 | [0, 420_000] |
| revert | 500 | [0] |
| set_action_threshold | 74_000 | [0, 0] |
| transfer_from_purse_to_account | 2_500_000_000 | [0, 0, 0, 0, 0, 0, 0, 0, 0] |
| transfer_from_purse_to_purse | 82_000_000 | [0, 0, 0, 0, 0, 0, 0, 0] |
| transfer_to_account | 2_500_000_000 | [0, 0, 0, 0, 0, 0, 0] |
| update_associated_key | 4_200 | [0, 0, 0] |
| write | 14_000 | [0, 0, 0, 980] |
| dictionary_put | 9_500 | [0, 1_800, 0, 520] |
| enable_contract_version | 200 | [0, 0, 0, 0] |
| manage_message_topic | 200 | [0, 30_000, 0, 0] |
| emit_message | 200 | [0, 30_000, 0, 120_000] |
| cost_increase_per_message | 50 | |

### `Auction` System Contract Costs

These are the costs of calling `auction` system contract entrypoints.

|Entrypoint |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|get_era_validators | Cost of calling the `get_era_validators` entrypoint. | 10_000|
|read_seigniorage_recipients | Cost of calling the `read_seigniorage_recipients` entrypoint. | 10_000|
|add_bid | Cost of calling the `add_bid` entrypoint. | 2_500_000_000|
|withdraw_bid | Cost of calling the `withdraw_bid` entrypoint. | 2_500_000_000|
|delegate | Cost of calling the `delegate` entrypoint. | 2_500_000_000|
|undelegate | Cost of calling the `undelegate` entrypoint. | 2_500_000_000|
|run_auction | Cost of calling the `run_auction` entrypoint. | 10_000|
|slash | Cost of calling the `slash` entrypoint. | 10_000|
|distribute | Cost of calling the `distribute` entrypoint. | 10_000|
|withdraw_delegator_reward | Cost of calling the `withdraw_delegator_reward` entrypoint. | 10_000|
|withdraw_validator_reward | Cost of calling the `withdraw_validator_reward` entrypoint. | 10_000|
|read_era_id | Cost of calling the `read_era_id` entrypoint. | 10_000|
|activate_bid | Cost of calling the `activate_bid` entrypoint. | 10_000|
|redelegate | Cost of calling the `redelegate` entrypoint. | 2_500_000_000|
|change_bid_public_key | Cost of calling the `change_bid_public_key` entrypoint. | 5_000_000_000 |

### `Mint` System Contract Costs

These are the costs of calling `mint` system contract entrypoints.

|Entrypoint |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|mint | Cost of calling the `mint` entrypoint. | 2_500_000_000|
|reduce_total_supply | Cost of calling the `reduce_total_supply` entrypoint. | 10_000|
|create | Cost of calling the `create` entrypoint. | 2_500_000_000|
|balance | Cost of calling the `balance` entrypoint. | 10_000|
|burn | Cost of calling the `burn` entrypoint. | 10_000|
|transfer | Cost of calling the `transfer` entrypoint. | 10_000|
|read_base_round_reward | Cost of calling the `read_base_round_reward` entrypoint. | 10_000|
|mint_into_existing_purse | Cost of calling the `mint_into_existing_purse` entrypoint. | 2_500_000_000|


### `Handle_Payment` System Contract Costs

These are the costs of calling entrypoints on the `handle_payment` system contract.

|Entrypoint |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|get_payment_purse | Cost of calling the `get_payment_purse` entrypoint. |10_000|
|set_refund_purse | Cost of calling the `set_refund_purse` entrypoint. |10_000|
|get_refund_purse | Cost of calling the `get_refund_purse` entrypoint. |10_000|
|finalize_payment | Cost of calling the `finalize_payment` entrypoint. |10_000|

### `Standard_Payment` System Contract Costs

These settings manage the costs of calling entrypoints on the `standard_payment` system contract.

|Entrypoint |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|pay| Cost of calling the `pay` entrypoint and sending an amount to a payment purse. |10_000|

## StorageCosts

|Attribute |Description | Cost |
|----------------- |-----------------------------------------------|-----------------|
|gas_per_byte | Gas charged per byte stored in global state. | 1_117_587|

:::note

Expand Down
6 changes: 3 additions & 3 deletions docs/operators/setup/install-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Ensure the requirements listed in the following sections are met before you star
The following ports are used by the node:

- 35000 (required to be externally visible)
- 7777 RPC endpoint for interaction with JSON-RPC API
- 7777 RPC endpoint for interaction with JSON-RPC API (The default port for JSON-RPC server, is now served by Casper Sidecar from Casper 2.0 onwards)
- 8888 REST endpoint for status and metrics (having this accessible allows your node to be part of network status)
- 9999 SSE endpoint for event stream

Expand Down Expand Up @@ -125,9 +125,9 @@ In the past, we have used a lower `trusted_hash`. Connecting at the tip, we now

### Node Address

NODE_ADDR can be set to an IP of a trusted node, or to Casper Labs' public nodes
NODE_ADDR can be set to an IP of a trusted node, or to Casper Association's public nodes

You can find active peers at https://cspr.live/tools/peers or use the following Casper Labs public nodes:
You can find active peers at https://cspr.live/tools/peers or use the following Casper Association public nodes:

* Testnet - NODE_ADDR=https://node.testnet.casper.network

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.0.0/concepts/accounts-and-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ By default, a transactional interaction with the blockchain takes the form of a

The Casper platform supports two types of keys for creating accounts and signing transactions:
- [Ed25519](#eddsa-keys) keys, which use the Edwards-curve Digital Signature Algorithm (EdDSA) and are 66 characters / 33 bytes long and comprising of;
- - `01` - 1 byte prefix (indicates `Ed25519` key type in Casper)
- `01` - 1 byte prefix (indicates `Ed25519` key type in Casper)
- 32 bytes of actual `Ed25519` public key data
- Example: [`01a0d23e084a95cdee9c2fb226d54033d645873a7c7c9739de2158725c7dfe672f`](https://cspr.live/account/01a0d23e084a95cdee9c2fb226d54033d645873a7c7c9739de2158725c7dfe672f)

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.0.0/concepts/economics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The fee elimination model will be different from the refund model introduced on

## Ecosystem {#ecosystem}

The ecosystem layer encompasses dApp design and operation. Casper Labs maintains multiple partnerships with prospective dApp developers, and we anticipate devoting significant resources to research the economics of prospective dApps.
The ecosystem layer encompasses dApp design and operation. Casper Association maintains multiple partnerships with prospective dApp developers, and we anticipate devoting significant resources to research the economics of prospective dApps.

## Macroeconomy {#macroeconomy}

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.0.0/concepts/glossary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /glossary

# Glossary

These definitions are correct in the context of the Casper Labs. They may (and probably will) have slightly different semantics in other contexts, including other blockchain contexts.
These definitions are correct in the context of the Casper Association. They may (and probably will) have slightly different semantics in other contexts, including other blockchain contexts.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Account {#serialization-standard-account}

An Account is a structure that represented a user on a Casper network. The account structure consists of the following fields:
An Account is a structure that represented a user on Casper network.

The account structure consists of the following fields:

- [`account_hash`](./types.md#account-hash)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Hex-encoded bytes serialized as a `u32` value describing the length of the bytes

## ByteCodeKind

The type of byte code, serialized as a single `u8` value. A `0` indicates empty byte code. `1` indicates a `V1CasperWasm` to be executed with the first version of the Casper execution engine. `2` indicates a `V2CasperWasm` to be executed with the first version of the Casper execution engine
The type of byte code, serialized as a single `u8` value. A `0` indicates empty byte code. `1` indicates a `V1CasperWasm` to be executed with the first version of the Casper execution engine. `2` indicates a `V2CasperWasm` to be executed with the second version of the Casper execution engine.

## Caller {#caller}

Expand Down
Loading