Conversation
Wires an Aptos chain type into `cre workflow simulate` so workflows targeting `aptos:ChainSelector:N@1.0.0` can be exercised locally against testnet RPCs + a user-published mock forwarder. chain/aptos plugin: - chaintype.go — registers `aptos` via chain.Register; implements ChainType (Name, SupportedChains, ResolveClients, ResolveKey, RegisterCapabilities, RunHealthCheck, ParseTriggerChainSelector, etc.). No trigger surface on Aptos. - capabilities.go — AptosChainCapabilities wires FakeAptosChain per selector and registers with the capability registry. - limited_capabilities.go — LimitedAptosChain enforces chain-write size + Aptos MaxGasAmount via caperrors.ResourceExhausted. - supported_chains.go — mainnet + testnet selectors. - health.go — RunRPCHealthCheck probes GetChainId per client. chain/evm refactor: extracts the EVM-specific pieces out of simulate.go so the simulate command delegates per-chain work through a chain-type registry (EVM + Aptos siblings). Trigger handling, registry, types, utils moved to chain/*. evm/trigger.go carries manual-log-trigger glue. Settings + limits: - CRE_APTOS_PRIVATE_KEY plumbing (Ed25519 hex seed); sentinel seed allowed non-broadcast with ui.Warning; hard-fail under --broadcast for unparseable or sentinel key. - ChainWriteAptosMaxGasAmount in SimulationLimits. Tests: - Unit: chaintype / capabilities / limited / supported_chains / health. - 30-scenario CLI end-to-end suite (simulator_scenarios_test.go). - test/aptos_cli_scenarios_test.go integration. - test_project/aptos_smoke/ example workflow for manual smoke. PLEX-2751
|
👋 Fletch153, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Broadens TestSimulatorScenarios_100 to cover the full behavioural surface of the Aptos chain plugin + FakeAptosChain: - 31-45: AptosChainType surface (Name, SupportedChains, HasSelector, ParseTriggerChainSelector, ExecuteTrigger/ResolveTriggerData stubs, ResolveKey hex/0x/uppercase/whitespace/short-seed rejections). - 46-52: RegisterCapabilities rejects wrong client, key, and limits types; accepts unknown (experimental) selectors; skips selectors without forwarders; surfaces bad forwarder hex; interface assert. - 53-62: View TypeTag coverage — BOOL, U8, U16, U32, U64, U128, U256, ADDRESS round-trips; SIGNER and VECTOR rejected. - 63-72: read-path edges — all-zero/all-ones addresses, empty result, multi-return, integer return, SDK timeout, nil pagination, nil-entry drop, nil request validation. - 73-82: WriteReport broadcast paths — SUCCESS, VM failure, nil pending, forwarder error, WaitForTransaction error, nil-final fallback, multi-sig, empty sigs, 64KiB report, zero gas accepted. - 83-90: LimitedAptosChain — exact/over/under size and gas limits, zero-limit disables check, View/TransactionByHash delegation. - 91-100: lifecycle + info — ChainSelector, Description, Info ID format, Name embedding, Initialise/Register/Unregister/Execute no-ops, HealthReport shape, AptosChainCapabilities Start/Close, constructor nil guards. PLEX-2751
Drops the local `replace ../chainlink-aptos` directive (breaks CI sibling-dir lookup) and pins chainlink-aptos to the PLEX-2751 feature-branch pseudo-version v0.0.0-20260421125752-47d9d126c005 so unit, tidy, gendoc, and e2e jobs can resolve the `fakes` import. Will be re-pinned to the merged SHA once smartcontractkit/chainlink-aptos#442 lands on develop. PLEX-2751
Broadens the e2e cre-binary suite (gated by CRE_APTOS_CLI_E2E=1) with 70 additional scenarios covering: - 31-40: balance fan-out across address shapes (high bit, low bit, max_u256, fan-out lanes). - 41-50: view coin::balance edges (all-zero, all-0x01, all-0xff, canonical aligned-byte addresses). - 51-60: tx-by-hash randomised nonexistent hashes (routing proof). - 61-70: account-transactions fan-out. - 71-80: wrong selector / experimental-chain rejection (EVM mainnet, Solana, 0, 1, max uint64, Aptos mainnet without wiring, experimental 99999999 for each read op, baseline testnet selector unchanged). - 81-90: UI + flag variations (--limits none/default, --help global and workflow simulate scoped, missing wasm/config error messages, invalid --trigger-index, empty CRE_TARGET env). - 91-100: broadcast + key edge cases (--broadcast with sentinel / unparseable / short-hex keys — all must hard-fail with CRE_APTOS_PRIVATE_KEY in the error message, dry-run sentinel warning, dry-run with valid key success, follow-up routing regression cases). Runner rewritten to handle three scenario shapes: - standard simulator dry-run (config + args), - help/no-config invocations (skip simulator markers), - mustFail scenarios (process exit non-zero, expect substring in combined output). Scenario padding widened to %03d to fit 100 cases. PLEX-2751
- ResolveKey: split hex-decode vs length-mismatch errors; align wording with EVM's CRE_*_PRIVATE_KEY message. - ParseTriggerChainSelector: strict prefix+suffix+ParseUint, rejects trailing garbage after @1.0.0. - --broadcast flag help: chain-agnostic wording (no longer EVM-only). - LimitsSummary: include Aptos gas limit alongside EVM; test updated. - aptos_cli_scenarios_test: use t.TempDir() for per-subtest config paths instead of /tmp/apcfg_%03d.json.
TempDir() paths exceed ConfigPath validation (max=97) on macOS. Restore /tmp/apcfg_NNN.json with defer os.Remove; add APTOS_SMOKE_WASM env override for WASM location.
# Conflicts: # cmd/workflow/simulate/capabilities.go # cmd/workflow/simulate/chain/evm/chaintype.go # cmd/workflow/simulate/chain/evm/chaintype_test.go # cmd/workflow/simulate/chain/evm/trigger.go # cmd/workflow/simulate/chain/evm/trigger_test.go # cmd/workflow/simulate/chain/registry.go # cmd/workflow/simulate/chain/registry_test.go # cmd/workflow/simulate/simulate.go # go.mod # go.sum
…xpectations - Add chain-type discriminator to ExperimentalChain; empty defaults to evm - Aptos ResolveClients picks up chain-type: aptos entries - EVM skips non-evm experimental entries - Use corekeys.Aptos / ct.Name() for chain-type strings - Update project.yaml.tpl example - Align View/WriteReport test assertions with pinned FakeAptosChain semantics
…399) Replace EthPrivateKey / AptosPrivateKey fields on UserSettings with a single PrivateKeys map keyed by ChainType.Name, and introduce a ChainType struct that bundles each family's name + signing-key env var. Names are derived from corekeys.EVM / corekeys.Aptos so the canonical upstream identifiers are the single source of truth. Adding a new chain family is now one entry in AllChainTypes instead of a new field, constant, and loader branch. Remove unused EthUrl and simplify the project.yaml experimental-chains example comment.
chain-selectors has no AptosChainIdFromName; previous fallback scanned the Aptos map with a double lookup. Switch on FamilyAptos prefix and iterate AptosALL directly, reading Name/Selector off the struct.
Remove aptos_cli_scenarios_test.go and test/test_project/aptos_smoke/ from version control and ignore them going forward. Files remain on disk for local iteration.
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.
Summary
Adds an Aptos chain type to
cre workflow simulate, so workflows targetingaptos:ChainSelector:N@1.0.0can run locally against a testnet RPC + a user-published mock forwarder. Paired with PLEX-2751 chainlink-aptos PR that ships theFakeAptosChainfake.What's added
chain/aptos/plugin — parallelschain/evm/:chaintype.go— registersaptos; implementschain.ChainType(Name / SupportedChains / ResolveClients / ResolveKey / RegisterCapabilities / RunHealthCheck / ParseTriggerChainSelector / …). No trigger surface on Aptos.capabilities.go—AptosChainCapabilitieswiresFakeAptosChainper selector and registers with the capability registry.limited_capabilities.go—LimitedAptosChainenforces chain-write size +MaxGasAmountviacaperrors.ResourceExhausted.supported_chains.go— mainnet + testnet selectors.health.go—RunRPCHealthCheckprobingGetChainIdper client.chain/evm/refactor — extracts EVM-specific pieces out ofsimulate.goso the command delegates per-chain work through a chain-type registry. Trigger handling, registry, types, utils moved tochain/*;evm/trigger.gocarries the manual-log-trigger glue.Settings + limits
CRE_APTOS_PRIVATE_KEYplumbing (Ed25519 hex seed); sentinel seed allowed non-broadcast withui.Warning; hard-fail under--broadcastfor unparseable or sentinel key.ChainWriteAptosMaxGasAmountinSimulationLimits.Follow-up (not in this PR)
This PR adds Aptos alongside EVM but intentionally does not overhaul the broader plumbing. A dedicated follow-up is needed to make adding new chain families a drop-in rather than a fan-out of edits. Concretely:
internal/settings/settings_get.go): currently dispatches on family prefix (aptos-, EVM default) because upstreamchain-selectorshas no cross-familySelectorFromName. This should collapse once a family-agnostic helper is available or added upstream.AllChainTypesis manually extended per family (CRE_ETH_PRIVATE_KEY,CRE_APTOS_PRIVATE_KEY, …). Needs a registration-driven path so new families don't touchsettings.go.simulate: registry is in place, but several call sites still branch on chain type explicitly. Worth a cleanup pass once a third family lands.chain-selectorsupstream: consider contributingAptosChainIdFromNameor, preferably, a unifiedSelectorFromName(name)that iterates all family*ALLslices — eliminates the local switch entirely.Deliberately scoped out here to keep the PR reviewable