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: draft implementation of NEP-366 #7497

Closed
wants to merge 31 commits into from

Commits on Aug 29, 2022

  1. Draft implementation of DelegateAction (NEP-366)

    This is a draft implementation of NEP-366 (near/NEPs#366)
    
    Not done yet:
    * Need to implement DelegateAction for implicit accounts (nonce problem)
    * Need new error codes for DelegateAction
    * Implement Fees for DelegateAction
    * Add tests
    Egor Ulesykiy committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    ce474eb View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2022

  1. Rename 'publisher_id' to 'relayer_id'

    Egor Ulesykiy committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    3eb7f02 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2022

  1. Updated according to the discussion in NEP-366

    * Removed published_id
    * Added sender_id to DelegateAction
    * All things are verified when action is processing except verification
      of DelegateAction count in the transaction and verification wheher
      DelegateAction contains the nested ones
    * Added block_hash, nonce, public_key fields to DelegateAction
    * Gas is refunded to Transaction signer, deposit is refund to Receipt
      predecessor (because publisher_id has been removed)
    
    Need to be done:
    1. `block_hash` isn't verified because there is not access to Store from
       `runtime'
    2. Need to apply recommendation to `action_array_serde`: https://near.zulipchat.com/#narrow/stream/295302-general/topic/recursive.20types.20in.20borsh-rs/near/305181116
    3. Need to add unit tests
    Egor Ulesykiy committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    433b158 View commit details
    Browse the repository at this point in the history
  2. Add fees for DelegateAction.

    Egor Ulesykiy committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    a7bcf89 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2022

  1. Configuration menu
    Copy the full SHA
    529ca2c View commit details
    Browse the repository at this point in the history
  2. Add the inner actions' send fees to the total send fee

    Egor Ulesykiy committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    cfb9780 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2022

  1. Charge the send fee for the inner actions twice

    Egor Ulesykiy committed Nov 2, 2022
    Configuration menu
    Copy the full SHA
    602baca View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. Refactor deserialization the inner actions

    * Handle a nested DelegateAction while the parent one is deserialized
    Egor Ulesykiy committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    3b78721 View commit details
    Browse the repository at this point in the history
  2. Applied max_block_height

    Egor Ulesykiy committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    106dc67 View commit details
    Browse the repository at this point in the history
  3. Fix delegate_cost.exec_fee todo

    Egor Ulesykiy committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    ee124a6 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2022

  1. Charge DelegateAction's 'send_fee' in two steps

    1. Charge the inner actions' `send_fee` on Relayer shard and prepaid the
       `send_fee` for Sender shard
    2. Burn the inner actions' `send_fee` on Sender shard (when
       DelegateAction is processed)
    Egor Ulesykiy committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    11c29fc View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. Configuration menu
    Copy the full SHA
    b344298 View commit details
    Browse the repository at this point in the history
  2. Use signer_public_key instead of delegate_action.public_key in a …

    …new receipt
    Egor Ulesykiy committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    d6ef8ba View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. Add tests to actions.rs. Fix tests in transaction.rs

    Egor Ulesykiy committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    df86e3a View commit details
    Browse the repository at this point in the history
  2. Return AccountDoesNotExist error if sender doesn't exist

    Egor Ulesykiy committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    59a5986 View commit details
    Browse the repository at this point in the history
  3. Fix review issues

    Egor Ulesykiy committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    cd289d4 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. Add protocol_feature_delegate_action

    The feature flag enables DelegateAction support
    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    9a9c0da View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f34acda View commit details
    Browse the repository at this point in the history
  3. Create test_delegate_action_deserialization for stable build

    This test fails if "protocol_feature_delegate_action" is disabled.
    Therefore another version of this test has been added which works on
    stable build.
    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    704c524 View commit details
    Browse the repository at this point in the history
  4. Applied cargo fmt

    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    88973ce View commit details
    Browse the repository at this point in the history
  5. Updated snapshots for tests::test_json_unchanged test

    Cause: runtime::config_store::tests::test_json_unchanged fails
    
    The following command created the snapshots:
    `cargo insta test --accept -p near-primitives -- test_json_unchanged`
    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    335537e View commit details
    Browse the repository at this point in the history
  6. Merge branch 'master' into NEP-366

    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    7575c90 View commit details
    Browse the repository at this point in the history
  7. Update DelegateAction feature version number

    - Update PROTOCOL_VERSION
    - Update ProtocolFeature::DelegateAction version number
    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    010d718 View commit details
    Browse the repository at this point in the history
  8. Apply cargo fmt

    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    1935499 View commit details
    Browse the repository at this point in the history
  9. Update snapshots and error schema for tests

    Egor Ulesykiy committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    79915fd View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Use safe_add_gas in apply_delegate_action function

    Egor Ulesykiy committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    155054f View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2022

  1. Add comments which explain what's going on

    Egor Ulesykiy committed Nov 25, 2022
    Configuration menu
    Copy the full SHA
    81f4eb7 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2023

  1. Rename protocol_feature_delegate_action with protocol_feature_nep366_…

    …delegate_action
    Egor Ulesykiy committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    d0c3787 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2023

  1. Add comments and remove new_delegate_actions

    Egor Ulesykiy committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    e9e1f8f View commit details
    Browse the repository at this point in the history
  2. Add "test_delegate_action_must_be_only_one" test

    Egor Ulesykiy committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    d5cb1a0 View commit details
    Browse the repository at this point in the history
  3. Add a test case for ACTION_DELEGATE_NUMBER

    Egor Ulesykiy committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    c9eb505 View commit details
    Browse the repository at this point in the history