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(l1): implement the net_version rpc method #1037

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Commits on Oct 31, 2024

  1. Configuration menu
    Copy the full SHA
    8984c73 View commit details
    Browse the repository at this point in the history
  2. cargo fmt

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    bfe93c5 View commit details
    Browse the repository at this point in the history
  3. add net to rpc namespace

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    221f50f View commit details
    Browse the repository at this point in the history
  4. add net_version rpc test

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    456992c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7cb4168 View commit details
    Browse the repository at this point in the history
  6. fix(l1): add temporary fix to transaction filtering & handle tx filte…

    …ring unwrap edge case (lambdaclass#1018)
    
    **Motivation**
    
    <!-- Why does this pull request exist? What are its goals? -->
    
    To avoid panicking when the transaction filter fails to filter a
    transaction because we do not yet filter transactions with invalid tip.
    
    **Description**
    
    - Filter transactions whose effective gas tip calculation underflowed.
    - Handle the unwrap of the `effective_gas_tip` calculation. Even though
    this is an edge case that shouldn't happen, it is better to have a
    descriptive error if it happens someday than to panic.
    
    ---------
    
    Co-authored-by: fmoletta <[email protected]>
    2 people authored and h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    7c215ea View commit details
    Browse the repository at this point in the history
  7. refactor(l2): add -w flag to cmds that send txs (lambdaclass#1036)

    **Motivation**
    
    <!-- Why does this pull request exist? What are its goals? -->
    
    Nowadays, all the commands that send transactions do not wait for
    transaction receipts. If you run the same command multiple times the
    same transaction with the same nonce is going to be sent to the node;
    another problem is that the users have to perform additional steps to
    make sure that their transaction was finalized or not.
    
    As this is not an implementation problem but a misuse of the CLI, it'd
    be good for users to also have the option to wait for their transactions
    to be finalized.
    
    **Description**
    
    Adds a `-w` flag to the cmds `deploy`, `transfer`, `send`, `deposit`,
    `withdraw`, and `claim-withdraw` which when set, waits for the
    transaction sent to be finalized (a.k.a. wait for its receipt).
    ilitteri authored and h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    783e76e View commit details
    Browse the repository at this point in the history
  8. fix(l1): made the tx-spammer work with our node (lambdaclass#1027)

    **Motivation**
    
    Have the tx spammer running instead of immediatly shutting down when we
    are the first node in the devnet setup.
    
    **Description**
    
    This PR tackled a couple of issues until we were able to process an
    initial transaction, (they are small changes):
    - We were returning an error on `eth_getTransactionCount` when we either
    didn't have a `latest` block before genesis or at any point when we
    don't have `pending` blocks. The solution in this case was returning
    `0x0` in those cases.
    - When requesting `eth_getTransactionCount` on `pending` after some
    transaction went through we were defaulting to `0x0`, it appears that
    the idea is to default to the `latest` in those case which make sense.
    - There were a missing filter that made the node panic when building
    payloads for transactions with fees lower than the base_fee_per_gas,
    this generated that those kind of transactions stopped the node's
    ability to build blocks when they were in the mempool, we made a quick
    workaround in this PR, but will remove it in favor of lambdaclass#1018
    
    Closes lambdaclass#1026
    rodrigo-o authored and h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    202fff3 View commit details
    Browse the repository at this point in the history
  9. remove unnecessary map_err(..)

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    baa6f06 View commit details
    Browse the repository at this point in the history
  10. cargo fmt

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    9ea6450 View commit details
    Browse the repository at this point in the history
  11. feat(levm): implement Cache and refactor Db (lambdaclass#991)

    **Motivation**
    
    <!-- Why does this pull request exist? What are its goals? -->
    We currently have an in-memory database that should soon be replaced by
    the node's in-disk database. For that purpose we want to allow us to
    switch between both kinds of databases. The need to implement this PR's
    features and refactor the `Db` arose while working on lambdaclass#904.
    
    **Description**
    
    <!-- A clear and concise general description of the changes this PR
    introduces -->
    This PR includes:
    - Adding a `Cache` to store warm accounts. This removes the need of
    having `accessed_accounts` and `accessed_storage_slots` sets in
    `Substate` because we know that if they are cached then they are warm.
    - Making our `Db` implement the `Database` trait and interact with it
    only using methods and not it's attributes, so in the future we can
    implement that trait for the actual node's database.
    - Fix call opcodes and remove delegate attribute from `CallFrame`.
    
    <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->
    
    Part of lambdaclass#814.
    
    ---------
    
    Co-authored-by: Juani Medone <[email protected]>
    Co-authored-by: maximopalopoli <[email protected]>
    Co-authored-by: Javier Chatruc <[email protected]>
    4 people authored and h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    5095638 View commit details
    Browse the repository at this point in the history
  12. feat(l1): implement TrieIterator + GetAccountRange snap request h…

    …andling logic (lambdaclass#960)
    
    **Motivation**
    Handling snap capability message `GetAccountRange`
    
    <!-- Why does this pull request exist? What are its goals? -->
    
    **Description**
    * Add functionality to iterate the Trie (TrieIterator)
    * Add functionality to iterate over all accounts in the state
    (Store::iter_accounts)
    * Add logic to handle `GetAccountRange` snap request
    * Fix slim encoding of `AccountState`
    * Remove unneeded trait `RLPEncodeSlim`
    
    **Notes**
    * ~We don't have the listen loop implemented so this PR only adds the
    standalone logic for handling the request and creating a response, we
    still need to plug it in to the main loop.~
    * ~We are not able to run the hive test suite due to missing listen loop
    + old blocks being used by the test suite. I instead copied the state
    from a Geth execution (loading genesis + importing chain) and used that
    state to replicate hive tests as unit tests. These tests could be
    removed once we fix those two problems~
    
    <!-- A clear and concise general description of the changes this PR
    introduces -->
    
    <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->
    Partially addresses lambdaclass#184
    
    ---------
    
    Co-authored-by: Esteban Dimitroff Hodi <[email protected]>
    2 people authored and h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    af772f0 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    938cbd2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    8f6e53e View commit details
    Browse the repository at this point in the history
  15. fix all rebase conflicts

    h3lio5 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    bfc9ee0 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    b85fe76 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2024

  1. Configuration menu
    Copy the full SHA
    cbea54e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a595d25 View commit details
    Browse the repository at this point in the history