Upgrade Soroban SDK in stellar-demo-staking example contract

Aperta
#158 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust, wasm
Ambito
blockchain

Direzione di ricerca

Inizia da examples/basic-react-app/contracts/stellar-demo-staking/Cargo.toml e Cargo.lock, quindi esamina il codice sorgente del contratto per individuare le API dell'SDK interessate dall'aggiornamento da v22 a v25 o v26. Esegui cargo update e la compilazione con cargo build --target wasm32-unknown-unknown --release, quindi esegui i test del contratto e prova localmente con uno smoke test il deployment sulla testnet di Stellar. Il lavoro è completato quando gli avvisi relativi alle dipendenze sono stati risolti, il contratto viene compilato correttamente e i test passano, e tutti i riferimenti interessati in README o nel quickstart sono stati aggiornati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

dependencies enhancement rust

Summary

The Soroban demo contract under `examples/basic-react-app/contracts/stellar-demo-staking` is pinned to `soroban-sdk` v22, which transitively brings in vulnerable versions of `stellar-xdr` (22.1.0) and `soroban-env-host` (22.1.3). Both have open Dependabot advisories that can only be resolved by bumping the SDK majors.

Context

Two open Dependabot alerts on `examples/basic-react-app/contracts/stellar-demo-staking/Cargo.lock`:

Advisory Package Current → Patched Severity
GHSA-x57h-xx53-v53w `stellar-xdr` 22.1.0 → 25.0.1 moderate
GHSA-pm4j-7r4q-ccg8 `soroban-env-host` 22.1.3 → 26.0.0 low

Neither is exploitable in the demo's current usage — `soroban-env-host` runs inside Stellar validators (not in our build), and `stellar-xdr`'s `StringM::from_str` bypass only matters if the contract parses untrusted XDR strings, which the staking demo doesn't. The alerts are being dismissed in the Security tab in the meantime.

Why upgrade anyway

  • Keeps the demo contract aligned with current Soroban tooling and protocol version
  • Removes a recurring source of Dependabot noise on the example contract
  • Future contributors copying this example get an up-to-date starting point

Goal

Bump `soroban-sdk` from v22 to a current major (v25 or v26) in:

  • `examples/basic-react-app/contracts/stellar-demo-staking/Cargo.toml`
  • the matching `Cargo.lock`

Scope

  • Update `soroban-sdk` version in `Cargo.toml`
  • `cargo update` to refresh `stellar-xdr`, `soroban-env-host`, and friends
  • Adjust contract source for any breaking host-API or type changes between SDK majors
  • Verify the contract still builds (`cargo build --target wasm32-unknown-unknown --release`) and tests pass
  • Smoke-test deployment locally (Stellar testnet) before merging
  • Update any README / quickstart instructions that reference the SDK version

Notes

  • Priority: low — example/demo code only, not published as a package
  • Not a release blocker for any `@openzeppelin/ui-*` package
Lingua principale
TypeScript
Stelle
7
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenZeppelin/openzeppelin-ui

Tutte le issue di OpenZeppelin/openzeppelin-ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.