Skip to content

Add multiple destination support to toolkit sigle tx#1560

Merged
ozgb merged 19 commits into
mainfrom
feat/toolkit/add-multi-destination-single-tx
Jun 5, 2026
Merged

Add multiple destination support to toolkit sigle tx#1560
ozgb merged 19 commits into
mainfrom
feat/toolkit/add-multi-destination-single-tx

Conversation

@chrispalaskas

@chrispalaskas chrispalaskas commented May 21, 2026

Copy link
Copy Markdown
Contributor

The toolkit now can accept multiple destination addresses for multiple tokens of both types.
Tested the following command:

--source-seed 0000000000000000000000000000000000000000000000000000000000000006 \
--src-url ws://tom.perf.dev.aws.shielded.io:9944 \
--dest-url ws://tom.perf.dev.aws.shielded.io:9944 \
--destination-address mn_addr1kwzy57ky0sh0m5lzqhm7tacts6z8gddgegv9xv7htczkfxsz0lhsp5wl5v \
--unshielded-amount 410000000 \
--unshielded-token-type 0000000000000000000000000000000000000000000000000000000000000000 \
--destination-address mn_shield-addr1s5puv5jxv468x5gx4uxc0sq9llryarethrtqa84m3egf640xgtls0hadm28yactuvry7py3xndpwr9hcckwcvq84z8lv65fqaa7z4vq6f5fzd \
--shielded-amount 41 \
--shielded-token-type 0000000000000000000000000000000000000000000000000000000000000001 \
--fetch-cache postgres://postgres:password123@localhost:5432/toolkit_cache \
--ledger-state-db /root/src/midnight-performance-perfmain/tests/scripts/ledger_state_db

and verified both token types made it to their destinations.
Tested also with the performance script register_and_fund_binary.py.
Tx found in block https://polkadot.js.org/apps/?rpc=ws://jack.perf.dev.aws.shielded.io:9944#/explorer/query/0xe850095322736acb3acc5958a2fee1e85d7961814b58f14ae7036032eef2c39f
Build was done here: https://github.com/shieldedtech/midnight-performance/actions/runs/26245769743/job/77243586029
Signed-off-by: chrispalaskas chris.palaskas@gmail.com

Overview

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • All commits are signed off (git commit -s) for the DCO
  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
@chrispalaskas chrispalaskas requested review from gilescope and ozgb May 21, 2026 19:15
@chrispalaskas chrispalaskas requested a review from a team as a code owner May 21, 2026 19:15
@chrispalaskas chrispalaskas added skip-changes-check-issue ai-assisted Created or modified with AI assistance labels Jun 1, 2026
LGLO
LGLO previously approved these changes Jun 1, 2026

@LGLO LGLO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally keep each output as one line with encoding of amount, token type, and address triple. However, I let the command use decide how to invoke it

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
…//github.com/midnightntwrk/midnight-node into feat/toolkit/add-multi-destination-single-tx

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
Comment thread util/toolkit/src/cli_parsers.rs Outdated
Comment thread util/toolkit/src/tx_generator/builder/builders/common/single_tx.rs Outdated
Comment thread util/toolkit/src/tx_generator/builder/builders/common/single_tx.rs Outdated
@ozgb

ozgb commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The CLI API looks good to me! Left some comments to improve the implementation

@chrispalaskas

Copy link
Copy Markdown
Contributor Author

@LGLO I change the output destination as per your suggestion, tested thus:
./midnight-node-toolkit generate-txs single-tx --source-seed 0000000000000000000000000000000000000000000000000000000000000006 --src-url ws://tom.perf.dev.aws.shielded.io:9944 --dest-url ws://tom.perf.dev.aws.shielded.io:9944 --output addr=mn_addr1kwzy57ky0sh0m5lzqhm7tacts6z8gddgegv9xv7htczkfxsz0lhsp5wl5v,amount=410,token=0000000000000000000000000000000000000000000000000000000000000000 --output addr=mn_shield-addr1s5puv5jxv468x5gx4uxc0sq9llryarethrtqa84m3egf640xgtls0hadm28yactuvry7py3xndpwr9hcckwcvq84z8lv65fqaa7z4vq6f5fzd,amount=41,token=0000000000000000000000000000000000000000000000000000000000000001 --fetch-cache postgres://postgres:password123@localhost:5432/toolkit_cache --ledger-state-db /root/src/midnight-performance-perfmain/tests/scripts/ledger_state_db

--output detects token type from address, is that OK or do we want explicit flag?

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
…//github.com/midnightntwrk/midnight-node into feat/toolkit/add-multi-destination-single-tx

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
…i-destination-single-tx

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>

# Conflicts:
#	util/toolkit/src/cli_parsers.rs
#	util/toolkit/src/tx_generator/builder/builders/common/single_tx.rs
@chrispalaskas

Copy link
Copy Markdown
Contributor Author

@ozgb I fixed all your comments and pulled latest main.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdcf1479f3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread util/toolkit/src/tx_generator/builder/builders/common/single_tx.rs
The GitHub-UI merge of main into this branch brought in ledger_9.rs (PR
#1604) without declaring `pub mod output_spec;`, leaving single_tx and
batch_single_tx unable to resolve `super::output_spec` when compiled
under the ledger_9 variant. Matches what ledger_7 and ledger_8 already do.

Fixes the +check-rust and +check-feature-unification CI failures on PR #1560.

Assisted-by: Claude:claude-4.7-opus
Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
ozgb
ozgb previously approved these changes Jun 4, 2026

@ozgb ozgb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread util/toolkit/src/cli_parsers/output_arg.rs Outdated
@ozgb ozgb enabled auto-merge June 4, 2026 13:18
Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
…i-destination-single-tx

Signed-off-by: chrispalaskas <chris.palaskas@gmail.com>
Comment thread util/toolkit/src/cli_parsers.rs
@ozgb ozgb added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit 9ba57d1 Jun 5, 2026
36 checks passed
@ozgb ozgb deleted the feat/toolkit/add-multi-destination-single-tx branch June 5, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Created or modified with AI assistance skip-changes-check-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants