-
Notifications
You must be signed in to change notification settings - Fork 174
docs(l1): general docs improvement #5771
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # ethrex-blockchain | ||
|
|
||
| Core blockchain logic for the ethrex Ethereum client. | ||
|
|
||
| For detailed API documentation, see the rustdocs: | ||
| ```bash | ||
| cargo doc --package ethrex-blockchain --open | ||
| ``` | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```rust | ||
| use ethrex_blockchain::Blockchain; | ||
|
|
||
| let blockchain = Blockchain::new(store, BlockchainOptions::default()); | ||
|
|
||
| // Add a block | ||
| blockchain.add_block(&block)?; | ||
|
|
||
| // Add transaction to mempool | ||
| blockchain.add_transaction_to_mempool(tx).await?; | ||
| ``` | ||
|
|
||
| ## Features | ||
|
|
||
| - `metrics`: Enable Prometheus metrics collection | ||
|
|
||
| ## Notes | ||
|
|
||
| ethrex is a post-merge client and does not support pre-merge (PoW) forks. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # ethrex-p2p | ||
|
|
||
| Peer-to-peer networking layer for the ethrex Ethereum client. | ||
|
|
||
| For detailed API documentation, see the rustdocs: | ||
| ```bash | ||
| cargo doc --package ethrex-p2p --open | ||
| ``` | ||
|
|
||
| ## Protocols | ||
|
|
||
| - **DiscV4**: Node discovery | ||
| - **RLPx**: Encrypted transport | ||
| - **eth/68**: Block and transaction propagation | ||
| - **snap/1**: Snap sync for state synchronization | ||
|
|
||
| ## Features | ||
|
|
||
| - `experimental-discv5`: Enable discv5 node discovery (experimental) | ||
| - `sync-test`: Testing utilities for sync |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # ethrex-rpc | ||
|
|
||
| JSON-RPC API implementation for the ethrex Ethereum client. | ||
|
|
||
| For detailed API documentation, see the rustdocs: | ||
| ```bash | ||
| cargo doc --package ethrex-rpc --open | ||
| ``` | ||
|
|
||
| ## Supported Namespaces | ||
|
|
||
| - `eth_*`: Standard Ethereum methods | ||
| - `engine_*`: Consensus client communication | ||
| - `debug_*`: Debugging and tracing | ||
| - `net_*`: Network information | ||
| - `admin_*`: Node administration | ||
| - `web3_*`: Web3 utilities | ||
| - `txpool_*`: Transaction pool inspection |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,29 @@ | ||||||||||||
| //! Gas price estimation for `eth_gasPrice` RPC method. | ||||||||||||
| //! | ||||||||||||
| //! This module implements the gas price oracle that estimates a reasonable | ||||||||||||
| //! gas price based on recent block history and network conditions. | ||||||||||||
|
|
||||||||||||
| use crate::rpc::{RpcApiContext, RpcHandler}; | ||||||||||||
| use crate::utils::RpcErr; | ||||||||||||
| use ethrex_blockchain::BlockchainType; | ||||||||||||
| use serde_json::Value; | ||||||||||||
|
|
||||||||||||
| // TODO: This does not need a struct, | ||||||||||||
| // but I'm leaving it like this for consistency | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove the explanation? |
||||||||||||
| // with the other RPC endpoints. | ||||||||||||
| // The handle function could simply be | ||||||||||||
| // a function called 'estimate'. | ||||||||||||
| /// Handler for the `eth_gasPrice` RPC method. | ||||||||||||
| /// | ||||||||||||
| /// Returns the current gas price in wei as a hexadecimal string. | ||||||||||||
| /// The price is calculated as: `base_fee + estimated_priority_fee + operator_fee (L2 only)`. | ||||||||||||
| /// | ||||||||||||
| /// # Algorithm | ||||||||||||
| /// | ||||||||||||
| /// 1. Gets the base fee from the latest block header | ||||||||||||
| /// 2. Estimates a reasonable priority fee (gas tip) by analyzing recent transactions | ||||||||||||
| /// 3. For L2 nodes, adds the operator fee if configured | ||||||||||||
| /// | ||||||||||||
| /// # Example Response | ||||||||||||
| /// | ||||||||||||
| /// ```json | ||||||||||||
| /// "0x3b9aca00" // 1 Gwei in hexadecimal | ||||||||||||
| /// ``` | ||||||||||||
|
Comment on lines
+22
to
+26
|
||||||||||||
| /// # Example Response | |
| /// | |
| /// ```json | |
| /// "0x3b9aca00" // 1 Gwei in hexadecimal | |
| /// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation refers to "eth Protocol" and "snap Protocol" without the
/version specifier. For consistency with the rest of the documentation (e.g., "eth/68", "snap/1"), consider using "eth/68 Protocol" and "snap/1 Protocol".