Repository navigation
feat(cli): a4 program account decode, in production or a dev environment - #477
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no new blocking issues were found. SummaryAdds
No new actionable issues were found. All five previous threads were rechecked.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
adiman9
force-pushed
the
feat/program-account-decode
branch
from
October 29, 2026 04:27
f2c651e to
c11c3b0
Compare
# Conflicts: # rust/arete-mcp/src/dev_env.rs
An environment can serve another release of a program than the installed one. The account type was chosen from the installed IDL before that release was known, so an account type the served release adds could not be decoded, even when named with --account. Choose the type after resolving. With another release served, --account goes to the environment to check, and the installed IDL's only account is no longer assumed for data it does not match.
An arete.toml alias kept only its package name and read the package's current install, ignoring the version requirement and arete.lock. A project pinned to an older release could get another IDL and Program Read release than its SDK. Resolve the alias as a4 install does, with its requirement and locked release. An account's owner uses the same route when the project depends on it.
A lock older than arete.toml can name the account's owner under an alias that now resolves to another package. Use the project's install only when it is the owner's program; otherwise look the owner up in the registry.
This branch was successfully deployed
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.
a4 program account decode <address> [--program <alias|package>] [--account <Type>] [--dev [--env <name|id>] [--project <dir>]]: decode one account through Program Read for the program's installed release.How it reads
--dev): reads the account from the environment's fork (getAccountInfo, the waya4 devtalks to the environment), resolves the program's binding and release to the environment's Program Read endpoint and release (POST /api/dev/environments/:env/resolve, so an environment release override applies), mints the read session withenvironmentset, and decodes there: the output shows the fork's values. A refused resolve prints its code and fix.--programis anarete.tomlprogram alias or a registry package; without it, the account's owner looked up in the registry (an owner the registry doesn't list is an error telling you to pass--program).--account, else the IDL account whose discriminator starts the data, else the IDL's only account; ambiguity or no match asks for--account.--jsonprints{address, program, programId, account, programReleaseHash, environment, value}.Seam for the environment switch
Production vs dev is chosen in one function (
read_target).--devselects the environment today; when the SDKs' environment switch lands, it is read there so this command follows it.--env/--projectwithout--devare refused.Also adds
EnvApi::resolvetoarete-mcp.Tests
Unit tests: discriminator matching and
--account, owner mismatch message, raw account parsing from the chain read and fromgetAccountInfo, resolve answer → endpoint/release and refusal fix, decode URL,--envneeding--dev.--project, aliases come from that project'sarete.toml.decode-forkcondition needs a deployed environment and dev Program Read).Open question
Without
--programin production, the owner is read through the first registry program's gateway binding (the managed gateway reads any account). Fine if every program's chain binding names the same gateway, which is how installs look today.