diff --git a/docs/architecture.md b/docs/architecture.md index 998b648b5..7db03db85 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -2,7 +2,7 @@ title: Architecture authors: Tim McMackin last_update: - date: 6 February 2024 + date: 10 June 2024 --- The Tezos blockchain is composed of many Tezos nodes running around the world, complemented by other running daemons, such as bakers and accusers. @@ -76,7 +76,19 @@ It also provides the logic that identifies erroneous blocks. Updates to the protocol can change this logic through a voting process, using dedicated voting operations such as protocol proposals or protocol upvotes. For information about the voting process, see [Governance](./architecture/governance). -## The shell +The protocol has constants such as the time between blocks and the amount of tez that an account must stake to be a baker. +These constants can be different for different Tezos networks. + +To get the constants for a network, call the `GET /chains/main/blocks/head/context/constants` RPC endpoint. +For example, to get the constants of the network that the Octez client is currently connected to, run this command: + +```bash +octez-client rpc get /chains/main/blocks/head/context/constants +``` + +For more information about constants, see [Protocol constants](https://tezos.gitlab.io/alpha/protocol_overview.html#protocol-constants) in the Octez documentation. + +### The shell The shell is responsible for the fundamental functions of a distributed software application, including: diff --git a/docs/architecture/data-availability-layer.md b/docs/architecture/data-availability-layer.md index 82a0b6f4f..ee8e26f46 100644 --- a/docs/architecture/data-availability-layer.md +++ b/docs/architecture/data-availability-layer.md @@ -2,14 +2,9 @@ title: The Data Availability Layer authors: "Tim McMackin" last_update: - date: 7 February 2024 + date: 10 June 2024 --- -:::note Experimental -The Data Availability Layer is an experimental feature that is not yet available on Tezos Mainnet. -The way the DAL works may change significantly before it is generally available. -::: - The Data Availability Layer (DAL) is a companion peer-to-peer network for the Tezos blockchain, designed to provide additional data bandwidth to Smart Rollups. It allows users to share large amounts of data in a way that is decentralized and permissionless, because anyone can join the network and post and read data on it. diff --git a/docs/architecture/smart-rollups.md b/docs/architecture/smart-rollups.md index 449e9b203..d98d8d6fe 100644 --- a/docs/architecture/smart-rollups.md +++ b/docs/architecture/smart-rollups.md @@ -2,7 +2,7 @@ title: Smart Rollups authors: 'Nomadic Labs, TriliTech, Tim McMackin' last_update: - date: 11 March 2024 + date: 10 June 2024 --- Smart Rollups play a crucial part in providing high scalability on Tezos. @@ -25,7 +25,7 @@ For reference on Smart Rollups, see [Smart Optimistic Rollups](https://tezos.git This diagram shows a high-level view of how Smart Rollups interact with layer 1: ![Diagram of Smart Rollup architecture](/img/architecture/smart-rollup-architecture.png) - ## Uses for Smart Rollups @@ -42,9 +42,14 @@ For example, Smart Rollups enable [Etherlink](https://www.etherlink.com/), which ## Communication -Smart Rollups have access to two sources of information: the rollup inbox and the reveal data channel. +Smart Rollups are limited to information from these sources: + +- The Smart Rollup inbox, which contains messages from layer 1 to all rollups +- The reveal data channel, which allows Smart Rollups to request information from outside sources +- The [Data availability layer](./data-availability-layer) + These are the only sources of information that rollups can use. -In particular, Smart Rollup nodes cannot communicate directly with each other; they do not have a peer-ro-peer communication channel like layer 1 nodes. +In particular, Smart Rollup nodes cannot communicate directly with each other; they do not have a peer-to-peer communication channel like layer 1 nodes. ### Rollup inbox @@ -156,7 +161,10 @@ This kind of Smart Rollup is called a Smart Optimistic Rollup because the commit When there is only one commitment left, either because all nodes published identical commitments during the whole refutation period or because this commitment won the refutation games and eliminated all other commitments, then this correct commitment can be _cemented_ by a dedicated layer 1 operation and becomes final and unchangeable. The commitments for the next commitment period build on the last cemented commitment. -The refutation period lasts 2 weeks on Mainnet; it can be different on other networks. +The refutation period lasts for a set number of blocks based on the `smart_rollup_challenge_window_in_blocks` protocol constant. +For example, currently the refutation period lasts 120,960 blocks on Mainnet. +Mainnet has 10 seconds between blocks as of the Paris protocol upgrade, which means that the refutation period lasts 2 weeks. +Ghostnet has 5 seconds between blocks but its refutation period is twice as many blocks, so its refutation period is also two weeks long. ### Triggering outbox messages diff --git a/docs/smart-contracts/data-types/complex-data-types.md b/docs/smart-contracts/data-types/complex-data-types.md index c120d688f..a3ef804cb 100644 --- a/docs/smart-contracts/data-types/complex-data-types.md +++ b/docs/smart-contracts/data-types/complex-data-types.md @@ -2,7 +2,7 @@ title: Complex data types authors: 'Mathias Hiron (Nomadic Labs), Sasha Aldrick (TriliTech), Tim McMackin (TriliTech)' last_update: - date: 5 October 2023 + date: 17 June 2024 --- Tezos contracts support these complex data types. @@ -17,6 +17,15 @@ The high-level languages may implement these data types slightly differently, bu - [Variants and Unions](#variants) - [Lambdas](#lambdas) - [Tickets](#tickets) +- [Unit](#unit) + +This list is intended for general information for developers and is not intended to be comprehensive. +For a complete list of data types that are available, see the reference information for the language that you are using: + +- Michelson: [Types](https://tezos.gitlab.io/michelson-reference/#types) +- LIGO: [Introduction](https://ligolang.org/docs/intro/introduction?lang=jsligo) +- Archetype: [Types](https://archetype-lang.org/docs/reference/types) +- SmartPy: [Overview](https://smartpy.io/manual/syntax/overview) ## Pairs {#pairs} @@ -456,3 +465,28 @@ Contracts can run these operations on tickets: - LIGO: [Tickets](https://ligolang.org/docs/reference/current-reference#tickets) - Archetype: [create_ticket and related](https://archetype-lang.org/docs/reference/expressions/builtins/#create_ticket%28s%20:%20T,%20n%20:%20nat%29) - SmartPy: [Tickets](https://smartpy.io/manual/syntax/tickets) + +## Unit {#unit} + +In Tezos, the `unit` type contains a single value that holds no information. +Smart contracts use unit values as placeholders where a variable is required but no other information is needed. +It is the input type of functions taking no input, the output type of functions producing no output, and the storage type of contracts storing no information. + +For example, if a LIGO entrypoint receives no parameter, the data type of the entrypoint's parameter is `unit`: + +```jsligo +@entry +const myentrypoint = (_unusedParameter: unit, store: storageType): returnType => { + // ... +} +``` + +Similarly, if you call this entrypoint with the Octez client and omit the `--arg` argument to pass no parameter, the client passes unit in the background. + +Unit is a concept that Tezos inherits from OCaml; see [Side-Effects and the unit Type](https://ocaml.org/docs/tour-of-ocaml#side-effects-and-the-unit-type) in the OCaml documentation. + +### Implementation details + +- LIGO: [Unit](https://ligolang.org/docs/variants/unit/?lang=jsligo) +- Archetype: [Unit](https://archetype-lang.org/docs/reference/types/#unit) +- SmartPy: [Unit](https://smartpy.io/manual/syntax/unit) diff --git a/docs/smart-contracts/data-types/primitive-data-types.md b/docs/smart-contracts/data-types/primitive-data-types.md index 629d5cfce..2ef3f15e0 100644 --- a/docs/smart-contracts/data-types/primitive-data-types.md +++ b/docs/smart-contracts/data-types/primitive-data-types.md @@ -2,7 +2,7 @@ title: Primitive data types authors: 'Mathias Hiron (Nomadic Labs), Sasha Aldrick (TriliTech), Tim McMackin (TriliTech)' last_update: - date: 4 October 2023 + date: 4 June 2024 --- Tezos contracts support these primitive data types. @@ -16,6 +16,14 @@ The high-level languages may implement these data types slightly differently, bu - [Timestamps](#timestamps) - [Addresses](#addresses) +This list is intended for general information for developers and is not intended to be comprehensive. +For a complete list of data types that are available, see the reference information for the language that you are using: + +- Michelson: [Types](https://tezos.gitlab.io/michelson-reference/#types) +- LIGO: [Introduction](https://ligolang.org/docs/intro/introduction?lang=jsligo) +- Archetype: [Types](https://archetype-lang.org/docs/reference/types) +- SmartPy: [Overview](https://smartpy.io/manual/syntax/overview) + ## Numeric data types: `int` and `nat` {#numeric} Integers (`int`) are whole numbers that can be positive or negative. diff --git a/docs/tutorials/build-files-archive-with-dal.md b/docs/tutorials/build-files-archive-with-dal.md index 16cb73393..5d097dae1 100644 --- a/docs/tutorials/build-files-archive-with-dal.md +++ b/docs/tutorials/build-files-archive-with-dal.md @@ -2,14 +2,9 @@ title: Implement a file archive with the DAL and a Smart Rollup authors: 'Tezos Core Developers' last_update: - date: 9 February 2024 + date: 10 June 2024 --- -:::note Experimental -The Data Availability Layer is an experimental feature that is not yet available on Tezos Mainnet. -The way the DAL works may change significantly before it is generally available. -::: - The Data Availability Layer (DAL) is a companion peer-to-peer network for the Tezos blockchain, designed to provide additional data bandwidth to Smart Rollups. It allows users to share large amounts of data in a way that is decentralized and permissionless, because anyone can join the network and post and read data on it. @@ -21,7 +16,7 @@ You will learn: - How to host a DAL node - How to publish data and files with the DAL -Because the DAL is not yet available on Tezos Mainnet, this tutorial uses the [Weeklynet test network](https://teztnets.com/weeklynet-about), which runs on a newer version of the protocol that includes the DAL. +This tutorial uses the [Weeklynet test network](https://teztnets.com/weeklynet-about). Weeklynet runs just like other Tezos networks like Mainnet and Ghostnet, with its own nodes, bakers, and accusers, so you don't need to run your own nodes and bakers. See these links for more information about the DAL: diff --git a/docs/tutorials/join-dal-baker.md b/docs/tutorials/join-dal-baker.md index 496019ef1..829e74cbb 100644 --- a/docs/tutorials/join-dal-baker.md +++ b/docs/tutorials/join-dal-baker.md @@ -2,17 +2,12 @@ title: Join the DAL as a baker, in 5 steps authors: Tezos core developers last_update: - date: 7 February 2024 + date: 10 June 2024 --- The Tezos data availability layer (DAL) is a key component for the scalability of Tezos. In a nutshell, the DAL increases the data bandwidth available for Tezos Smart Rollups by providing a peer-to-peer network that they can use to fetch data without compromising security. -:::note Experimental -The data availability layer is an experimental feature that is not yet available on Tezos Mainnet. -The way the DAL works may change significantly before it is generally available. -::: - Just like layer 1, Tezos bakers ensure the security of the DAL. Bakers not only produce blocks but also attest that other bakers' blocks are valid and properly published on layer 1. In the same way, bakers attest that data published to the DAL is available. diff --git a/package-lock.json b/package-lock.json index 9120df49c..22a53fb3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4961,11 +4961,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7573,9 +7573,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" },