Skip to content

Add data feeds cache and proxy bindings - #162

Open
Fletch153 wants to merge 6 commits into
feature/DF-25429/data-feeds-contractsfrom
feature/DF-25434/data-feeds-deployment
Open

Add data feeds cache and proxy bindings#162
Fletch153 wants to merge 6 commits into
feature/DF-25429/data-feeds-contractsfrom
feature/DF-25434/data-feeds-deployment

Conversation

@Fletch153

@Fletch153 Fletch153 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Go bindings for the data feeds cache and proxy, generated by the existing generator with three additive capabilities: i256 ↔ *big.Int, an explicit -readonly function list, and -include-void.
  • Zero CCIP files touched — all CCIP bindings and interfaces are byte-identical to the base branch; regeneration verified drift-free end-to-end (CI's stellar-cli 25.1.0 + cargo fmt reproduce every committed CCIP interface exactly).
  • Deployer gains DeployContract{,Bytes}WithArgs (constructor args) and UploadContractWASM for the CLD changesets.

Context

Stacked on #161 (whose tip adds explicit discriminants to Bound, making the generator's U32 unit-enum encoding correct for find_round with no generator changes). Soroban's contract spec carries no view marker, so reads that don't match the generator's get_*/is_* heuristic — latest_round, find_round, round_range, decimals, description — are declared per contract in gen_bindings.sh's new readonly_fns column; listed functions generate as free simulations, and a listed name that doesn't exist in the contract fails generation (typo/rename guard). CCIP rows don't use the new columns and keep today's behavior exactly.

Changes

  • Generator (additive; output for existing contracts unchanged): soroban_sdk::I256*big.Int via new scval.I256ToScVal/I256FromScVal; -readonly explicit list (authoritative when present, heuristic otherwise); -include-void takes a per-contract list naming the void functions to generate (transfer_ownership, upgrade, … — previously dropped silently); unlisted void functions stay omitted, so CCIP can opt individual functions in later without new machinery; missing soroban_sdk::String event-field decode case added.
  • gen_interfaces.sh: data-feeds rows with a wasm_dir column (nested cargo workspace) and the nested build. No alias handling needed: Add data feeds cache, proxy, and common contracts #161 now writes BytesN<N> literally, so the wasm spec is self-contained.
  • gen_bindings.sh: readonly_fns + include_void columns, set only on data-feeds rows.
  • Generated bindings/contracts/data_feeds_{cache,proxy}/ (marked linguist-generated, collapsed in review); the generated surface is enforced by check-generated CI and verified by the implementor.
  • Deployer: constructor-arg deployment + wasm upload; stellardeps.SorobanContractDeployer widened (consumed by chainlink #23213); test fakes embed the interface.

Testing

  • bindings: go test ./... — generator and scval (i256 round-trips) — all pass.
  • deployment: go test ./operations/... ./sequences/... ./cre/... . — all pass (pre-existing deployment/adapters break, issue CI red on main: adapters call CommitteeVerifierClient.GetAllSignatureConfigs, missing from bindings #163, unchanged from main).
  • Full regeneration from committed interfaces is drift-free (gen_bindings.sh --no-interfaces + gofmt → clean tree); interface regeneration with CI's exact stellar-cli version (25.1.0) + cargo fmt reproduces every committed CCIP .rs byte-for-byte.
  • Generated classification spot-checked: 12 listed cache reads simulate; the 10 writes (incl. all 5 void ownership/upgrade functions) invoke.

Notes

  • Requires Add data feeds cache, proxy, and common contracts #161's head (76ac73e) for the Bound discriminants.
  • Consumers: chainlink #23213 needs only a re-pin (API shape matches what it was written against); #23208's rewrite onto this client is tracked separately.
  • The earlier two-step/Call[T] client and v0/v1 generator-split explorations are parked on spike/DF-25434/two-step-client for future reference.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Soroban Contract Test Coverage

92.64% line coverage — 18001 / 19431 lines hit

Metric Hit Total Coverage
Lines 18001 19431 92.64%
Functions 1189 1529 77.76%
Regions 33476 35839 93.41%

Per-Contract Breakdown

Contract Lines (Hit / Total) Line Cov Funcs (Hit / Total) Func Cov
other 18001 / 19431 92.6% 1189 / 1529 77.8%
Full file-level coverage report
Filename                                                 Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ccip-ramp-registry/src/lib.rs                                188                75    60.11%           8                 3    62.50%         104                41    60.58%           0                 0         -
ccip-ramp-registry/src/test.rs                               214                 0   100.00%           5                 0   100.00%         128                 0   100.00%           0                 0         -
ccip-ramp-registry/src/types.rs                               83                11    86.75%          17                 6    64.71%          83                11    86.75%           0                 0         -
ccvs/committee-verifier/src/lib.rs                           588                54    90.82%          26                 2    92.31%         382                10    97.38%           0                 0         -
ccvs/committee-verifier/src/test.rs                         1300                25    98.08%          48                 2    95.83%         587                13    97.79%           0                 0         -
ccvs/committee-verifier/src/types.rs                          17                 8    52.94%           6                 5    16.67%          14                 7    50.00%           0                 0         -
ccvs/versioned-verifier-resolver/src/lib.rs                  287                21    92.68%          14                 1    92.86%         162                 4    97.53%           0                 0         -
ccvs/versioned-verifier-resolver/src/test.rs                 680                 9    98.68%          20                 0   100.00%         359                 3    99.16%           0                 0         -
ccvs/versioned-verifier-resolver/src/types.rs                 89                 6    93.26%          16                 4    75.00%          83                 4    95.18%           0                 0         -
common/authorization/src/allowlist.rs                        167                51    69.46%          12                 4    66.67%         110                40    63.64%           0                 0         -
common/authorization/src/lib.rs                              426                27    93.66%          16                 0   100.00%         277                16    94.22%           0                 0         -
common/authorization/src/ownable.rs                          102                13    87.25%           9                 1    88.89%          62                 6    90.32%           0                 0         -
common/authorization/src/test.rs                            1195                 0   100.00%          57                 0   100.00%         462                 0   100.00%           0                 0         -
common/guard/src/initializable.rs                             30                 1    96.67%           4                 0   100.00%          22                 1    95.45%           0                 0         -
common/guard/src/lib.rs                                       32                 1    96.88%           4                 0   100.00%          22                 0   100.00%           0                 0         -
common/guard/src/test.rs                                     101                 0   100.00%           8                 0   100.00%          47                 0   100.00%           0                 0         -
common/helpers/src/curse_checkable.rs                        103                24    76.70%           6                 1    83.33%          56                12    78.57%           0                 0         -
common/helpers/src/map_updater.rs                             94                15    84.04%           7                 3    57.14%          39                 8    79.49%           0                 0         -
common/helpers/src/soroban_invoke.rs                         204                 4    98.04%           8                 0   100.00%          81                 0   100.00%           0                 0         -
common/interfaces/src/ccip_receiver.rs                         8                 8     0.00%           8                 8     0.00%           8                 8     0.00%           0                 0         -
common/interfaces/src/committee_verifier.rs                   13                13     0.00%          13                13     0.00%          13                13     0.00%           0                 0         -
common/interfaces/src/fee_quoter.rs                           17                17     0.00%          17                17     0.00%          17                17     0.00%           0                 0         -
common/interfaces/src/offramp.rs                              11                11     0.00%          11                11     0.00%          11                11     0.00%           0                 0         -
common/interfaces/src/onramp.rs                                9                 9     0.00%           9                 9     0.00%           9                 9     0.00%           0                 0         -
common/interfaces/src/ramp_registry.rs                         5                 5     0.00%           5                 5     0.00%           5                 5     0.00%           0                 0         -
common/interfaces/src/rmn_proxy.rs                             6                 6     0.00%           6                 6     0.00%           6                 6     0.00%           0                 0         -
common/interfaces/src/router.rs                                9                 9     0.00%           9                 9     0.00%           9                 9     0.00%           0                 0         -
common/interfaces/src/siloed_lock_release_pool.rs             21                21     0.00%          21                21     0.00%          21                21     0.00%           0                 0         -
common/interfaces/src/token_admin_registry.rs                  8                 8     0.00%           8                 8     0.00%           8                 8     0.00%           0                 0         -
common/interfaces/src/token_lock_box.rs                        6                 6     0.00%           6                 6     0.00%           6                 6     0.00%           0                 0         -
common/interfaces/src/token_pool.rs                           11                11     0.00%          11                11     0.00%          11                11     0.00%           0                 0         -
common/interfaces/src/versioned_verifier_resolver.rs          10                10     0.00%          10                10     0.00%          10                10     0.00%           0                 0         -
common/message/src/lib.rs                                    586                41    93.00%          28                 4    85.71%         298                 9    96.98%           0                 0         -
common/message/src/test.rs                                   641                 2    99.69%          28                 0   100.00%         323                 0   100.00%           0                 0         -
common/pool/src/decimals.rs                                  109                10    90.83%           6                 0   100.00%          76                 3    96.05%           0                 0         -
common/pool/src/finality_codec.rs                             52                 1    98.08%           3                 0   100.00%          41                 0   100.00%           0                 0         -
common/pool/src/lib.rs                                       460                31    93.26%          32                 1    96.88%         409                26    93.64%           0                 0         -
common/pool/src/rate_limit.rs                                180                 7    96.11%           9                 0   100.00%         145                 3    97.93%           0                 0         -
common/pool/src/types.rs                                      20                14    30.00%          16                14    12.50%          30                14    53.33%           0                 0         -
common/signature/src/config.rs                                44                12    72.73%           6                 2    66.67%          28                 5    82.14%           0                 0         -
common/signature/src/quorum.rs                                68                 1    98.53%           2                 0   100.00%          44                 1    97.73%           0                 0         -
common/signature/src/scheme.rs                                45                 0   100.00%           2                 0   100.00%          29                 0   100.00%           0                 0         -
cre/forwarder/src/error.rs                                     8                 3    62.50%           1                 0   100.00%           8                 3    62.50%           0                 0         -
cre/forwarder/src/lib.rs                                     460                24    94.78%          18                 0   100.00%         313                 7    97.76%           0                 0         -
cre/forwarder/src/test.rs                                   2840                14    99.51%         125                 2    98.40%        1176                 8    99.32%           0                 0         -
cre/forwarder/src/types.rs                                    62                 6    90.32%          10                 6    40.00%          36                 6    83.33%           0                 0         -
cre/test/read_fixture/src/lib.rs                             125               125     0.00%          33                33     0.00%         103               103     0.00%           0                 0         -
cre/test/receiver/src/lib.rs                                  30                30     0.00%           4                 4     0.00%          15                15     0.00%           0                 0         -
fee-quoter/src/lib.rs                                        771               164    78.73%          20                 3    85.00%         527               100    81.02%           0                 0         -
fee-quoter/src/test.rs                                       861                 0   100.00%          17                 0   100.00%         427                 0   100.00%           0                 0         -
fee-quoter/src/types.rs                                       13                13     0.00%          13                13     0.00%          13                13     0.00%           0                 0         -
mcms/src/abi_encoding.rs                                     216                 4    98.15%          10                 0   100.00%          98                 1    98.98%           0                 0         -
mcms/src/constants.rs                                         10                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
mcms/src/crypto.rs                                           202                 3    98.51%           7                 0   100.00%         109                 2    98.17%           0                 0         -
mcms/src/error.rs                                              8                 4    50.00%           1                 0   100.00%           8                 4    50.00%           0                 0         -
mcms/src/lib.rs                                              713                50    92.99%          20                 0   100.00%         483                23    95.24%           0                 0         -
mcms/src/test.rs                                            2278                19    99.17%          59                 0   100.00%        1095                 2    99.82%           0                 0         -
mcms/src/types.rs                                             10                10     0.00%          10                10     0.00%          10                10     0.00%           0                 0         -
offramp/src/lib.rs                                           729               400    45.13%          23                 8    65.22%         473               224    52.64%           0                 0         -
offramp/src/test.rs                                          890                 0   100.00%          28                 0   100.00%         363                 0   100.00%           0                 0         -
offramp/src/types.rs                                          21                 9    57.14%           6                 5    16.67%          17                 7    58.82%           0                 0         -
onramp/src/lib.rs                                           1181               149    87.38%          27                 2    92.59%         739                61    91.75%           0                 0         -
onramp/src/test.rs                                          1591                 4    99.75%          37                 0   100.00%         708                 4    99.44%           0                 0         -
onramp/src/types.rs                                           23                 9    60.87%           6                 5    16.67%          19                 7    63.16%           0                 0         -
pools/burn-mint-pool/src/lib.rs                              390               107    72.56%          28                 9    67.86%         282                55    80.50%           0                 0         -
pools/burn-mint-pool/src/test.rs                            2671                24    99.10%          56                 5    91.07%        1744                55    96.85%           0                 0         -
pools/lock-release-pool/src/lib.rs                           404               100    75.25%          28                 8    71.43%         288                48    83.33%           0                 0         -
pools/lock-release-pool/src/test.rs                         2330                24    98.97%          55                 5    90.91%        1524                55    96.39%           0                 0         -
pools/siloed-lock-release-pool/src/lib.rs                    556               196    64.75%          38                17    55.26%         384               123    67.97%           0                 0         -
pools/siloed-lock-release-pool/src/test.rs                  1303                12    99.08%          38                 2    94.74%         695                18    97.41%           0                 0         -
pools/token-lock-box/src/lib.rs                              197                17    91.37%          13                 1    92.31%         113                 2    98.23%           0                 0         -
pools/token-lock-box/src/test.rs                             257                 0   100.00%           7                 0   100.00%          73                 0   100.00%           0                 0         -
registry/src/lib.rs                                            8                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
registry/src/test.rs                                          27                 0   100.00%           1                 0   100.00%          11                 0   100.00%           0                 0         -
rmn_proxy/src/lib.rs                                          66                12    81.82%           5                 1    80.00%          34                 3    91.18%           0                 0         -
rmn_proxy/src/test.rs                                        279                 0   100.00%          11                 0   100.00%          91                 0   100.00%           0                 0         -
rmn_remote/src/lib.rs                                        302                26    91.39%          16                 1    93.75%         171                10    94.15%           0                 0         -
rmn_remote/src/test.rs                                       393                 0   100.00%          14                 0   100.00%         133                 0   100.00%           0                 0         -
router/src/lib.rs                                            593                87    85.33%          18                 1    94.44%         374                43    88.50%           0                 0         -
router/src/test.rs                                          1186                 0   100.00%          29                 0   100.00%         497                 0   100.00%           0                 0         -
router/src/test_panic_receiver.rs                              5                 0   100.00%           2                 0   100.00%           5                 0   100.00%           0                 0         -
router/src/types.rs                                            3                 3     0.00%           3                 3     0.00%           3                 3     0.00%           0                 0         -
timelock/src/error.rs                                          6                 2    66.67%           1                 0   100.00%           6                 2    66.67%           0                 0         -
timelock/src/lib.rs                                          649                46    92.91%          32                 2    93.75%         393                18    95.42%           0                 0         -
timelock/src/roles.rs                                        141                10    92.91%           6                 0   100.00%          76                 7    90.79%           0                 0         -
timelock/src/storage.rs                                      115                15    86.96%          12                 1    91.67%          68                 7    89.71%           0                 0         -
timelock/src/test.rs                                        1479                16    98.92%          37                 0   100.00%         531                 1    99.81%           0                 0         -
timelock/src/types.rs                                          3                 3     0.00%           3                 3     0.00%           3                 3     0.00%           0                 0         -
token-admin-registry/src/lib.rs                              368                23    93.75%          18                 1    94.44%         257                 4    98.44%           0                 0         -
token-admin-registry/src/test.rs                             825                 0   100.00%          21                 0   100.00%         287                 0   100.00%           0                 0         -
token-admin-registry/src/types.rs                              2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                      35839              2363    93.41%        1529               340    77.76%       19431              1430    92.64%           0                 0         -```

</details>

> Commit `a5c79389` | [Full CI run](https://github.com/smartcontractkit/chainlink-stellar/actions/runs/30050780906)

<!-- Sticky Pull Request Commentcontract-coverage -->

@Fletch153

Fletch153 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

The five failing Go CI checks (E2E, Go Unit Tests, Integration ×2, Coverage) are pre-existing on main with byte-identical failure signatures — not introduced here: deployment/adapters references CommitteeVerifierClient.GetAllSignatureConfigs, which is absent from the bindings at current main, so every Go job fails at build. All contract-side checks (test-contracts, formatting, generated code) pass.

@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch from aeaff42 to 3410c65 Compare July 22, 2026 19:26
@Fletch153 Fletch153 changed the title Add data feeds cache deployment package and Go bindings Add data feeds cache and proxy bindings via reworked generator Jul 22, 2026
@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch from c393651 to 9b5104c Compare July 23, 2026 13:21
@Fletch153 Fletch153 changed the title Add data feeds cache and proxy bindings via reworked generator Add data feeds cache and proxy bindings Jul 23, 2026
@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch 7 times, most recently from f7386a7 to d6b704d Compare July 23, 2026 15:20
@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch from d6b704d to fda599a Compare July 23, 2026 16:00
@Fletch153
Fletch153 force-pushed the feature/DF-25429/data-feeds-contracts branch from 019b250 to 14b9721 Compare July 23, 2026 18:16
@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch 5 times, most recently from 24dc50e to 62fb6b4 Compare July 23, 2026 19:35
Three additive capabilities the data feeds contracts need; output for
all existing contracts is unchanged (verified byte-identical):

- soroban_sdk::I256 maps to *big.Int via new scval.I256ToScVal /
  I256FromScVal (4x64-bit two's-complement limb packing, range-checked)
- -readonly takes an explicit, typo-guarded list of read-only functions
  per contract, replacing the get_*/is_* name heuristic when present
- the parser now parses void functions (no return clause) instead of
  silently dropping them; -include-void names, per contract, the void
  functions that get generated methods

All per-function policy (void inclusion, read-only classification) is
resolved in main before generation: the function list is filtered and
each function stamped ReadOnly, so codegen renders the model with no
policy awareness. Also adds the missing soroban_sdk::String event-field
decode case and gofmt-canonical output.
Generated from the contracts/data-feeds nested workspace via the
existing pipeline: gen_interfaces builds the nested workspace into the
shared target dir (CARGO_TARGET_DIR), so its wasm artifacts are picked
up like every other contract's; gen_bindings gains the readonly_fns and
include_void_fns columns, set only on the data feeds rows.

Reads (latest_round, find_round, ...) generate as free simulations per
the explicit list; the ownership/upgrade void functions are opted in by
name; generated files are marked linguist-generated for review.
The data feeds changesets (chainlink deployment/data-feeds/changeset/
stellar) deploy the cache with a CreateContractV2 constructor argument
and upload replacement wasm for upgrades:

- DeployContractWithArgs / DeployContractBytesWithArgs build the
  create-contract host function with optional constructor args
- UploadContractWASM returns the wasm hash for upgrade flows

Concrete Deployer methods only; the stellardeps.SorobanContractDeployer
interface is unchanged — consumers needing the new methods define their
own interface over the concrete type.
@Fletch153
Fletch153 force-pushed the feature/DF-25434/data-feeds-deployment branch from 62fb6b4 to 667504a Compare July 23, 2026 19:43
- Handle I256 params, returns, tuple elements, and Vec<I256> in
  client codegen; import math/big only when a signature needs it
- Add scval.I256SliceToScVal and extend the round-trip test
- Decode #[topic] event fields from the event topic list; the
  value-map switch left them silently zero (DataId, DonId,
  ConfigVersion) — regenerates cre and data_feeds_cache clients
- Fold generated-file formatting and writing into writeGoFile
The fee bump was applied only to BaseFee, but rent and event fees
are paid from the resource fee declared in the soroban transaction
data, which was copied verbatim from simulation. When ledger state
drifted between simulate and submit, transactions failed with an
insufficient-refundable-fee error that no BaseFee bump could fix.
Apply the same cushion to the declared resource fee; the unused
refundable portion is refunded after execution.
Both scripts skipped missing inputs with a log line and exited 0,
so a renamed wasm or omitted build left stale committed output
that the check-generated diff gate could not see.
@Fletch153
Fletch153 marked this pull request as ready for review July 27, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant