docs(contracts): add reproducible deploy and upgrade scripts (#40)#53
Open
abrak01 wants to merge 1 commit into
Open
docs(contracts): add reproducible deploy and upgrade scripts (#40)#53abrak01 wants to merge 1 commit into
abrak01 wants to merge 1 commit into
Conversation
|
@abrak01 is attempting to deploy a commit to the alankcr1-6443's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
No baseline existed for contract CPU cost. Each Soroban host call (address
clone, storage read/write) is metered — redundant ones add up across every user
transaction.
Changes
Three files touched, one focused optimization per contract:
vinculo_sbt/src/lib.rs
one instance-storage read per mint.
each storage call.
staking_pool/src/lib.rs
6 times.
zeroing with StakeInfo::default() (4 field writes → 1).
vinculo_lending/src/lib.rs
reads; build DataKey::Loan(user) once instead of 3 times.
Benchmark
Each contract now includes bench_* tests that print cpu_instruction_cost and
memory_bytes_cost via env.budget():
run from any contract directory
cargo test --features soroban-sdk/testutils -- --nocapture
Behavior unchanged
Pure mechanical refactor — same logic, same storage keys, same return values.
All existing tests are preserved.
Reviewer step
Run the benchmark command above and confirm all tests pass and benchmark lines
print.
Closes #41