Skip to content

Commit

Permalink
Sequencer docs: adding diagrams and redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
szynwelski committed Jan 4, 2024
1 parent 2ce1f36 commit 3ceea05
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 228 deletions.
202 changes: 0 additions & 202 deletions warp-academy-docs/docs/sdk/advanced/bundled-interaction.md

This file was deleted.

12 changes: 3 additions & 9 deletions warp-academy-docs/docs/sequencer/lifecycle/ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,20 @@ This implies, in particular, that when an Arweave block along with its contained

## Previous Sort Key

----
[DIAGRAM WITH LINKED LIST OF INTERACTIONS]

----

All interactions, regardless of how they were sent, are ordered by the sequencer in a linear order.
This means that for each interaction, which is not the first interaction of a given contract, we can identify its predecessor within that contract.
For this purpose, we use a value we will call the `prev sort key`.

![Linked list of interactions](/img/docs/sequencer/interactions-linked-list.png)

This value is useful prior to the evaluation of the contract state when retrieving the [list of interactions](/docs/gateway/http/get/interactions) for that contract from the gateway, ensuring that no interactions were overlooked.

To calculate the prev sort key, each sequencer node maintains a map (refer to: [Data Format](/docs/sequencer/data-format#previous-sort-keys)) in which, for each contract ID, the sort key of the last interaction associated with that contract is stored.

## Block Proposal
As sequencer nodes accept interactions and place them in their mempool, these interactions do not yet have assigned `sort key` and `prev sort key` values. These values can only be calculated at the time of creating a proposal for the next sequencer block.

----
[DIAGRAM FOR PROPOSER]

----
![Creating a block proposal](/img/docs/sequencer/block-proposal.png)

The process is as follows:

Expand Down
4 changes: 2 additions & 2 deletions warp-academy-docs/docs/sequencer/lifecycle/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Interactions are used to change the state of contracts and invoke computations defined in the contract's source code.
However, before any of that can happen, the interaction must go through a lifecycle, which is not such a simple process.

![The lifecycle of an interaction in Warp Sequencer](/img/docs/sequencer/interaction-lifecycle.png)

In brief, the lifecycle of an interaction begins when it is [created](/docs/sequencer/lifecycle/creating) and sent by the [Warp SDK](/docs/sdk/overview).
The interaction is then [received](/docs/sequencer/lifecycle/receiving) by the Warp Sequencer, which establishes order relative to other interactions.
The process of [ordering](/docs/sequencer/lifecycle/ordering) involves generating keys on which the interactions are sorted, as well as generating random values in case the contract needs them.
Expand All @@ -18,6 +20,4 @@ For this type of interaction, the sequencer also sends data to Arweave, but only

The gateway receives a common list of interactions regardless of whether they were sent to the sequencer or to Arweave.

![Decentralized Warp Sequencer](/img/docs/sequencer/sequencer.png)

The stages of the interaction lifecycle will be described in detail in the following sections.
7 changes: 2 additions & 5 deletions warp-academy-docs/docs/sequencer/lifecycle/receiving.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Receiving and Validating Interactions

![Receiving interaction by the sequencer node](/img/docs/sequencer/receiving-interaction.png)

The sequencer accepts interactions in the form of [DataItem](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md) via the endpoint `/api/v1/data-item` (refer to: [API Methods](/docs/sequencer/api-methods#submits-a-new-interaction-to-the-sequencer)).
Interactions added to the sequencer's blockchain take the form of messages.
The message that encapsulates an interaction in the DataItem format is `MsgDataItem` (see: [Messages format](/docs/sequencer/data-format#interaction-message)).
Expand All @@ -10,11 +12,6 @@ Finally, a transaction is created whose only message is this interaction.
A [transaction](https://docs.cosmos.network/main/learn/advanced/transactions) in the Cosmos SDK represents a set of messages that trigger state transitions within the blockchain.
:::

----
[DIAGRAM FOR RECEIVING INTERACTIONS]

----

## Validation

Subsequently, the transaction undergoes a validation process to ensure its correctness.
Expand Down
11 changes: 11 additions & 0 deletions warp-academy-docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ const config = {
},
sidebarPath: require.resolve('./sidebars/standardsSidebar.js'),
},
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
to: '/docs/sequencer/introduction',
from: '/docs/sdk/advanced/bundled-interaction',
}
]
}
]
],

Expand Down
1 change: 1 addition & 0 deletions warp-academy-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@docsearch/react": "3",
"@docusaurus/core": "^2.4.0",
"@docusaurus/plugin-client-redirects": "2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"@docusaurus/theme-mermaid": "^2.4.0",
"@mdx-js/react": "^1.6.22",
Expand Down
2 changes: 1 addition & 1 deletion warp-academy-docs/standards/tradeable-atomic-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To find existing contracts implementing the atomic-asset standard, we can use `t
Tags can be specified [during deployment](../docs/sdk/advanced/register-contract) of atomic-asset.

- During deployment following tag should be added : `{name: 'Indexed-By', value: 'atomic-asset'}`
- This tag is supported by [warp-aggregate-node](../docs/aggregate-node/overview.md). Thus allow to query assets by its owner - [documentation](../docs/aggregate-node/overview.md#nft-by-owner)
- This tag is supported by [warp-aggregate-node](../docs/aggregate-node/overview). Thus allow to query assets by its owner - [documentation](../docs/aggregate-node/overview#nft-by-owner)

## State

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 19 additions & 9 deletions warp-academy-docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,21 @@
react-helmet-async "*"
react-loadable "npm:@docusaurus/react-loadable@5.5.2"

"@docusaurus/plugin-client-redirects@2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-2.4.0.tgz#53117d112ac9cc191deda053af4335e0381b4125"
integrity sha512-HsS+Dc2ZLWhfpjYJ5LIrOB/XfXZcElcC7o1iA4yIVtiFz+LHhwP863fhqbwSJ1c6tNDOYBH3HwbskHrc/PIn7Q==
dependencies:
"@docusaurus/core" "2.4.0"
"@docusaurus/logger" "2.4.0"
"@docusaurus/utils" "2.4.0"
"@docusaurus/utils-common" "2.4.0"
"@docusaurus/utils-validation" "2.4.0"
eta "^2.0.0"
fs-extra "^10.1.0"
lodash "^4.17.21"
tslib "^2.4.0"

"@docusaurus/plugin-content-blog@2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.4.0.tgz#50dbfbc7b51f152ae660385fd8b34076713374c3"
Expand Down Expand Up @@ -3187,15 +3202,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001286:
version "1.0.30001312"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f"
integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==

caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449:
version "1.0.30001450"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz#022225b91200589196b814b51b1bbe45144cf74f"
integrity sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449:
version "1.0.30001572"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001572.tgz"
integrity sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==

ccount@^1.0.0:
version "1.1.0"
Expand Down

0 comments on commit 3ceea05

Please sign in to comment.