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

feat(trading-proto-upgrade): fees fixes among other things #2109

Open
wants to merge 42 commits into
base: dev
Choose a base branch
from

Commits on May 9, 2024

  1. use u8 for forkid

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    13a798e View commit details
    Browse the repository at this point in the history
  2. add fixmes, amend me

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    9a7d81b View commit details
    Browse the repository at this point in the history
  3. Negotiate the taker payment spend fee

    Actually should be called funding spend fee or taker payment fee, but we are just following the current code naming at the moment.
    
    The negotiation goes as follows:
    1- Taker and maker each decide how much this fee should be at the beginning of the swap.
    
    2- The taker will send the maker their proposed fee during negotiation,
       if the maker deems the fee as low enough (less than 90% of the maker's own calculated fee),
       they will refuse to trade before the trade starts. Otherwise, they
       will continue and use this fee for validation later.
    
    3- The maker will validate that the taker has accounted for this fee in
       the funding transaction.
    
    4- The taker will validate that the taker payment preimage (generated by the maker)
       uses the negotiated fee or greater (greater number will deduct from the maker's trading volume anyway).
       If not, the taker will stop the trade since the maker is clearly stealing funds that isn't his
       which might affect the completion of the swap if the fee is low.
    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    a844f62 View commit details
    Browse the repository at this point in the history
  4. Use big_decimal_from_sat & sat_from_big_decimal for conversions t…

    …o u64
    
    The big decimal might be a fraction less than zero and gets converted to
    zero when sent over the wire (because we send the fee as u64).
    
    Scale it properly before sending it.
    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    151f5a8 View commit details
    Browse the repository at this point in the history
  5. fix tests

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    9f722fb View commit details
    Browse the repository at this point in the history
  6. can't clamp the fee to 1 since it's probably higher than the fee

    noticed this in the integration tests, the fee might be a fraction so
    clamping it to one yields a fee higher than the actually one, thus fails
    the ratio check
    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    ef28a6c View commit details
    Browse the repository at this point in the history
  7. remove wrong transition

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    0bd984a View commit details
    Browse the repository at this point in the history
  8. add some tests

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    ad21f4e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ff05d06 View commit details
    Browse the repository at this point in the history
  10. don't actually sign anything to avoid unwrapping

    use a signature-size dummy date instead
    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    c20bac2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2ff43ad View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7a92123 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    225b776 View commit details
    Browse the repository at this point in the history
  14. calculate the taker payment spend tx size as per the new protocol

    taker payment spend is actually taker payment here, next commit should fix the naming inconsistencies
    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    b221def View commit details
    Browse the repository at this point in the history
  15. fix formatting

    mariocynicys committed May 9, 2024
    Configuration menu
    Copy the full SHA
    481ba3e View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. first batch of renamings

    mariocynicys committed May 10, 2024
    Configuration menu
    Copy the full SHA
    e0f649c View commit details
    Browse the repository at this point in the history
  2. always wait for maker payment before proceeding with taker payment spent

    don't depend on no variable on this regard
    mariocynicys committed May 10, 2024
    Configuration menu
    Copy the full SHA
    d1f2d1b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d90ad0e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0a4248c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3bd51d1 View commit details
    Browse the repository at this point in the history
  6. format

    mariocynicys committed May 10, 2024
    Configuration menu
    Copy the full SHA
    f4d18d6 View commit details
    Browse the repository at this point in the history
  7. fix the names in tests

    mariocynicys committed May 10, 2024
    Configuration menu
    Copy the full SHA
    d18bf96 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Configuration menu
    Copy the full SHA
    4848cb0 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. merge with origin/dev

    mariocynicys committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    b6ee698 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. Configuration menu
    Copy the full SHA
    4f5a04a View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. claimation -> claiming

    mariocynicys committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    130fc88 View commit details
    Browse the repository at this point in the history
  2. remove unused method

    mariocynicys committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    ec3ffe3 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. move the fixme to the appropriate place

    also changed to todo
    mariocynicys committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    9cb9818 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c86bade View commit details
    Browse the repository at this point in the history
  3. remove fixme about the locktime used for btc

    revising the commit history, looks like this was deliberate
    mariocynicys committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    a2e4bfa View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c383862 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a08a981 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2024

  1. Configuration menu
    Copy the full SHA
    ba0037f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c970e25 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0ea4f0c View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Configuration menu
    Copy the full SHA
    db11ed9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28fc442 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. add a missing fixme

    always rename discuss markers to fixmes since i forget about them xD
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    638d90e View commit details
    Browse the repository at this point in the history
  2. use get_sender_trade_fee for non-htlc TXs

    there is no calculatable tx_size for other tx (non-htlc) (like funding and maker payment txs). their fees depend really on the utxos we have and whether they are segwit or not.
    used get_sender_trade_fee for now, though I think this method needs reviewing since its doc comment doesn't make a lot of sense
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    12e1b66 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. merge with origin/dev

    mariocynicys committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    bc32198 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2024

  1. merge with origin/dev

    mariocynicys committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    241af5a View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2024

  1. merge with dev

    mariocynicys committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    100951b View commit details
    Browse the repository at this point in the history