Skip to content

Commit

Permalink
Merge pull request #858 from multiversx/move-historical-vm-queries
Browse files Browse the repository at this point in the history
Move and update historical vm queries section.
  • Loading branch information
danidrasovean authored Apr 4, 2024
2 parents 2fb0cd4 + f2410b5 commit a31ea01
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions docs/integrators/deep-history-squad.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ In the example above, the key `726573657276650000000a55544b2d326638306539` is de

[comment]: # (mx-context-auto)

## Historical VM queries

Starting with the [Sirius Patch 5](https://github.com/multiversx/mx-chain-mainnet-config/releases/tag/v1.6.18.0), deep-history observers can resolve historical VM queries. Such a query specifies the `blockNonce` parameter:

```
POST http://localhost:8080/vm-values/query?blockNonce={...} HTTP/1.1
Content-Type: application/json
{
"scAddress": "...",
"funcName": "...",
"args": [ ... ]
}
```

[comment]: # (mx-context-auto)

## MultiversX squad

The observing squads backing the public Gateways, in addition to being full history squads (serving past blocks, transactions and events up until the Genesis), also act as 3-epochs deep-history squads. That is, for **mainnet**, one can use https://gateway.multiversx.com to resolve historical account (state) queries, for the last 3 days. This interval is driven by the configuration parameter `[StoragePruning.NumEpochsToKeep]`, which is set to `4`, by default.
Expand Down Expand Up @@ -310,29 +327,6 @@ Once the **import-db** is over, the `db` folder can be attached to a deep-histor

[comment]: # (mx-context-auto)

## Historical VM queries

:::important
Documentation in this section is preliminary and subject to change.
:::

Starting with the [Sirius Mainnet Upgrade](https://github.com/multiversx/mx-specs/blob/main/releases/protocol/release-specs-v1.6.0-Sirius.md), deep-history observers can resolve VM queries up to `[StoragePruning.NumActivePersisters]` (by default, 3) epochs in the past. Such a query specifies the `blockNonce` parameter:

```
POST http://localhost:8080/vm-values/query?blockNonce={...} HTTP/1.1
Content-Type: application/json
{
"scAddress": "...",
"funcName": "...",
"args": [ ... ]
}
```

VM queries that refer older data aren't supported as of January 2024 (Sirius). This will be fixed in a future release.

[comment]: # (mx-context-auto)

## Starting a squad

Suppose you have prepared the data for a deep-history squad beforehand, whether by downloading it or by reconstructing it locally. Then, the deep-history data root folder should look as follows:
Expand Down

0 comments on commit a31ea01

Please sign in to comment.