feat: Iota spec#2287
Conversation
Review Summary by QodoAdd IOTA blockchain spec and generic chain setup script
WalkthroughsDescription• Add IOTA blockchain specification with 100+ JSON-RPC APIs • Support IOTA mainnet and testnet chain configurations • Create generic shell script for chain setup automation • Enable provider staking and consumer portal functionality Diagramflowchart LR
A["IOTA Spec Definition"] -->|mainnet & testnet| B["API Collections"]
B -->|jsonrpc interface| C["100+ APIs"]
C -->|core APIs| D["Checkpoint & Transaction"]
C -->|extension APIs| E["Indexer & Metrics"]
F["Generic Setup Script"] -->|configurable| G["Chain Initialization"]
G -->|provider & consumer| H["Test Environment"]
File Changes1. specs/testnet-2/specs/iota.json
|
Code Review by Qodo
1. Tx sequence race
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| GASPRICE="0.00002ulava" | ||
| specs="specs/mainnet-1/specs/ibc.json,specs/mainnet-1/specs/tendermint.json,specs/mainnet-1/specs/cosmossdk.json,specs/testnet-2/specs/lava.json,$EXTRA_SPECS" | ||
| lavad tx gov submit-legacy-proposal spec-add $specs --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & | ||
| wait_next_block | ||
| wait_next_block | ||
| lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE | ||
| sleep 4 | ||
|
|
||
| # Plans proposal | ||
| lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE | ||
| wait_next_block | ||
| wait_next_block | ||
| lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE | ||
|
|
There was a problem hiding this comment.
1. Tx sequence race 🐞 Bug ☼ Reliability
init_chain_only_with_node.sh submits multiple lavad tx ... from the same signer (alice/user1/servicer1) without waiting for inclusion (and backgrounds the first submit), which can fail with "account sequence mismatch" and leave the setup partially applied.
Agent Prompt
### Issue description
`scripts/pre_setups/init_chain_only_with_node.sh` broadcasts multiple `lavad tx ...` operations from the same signers without waiting for block inclusion (and backgrounds the first submit), which can cause intermittent `account sequence mismatch` failures.
### Issue Context
The repo already provides `lavad_tx_and_wait` to avoid this exact race by waiting for the tx hash to be included.
### Fix Focus Areas
- scripts/pre_setups/init_chain_only_with_node.sh[56-80]
- scripts/useful_commands.sh[122-149]
### Expected fix
- Replace the direct `lavad tx ...` calls (spec-add submit, votes, plans-add submit, subscription buy, stake-provider) with `lavad_tx_and_wait tx ...`.
- Remove backgrounding (`&`) from the spec-add submit so ordering is deterministic.
- Ensure failures propagate (e.g., check return codes or enable stricter bash flags if appropriate for this script).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| killall screen | ||
| screen -wipe |
There was a problem hiding this comment.
2. Kills all screen sessions 🐞 Bug ☼ Reliability
The setup script runs killall screen, which terminates all screen sessions on the machine (including unrelated ones), causing disruptive and potentially destructive side effects on shared/dev environments.
Agent Prompt
### Issue description
`scripts/pre_setups/init_chain_only_with_node.sh` uses `killall screen`, which kills *all* `screen` processes on the machine, not just the ones created by this script.
### Issue Context
This script creates specific session names (`node`, `provider1`, `consumers`). Cleanup should target those sessions only.
### Fix Focus Areas
- scripts/pre_setups/init_chain_only_with_node.sh[43-45]
### Expected fix
- Replace `killall screen` with scoped termination, e.g.:
- `screen -S node -X quit 2>/dev/null || true`
- `screen -S provider1 -X quit 2>/dev/null || true`
- `screen -S consumers -X quit 2>/dev/null || true`
- Keep `screen -wipe` if desired, but avoid killing unrelated sessions.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changemainbranchReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...