[REHEARSAL] scaffold: emit a program-id output block per program - #7
Open
michael-moffett wants to merge 3 commits into
Open
[REHEARSAL] scaffold: emit a program-id output block per program#7michael-moffett wants to merge 3 commits into
michael-moffett wants to merge 3 commits into
Conversation
Greptile SummaryThe PR adds generated program-ID output blocks to scaffolded deployment runbooks and introduces configurable startup funding for the Node Kit plugin in embedded and attach modes.
Confidence Score: 4/5The non-atomic startup funding update should be fixed before merging because it can overwrite concurrent balance changes on an attached Surfnet. Startup funding computes an absolute replacement balance from a prior RPC read, so activity between the read and write can cause silent lost updates. Files Needing Attention: crates/sdk-node/surfpool-sdk/kit/surfpool.ts
|
| Filename | Overview |
|---|---|
| crates/cli/src/scaffold/mod.rs | Adds a shared template and appends a program-ID output block after each generated deployment action. |
| crates/sdk-node/surfpool-sdk/kit/surfpool.ts | Adds startup funding in both modes, but its read-then-write balance update can overwrite concurrent account changes. |
| crates/sdk-node/surfpool-sdk/kit/index.ts | Exports the newly introduced airdrop target and funded attach-mode configuration types. |
| crates/sdk-node/surfpool-sdk/kit/typetests/typetests.ts | Verifies synchronous and asynchronous plugin overloads and rejects ambiguous funding configurations. |
| crates/sdk-node/scripts/kit-unit.js | Adds unit coverage for startup funding, validation, deduplication, overflow, and failure reporting. |
| crates/sdk-node/scripts/kit-smoke.js | Exercises embedded startup funding and additive behavior against a live Surfnet. |
| crates/sdk-node/README.md | Documents airdrop configuration, defaults, additive behavior, and embedded-mode support. |
Sequence Diagram
sequenceDiagram
participant Client
participant Plugin as surfpool plugin
participant RPC as Surfnet RPC
participant Other as Concurrent client
Client->>Plugin: compose with airdropAddresses
Plugin->>RPC: getBalance(address)
RPC-->>Plugin: current balance
Other->>RPC: mutate same account balance
Plugin->>RPC: setAccount(stale balance + amount)
Note over RPC: Concurrent balance change is overwritten
RPC-->>Plugin: success
Plugin-->>Client: configured client
Reviews (1): Last reviewed commit: "test(scaffold): assert the program-outpu..." | Re-trigger Greptile
Comment on lines
+127
to
+132
| if (lamports > MAX_LAMPORTS) { | ||
| throw new Error( | ||
| `balance ${balance} plus airdropAmount ${amount} exceeds the maximum lamport balance ${MAX_LAMPORTS}`, | ||
| ); | ||
| } | ||
| await client.cheatcodes.setAccount(address, { lamports }).send(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fork-internal CI rehearsal. Not for merge, not for upstream.
Rehearses
p032/scaffold-339-program-id-output(heade0de52b) against.github/workflows/on realrunner images before the change is offered anywhere else. Base is this fork's
main.Change under test:
crates/cli/src/scaffold/mod.rs, +42 / −0, one file.Base branch note: this fork's
mainis4971d40d, exactly one commit behindsolana-foundation/surfpool@de6a055.mainwas deliberately not fast-forwarded, becauserelease_crates.yamlandrelease_cli.yamlfire onpush: branches: [main]and firing a publishworkflow to rehearse a test workflow is not a trade worth making.
4971d40dis an ancestor ofde6a055,so
refs/pull/N/mergeresolves toe0de52b's tree exactly and CI tests the intended bytes.