Gas PR reporting, pool config packing, liquidation gas opt, sandwich protection (close #718 #722 #723 #725) - #882
Merged
Smartdevs17 merged 3 commits intoAug 29, 2026
Conversation
|
@dimka90 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@dimka90 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…: root-level gas report pipeline, packed config docs, sandwich reporting API - docs/ rehosted at repo root (storage.gas-reporting.mev-protection.gas-optimization) - API now exposes sandwich report + attack log via /api/mev (service, controller, routes) - lib.rs: add get_mev_auction_stats, get_mev_gas_bid_stats, get_mev_liquidation_auction, get_mev_liquidation_bid - mev.service rewired to on-chain entrypoints that actually exist
Contributor
Author
|
Update — meanwhile rolled in a few corrections (commit fb855d0):
Still true: |
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.
Closes #718
Closes #722
Closes #723
Closes #725
What's in this PR
#718 — Gas report generation for PRs
scripts/gas-report.sh— orchestrator: runsrun_benchmarks, diffs againstbenchmarks/baseline.json, appends tobenchmarks/history.json, emits a Markdown report (benchmarks/report.md), and exits non-zero on regression > threshold frombenchmarks/config.toml..github/workflows/gas-report.yml— PR gate: generates the report, uploads it as an artifact, comments on PRs when regressions are detected..github/workflows/gas-benchmarks.yml— onmain/weekly: re-runs the suite and commits the appended history.docs/gas-reporting.md— pipeline, commands, env overrides, baseline-blessing procedure.#722 — Storage slot packing for pool configuration
RiskParams: 4×i128 bps + u64) now packs into a singleu128slot (pack_risk_params/unpack_risk_paramsinrisk_params.rs; bit layout documented at the key).migrate_from_legacy+ lazy read-path migration; exposed asmigrate_pool_config_packedin the contract interface.docs/storage.md— storage layout reference, bit maps, migration, packing guidelines, expected gas saving (~72 B → 16 B payload).#723 — Liquidation gas optimization
abort_if_unprofitableearly-exit guard inliquidate()(before any transfer/storage mutation) when net recovery fails to clear the repaid debt + 0.2% floor. Batch path records each unprofitable item aserror_code 13and continues.batch_liquidateexposed as a first-class entrypoint (up toMAX_BATCH_SIZEpositions).docs/gas-optimization.md— design, effect on batches, CI regression testing, with/without comparison.#725 — Sandwich attack protection reporting + analytics
SandwichAttackLog,get_sandwich_attack_log,get_sandwich_report,SANDWICH_ATTACK_DETECTEDevent, plus existing slippage guards (max_slippage_bps, min_output_amount), commit–reveal, private routes, and liquidation auctions are documented.docs/mev-protection.md— full threat-model write-up and integrator surface.Build-state note (important)
cargo check -p stellarlend-lendingis green (0 errors). A bad earlier merge had deletedlending/src/events.rs(all events), removedEnv::invoker()-era code, and hit the SDK-27#[contractevent]/#[contracttype]size limits; these were repaired as a prerequisite and are part of this branch.contracts/hello-worldstill contains pre-existing merge debris unrelated to these four issues (manglisedcontracts/common/governance, missing module declarations, dup AMM blocks,circuit_breakerdrift) that the crate fails to build against on currentmain. I fixed the parts this PR touches (module decls, powers of hello-worlderror/types/governancewiring, SDK-27 drift) but did not finish the unrelated remainder. Please point me at a follow-up issue for that, or tell me to continue the repair on another branch.All new Rust code was
rustfmt-parse-checked; scripts arebash -n-checked.