Skip to content

Commit ea868e8

Browse files
committed
docs: add AccountBatchCloneStep documentation and update changelog
Updates: - docs/source/user_documentation/steps.md: Add full AccountBatchCloneStep section with YAML example, feature bullets, and 4-phase execution description - docs/source/dev_documentation/changelog.md: Added AccountBatchCloneStep, set_states_batched, _set_state_with_retry to Unreleased Added section; added Changed section for config updates and extracted functions - CLAUDE.md: Updated step count from 28 to 29, added AccountBatchClone to Setup list
1 parent d045f15 commit ea868e8

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ YAML Scene -> Steps -> Transactions/Queries -> MultiversX Network
5353
| `tests/` | Unit tests (pytest) |
5454
| `integration_tests/` | Chain-simulator/devnet integration tests |
5555

56-
### All Step Types (28)
56+
### All Step Types (29)
5757
**Contracts**: `ContractDeploy`, `ContractUpgrade`, `ContractCall`, `ContractQuery`, `FileFuzzer`
5858
**Transfers**: `Transfer`
5959
**Tokens**: `FungibleIssue`, `NonFungibleIssue`, `SemiFungibleIssue`, `MetaIssue`, `FungibleMint`, `NonFungibleMint`, `ManageFungibleTokenRoles`, `ManageNonFungibleTokenRoles`, `ManageSemiFungibleTokenRoles`, `ManageMetaTokenRoles`
60-
**Setup**: `GenerateWallets`, `ChainSimulatorFaucet`, `R3D4Faucet`, `AccountClone`
60+
**Setup**: `GenerateWallets`, `ChainSimulatorFaucet`, `R3D4Faucet`, `AccountClone`, `AccountBatchClone`
6161
**Control**: `Loop`, `Scene`, `SetVars`, `SetSeed`, `Assert`, `Wait`, `Log`, `Python`
6262

6363
### Smart Values Syntax

docs/source/dev_documentation/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@
44

55
### Added
66

7+
- `AccountBatchCloneStep` for optimized bulk account cloning: collects all data first, then pushes with single ESDT module reconciliation, single Elasticsearch bulk insert, and smart payload-sized batched `set_state` calls
78
- `ChainSimulatorSetStateStep` to set specific hex-encoded storage key-value pairs for an address on the chain simulator
89
- Explicit test for variadic counted values
910
- Dynamic batch size recovery: after a timeout reduces the batch size, subsequent successful requests with smaller payloads automatically double the batch size back toward the original (for both storage fetch and push operations)
1011
- Tests verifying batch size resets between accounts
12+
- `set_states_batched` helper for pushing multiple account states with automatic payload-size grouping
13+
- `_set_state_with_retry` helper for transient failure resilience on `set_state` calls
14+
15+
### Changed
16+
17+
- Chain simulator default `API_RATE_LIMIT` increased to 100 (from 2) and `STORAGE_ITERATION_BATCH_SIZE` to 5000 (from 1000) for faster localhost operations
18+
- `AccountCloneStep` internal methods extracted into reusable module-level functions
1119

1220
### Fixed
1321

docs/source/user_documentation/steps.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,39 @@ caching_period: "10 days" # optional, default to 10 days
713713
714714
Account cloning can lead to huge data requests. If you are using the public proxy, please use a high caching period.
715715
716+
(account_batch_clone_target)=
717+
### Account Batch Clone Step
718+
719+
Exclusive to the chain simulator.
720+
This step allows you to clone multiple accounts from another network in an optimized batch fashion. Unlike running multiple `AccountClone` steps sequentially, `AccountBatchClone` collects all data first and then pushes it efficiently:
721+
722+
- **Single ESDT module reconciliation** instead of one per account (avoids O(n²) growing fetches)
723+
- **Single Elasticsearch bulk insert** for all tokens across all accounts
724+
- **Smart batched `set_state` calls** grouped by payload size
725+
726+
This is recommended when cloning many accounts (e.g. all pools from a DEX).
727+
728+
```yaml
729+
type: AccountBatchClone
730+
addresses:
731+
- "erd1qqq..."
732+
- "erd1qqq..."
733+
- "%my_contract.address"
734+
source_network: mainnet
735+
clone_balance: true # optional, default to true
736+
clone_code: true # optional, default to true
737+
clone_storage: true # optional, default to true
738+
clone_esdts: true # optional, default to true
739+
overwrite: true # optional, default to true
740+
caching_period: "10 days" # optional, default to 10 days
741+
```
742+
743+
The step logs per-phase timing so you can see where time is spent:
744+
- **Phase 1**: Collecting account and storage data (cached after first run)
745+
- **Phase 2**: Reconciling ESDT identifiers with the chain simulator
746+
- **Phase 3**: Inserting token data into Elasticsearch
747+
- **Phase 4**: Pushing all account states to the chain simulator
748+
716749
## Miscellaneous Steps
717750

718751
(loop_step_target)=

0 commit comments

Comments
 (0)