Release Candidate: Protocol v4.0.0-rc0
Pre-releaseRelease candidate for testnet.
Protocol v4.0.0 Draft Release Notes
Highlights
This release includes changes in three major areas:
- Order Book Features
- Reduce-Only Orders
- Conditional Order Improvements
- Risk and Safety Improvements
- IBC Withdrawal Rate Limiting
- Subaccount Withdrawal Gating
- Community Enabled Slashing
- Cosmos-related Improvements
- Added x/authz module
- Cosmos SDK v0.50 Upgrade
See below for a detailed breakdown of the changes.
What's New?
Reduce-Only Orders
This feature adds support for Fill-Or-Kill and Immediate-Or-Cancel + Reduce-Only orders. Reduce-Only orders may not be enabled on any other order types. FOK or IOC orders can be either short term or conditional. Reduce-only orders can be submitted to the protocol by marking the timeInForce
boolean field on the Order object to be true
. Support for non-FOK or IOC Reduce Only orders will be added in a future update.
- Indexer account for reduce only resize errors (#963)
- E2E Tests for Replacement RO Orders, allow all types of RO order replacements (#949)
- Reduce Only FOK e2e tests (#939)
- Allow FOK/IOC Reduce Only Orders (#919)
Conditional Order Improvements
Improved the telemetric and triggering for conditional orders.
- Add latency and gauge metrics for conditional orders (#1014)
- Add some telemetry for conditional order triggering (#958)
- Trigger conditional orders using traded price within the block (#945)
- Update state R/W methods (#938)
- State R/W methods for last trade price (#910)
IBC Withdrawal Rate Limiting
This safety feature adds rate-limiting for asset withdrawal from the dYdX chain, analogous to the IBC rate limit modules on Stride and Osmosis. It uses a Continuous Token Bucket algorithm as the underlying rate-limit mechanism, where withdrawal capacity recovers towards a baseline during each block. Default parameters only include rate limit for USDC.
The default software rate limits net-withdrawal of Noble USDC, at below levels:
max(1% of TVL, $1mm) per hour
AND
max(10% of TVL, $10mm) per day
These rate limit parameters can be updated by governance via MsgSetLimitParams
.
- Update default rate limit params for USDC (backport #1056) (#1057)
- Add licensing info in
x/ratelimit
and attributions to Stride (backport #1031) (#1036) - Fix
x/ratelimit
ProcessWithdrawal
logic; improve info logs (backport #1044) (#1050) - Add upgrade handler for ratelimit keeper (#1019)
- Implement queries for x/ratelimit; get limiter and capacity together in keeper (#1013)
- Wire x/ratelimit methods to IBC transfer logic (#962)
- Implement messages, genesis in
x/ratelimit
(#968) x/ratelimit
: ImplementUpdateCapacityEndBlocker
(#941)- Implement
GetBaseline
(#897)
Subaccount Withdrawal Gating
Subaccount withdrawal gating will block all subaccount transfers and withdrawals for 50 blocks. Withdrawal gating will be triggered if 5 minute chain outage occurs or a negative equity subaccount cannot be liquidated / deleveraged.
- Add RPC query endpoint for withdrawal gating block heights (#964)
- Halt withdrawals if chain outage seen within the last 5 minutes (#955)
- Fix withdrawal gating double usage of metrics name for two different types of counters. (#972)
- Gate withdrawals if negative TNC subaccount encountered after liquidation and deleveraging steps (#936)
- Write block number to state when encountering zero-fill deleveraging op (#904)
- Block withdrawals if a negative equity subaccount was recently seen in state (#878)
Community Enabled Slashing
Exposed a MsgSlashValidator
message that can be included in a governance proposal. This can be used by the community to slash validators that have misbehaved.
Added x/authz Module
By popular request, the x/authz module was added from cosmos-sdk.
- Enable authz module to allow granting privileges (#960)
Cosmos SDK v0.50 Upgrade
The Cosmos SDK has been upgraded to v0.50.3 allowing features such as optimistic execution and vote extensions to be enabled in future protocol releases. See the Cosmos SDK 0.50.0 release announcement and release notes for additional details.
- Bump Cosmos-SDK version for updated default gov parameters (#1017)
- Disable
MsgCancelProposal
(#1015) - Re-add Rosetta cmd (#1002)
- Upgrade Cosmos to 0.50.3 to be able to re-add rosetta cmd. (#1000)
- Remove genesis check that isn't needed since the issue was with how testapp was simulating block processing. (#993)
- Reduce usage of basic_manager.ModuleBasics in favor of using module.NewBasicManagerFrom... (#984)
- Fix CLI tests to correctly generate module address (#981)
- Update usage of mocks and re-enable test. (#975)
- Fix bogus account numbers being generated in tests and re-enable tests. (#976)
- Ensure that we use the client context with AutoCLI (#966)
- Have testing genesis.sh match expected gov parameters for 0.50 (#935)
- Add 4.0.0 upgrade handler for Cosmos 0.47 -> 0.50 upgrade handler. (#918)
- Integrate AutoCLI as part of Cosmos 0.47 -> 0.50 upgrade and re-add a few standalone commands that changed packages (#932)
- Remove DB shutdown, Cosmos 0.50 SDK does this now in BaseApp (#920)
- Address nit and fix Cosmos 0.50 post merge conflict (#922)
- Upgrade to Cosmos 0.50.1 and CometBFT 0.38 (#867)
Bug Fixes
- Fix --home flag being ignored in cosmos v0.50 (backport #1053) (#1055)
- Fix settled funding event emission (backport #1051) (#1054)
- Make funding payment event ordering deterministic (#921)