Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: rework action-level EffectingData implementations #2931

Merged
merged 11 commits into from
Aug 20, 2023

Commits on Aug 14, 2023

  1. Configuration menu
    Copy the full SHA
    ca2d021 View commit details
    Browse the repository at this point in the history
  2. crypto: use proto encoding of SpendBody for EffectingData

    For spends, only the body is considered effecting data, so we
    just hash the proto-encoded body.
    redshiftzero committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    4d6cb25 View commit details
    Browse the repository at this point in the history
  3. crypto: use proto-encoding of entire Dao action for EffectingData

    For DAO spends, outputs, and deposits, the entire action is
    considered effecting data.
    redshiftzero committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    56fa55a View commit details
    Browse the repository at this point in the history
  4. crypto: use proto encoded of swap / swap claim bodies for effect hash

    Note that previously the batch swap output data was _not_ included
    in the effect hash for the swap claim.
    redshiftzero committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    ae1823c View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. crypto: rework effect hash for staking-related actions

    For delegate and undelegate actions, the effecting data should
    be the entire action. For undelgate claims however, the effecting
    data should just be the body, thus excluding the proof which
    is on the undelegate claim action.
    redshiftzero committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    79529ee View commit details
    Browse the repository at this point in the history
  2. crypto: rework effect hash for position management actions

    The `PositionClose`, `PositionWithdraw`, and `PositionRewardClaim`
    actions effect hash still hashes the same data - but now first
    proto-encoded. The `PositionOpen` effect hash is slightly
    modified.
    
    Previously the `PositionOpen` effect hash consisted of:
    * The reserves R_1 and R_2
    * The ID of the position, which is a hash computed from the nonce,
    asset IDs of the trading pair, the fee, and p and q
    
    Now, by using the proto-encoded position, the effect hash includes the:
    * State, which is an enum determining if the position is opened,
    closed, claimed, or withdrawn (new)
    * Reserves R_1 and R_2
    * Phi (trading function), which means the fee, p, and q, as well as
    the trading pair (two asset IDs)
    * Nonce
    * A `close_on_fill` boolean indicating if this position is a limit order (new)
    
    The `PositionOpen` effect hash no longer includes the ID.
    redshiftzero committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    fd351f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2532ca2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8ff862d View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. Configuration menu
    Copy the full SHA
    7be7f5f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f74e896 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cdbfac7 View commit details
    Browse the repository at this point in the history