Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/a16z/magi
/ functions
Functions
297 in github.com/a16z/magi
⨍
Functions
297
◇
Types & classes
90
↓ 28 callers
Function
addr
Converts a [str] to an [Address]
src/config/mod.rs:509
↓ 15 callers
Function
convert_hash
Converts [Bytes32] into [H256]
src/network/handlers/block_handler.rs:383
↓ 13 callers
Method
get_block_with_txs
Fetches a block with transactions
src/driver/info.rs:33
↓ 11 callers
Method
remove
Removes a pending channel from the bank
src/derive/stages/channels.rs:125
↓ 10 callers
Function
hash
Converts a [str] to a [B256].
src/config/mod.rs:514
↓ 10 callers
Method
push_frame
Pushes a frame into the correct pending channel
src/derive/stages/channels.rs:62
↓ 8 callers
Method
get_block
(&self, block_num: u64)
src/l1/chain_watcher.rs:400
↓ 7 callers
Method
build
Build and returns a [Version] struct
src/version/mod.rs:14
↓ 7 callers
Method
epoch_by_number
Returns an epoch by number. Same as the first L1 block number in the epoch's sequencing window.
src/derive/state.rs:85
↓ 5 callers
Function
create_stage
()
src/derive/stages/channels.rs:403
↓ 5 callers
Method
start
Runs the Driver
src/driver/mod.rs:134
↓ 5 callers
Function
take_data
Splits a byte slice at the specified index (length) into a tuple of 2 byte slices
src/derive/stages/span_batch.rs:112
↓ 4 callers
Function
decode_bitlist
Decodes a bitlist into boolean values and returns a tuple of booleans + the original bitlist.
src/derive/stages/span_batch.rs:117
↓ 4 callers
Method
forkchoice_updated
Sends an `engine_forkchoiceUpdatedV2` (V3 post Ecotone) message to the engine.
src/engine/api.rs:210
↓ 4 callers
Method
generate_claims
Generate claims constructs a [`Claims`] instance. ## Panics This function will panic if the system time is before the UNIX_EPOCH.
src/engine/auth.rs:68
↓ 4 callers
Method
update_safe_head
Updates the current `safe_head` & `safe_epoch`. Also updates the current `unsafe_head` to the given `new_head` if `reorg_unsafe` is `true`, or if the
src/driver/engine_driver.rs:177
↓ 3 callers
Method
block_inputs
Returns a BlockInput vector for this batch. Contains all L2 block in the batch.
src/derive/stages/span_batch.rs:62
↓ 3 callers
Method
check_shutdown
Exits if a SIGINT signal is received
src/runner/mod.rs:224
↓ 3 callers
Function
convert_address
Converts [VecAddress] into [Address]
src/network/handlers/block_handler.rs:388
↓ 3 callers
Function
convert_byte_list
Converts an [ssz_rs::List] of bytes into [Bytes]
src/network/handlers/block_handler.rs:398
↓ 3 callers
Function
convert_byte_vector
Converts an [ssz_rs::Vector] of bytes into [Bytes]
src/network/handlers/block_handler.rs:393
↓ 3 callers
Function
convert_err
Converts a generic error to a [jsonrpsee::core::error] if one exists
src/rpc/mod.rs:107
↓ 3 callers
Function
convert_tx_list
Converts [ssz_rs::List] of [Transaction] into a vector of [RawTransaction]
src/network/handlers/block_handler.rs:411
↓ 3 callers
Function
convert_uint
Converts a [U256] into [ethers::types::U64]
src/network/handlers/block_handler.rs:403
↓ 3 callers
Method
create_forkchoice_state
Creates a [ForkchoiceState]: - `head_block` = `unsafe_head` - `safe_block` = `safe_head` - `finalized_block` = `finalized_head`
src/driver/engine_driver.rs:199
↓ 3 callers
Method
encode
Encodes the [`Claims`] in a [jsonwebtoken::Header] String format.
src/engine/auth.rs:78
↓ 3 callers
Method
fetch_ready_channel
Fetch the completed channel if it is ready
src/derive/stages/channels.rs:93
↓ 3 callers
Function
init
Starts the metrics server on port 9200
src/telemetry/metrics.rs:20
↓ 3 callers
Method
l1_info_by_hash
Returns a cached L1 block by block hash
src/derive/state.rs:55
↓ 3 callers
Function
mock_provider
(block: Option<Block<Transaction>>)
src/driver/info.rs:89
↓ 3 callers
Method
next
Returns the pending [PayloadAttributes]. If none exist it will call `Attributes::next()` to advance to the next block and return those attributes inst
src/derive/mod.rs:46
↓ 3 callers
Function
optimism_config
()
src/driver/info.rs:148
↓ 3 callers
Method
post
Helper to construct a post request through the client
src/engine/api.rs:115
↓ 3 callers
Method
start_driver
Creates and starts the [Driver] which handles the derivation sync process.
src/runner/mod.rs:211
↓ 3 callers
Method
update_forkchoice
Sends a `ForkChoiceUpdated` message to the [Engine] with the current `Forkchoice State` and no payload.
src/driver/engine_driver.rs:160
↓ 2 callers
Method
add_handler
Adds a handler to [Service]
src/network/service/mod.rs:46
↓ 2 callers
Method
base_body
Construct base body
src/engine/api.rs:104
↓ 2 callers
Function
build_subscriber
Subscriber Composer Builds a subscriber with multiple layers into a [tracing](https://crates.io/crates/tracing) subscriber and initializes it as the
src/telemetry/logging.rs:49
↓ 2 callers
Method
check_shutdown
Checks for shutdown signal and shuts down if received
src/driver/mod.rs:154
↓ 2 callers
Function
decode_field_element
( output_pos: &mut usize, input_pos: &mut usize, blob: &[u8], output: &mut [u8], )
src/l1/blob_encoding.rs:79
↓ 2 callers
Function
decode_u256
Decodes a U256 from an arbitrary slice of bytes
src/derive/stages/span_batch.rs:449
↓ 2 callers
Function
decode_uvarint_list
Decodes transaction nonces in the batch into a U64 vector
src/derive/stages/span_batch.rs:293
↓ 2 callers
Function
generate_http_provider
(url: &str)
src/l1/chain_watcher.rs:520
↓ 2 callers
Method
get_batcher_transactions
Given a block, return a list of [`BatcherTransactionData`] containing either the calldata or the decoded blob data for each batcher transaction in the
src/l1/chain_watcher.rs:446
↓ 2 callers
Function
get_l1_start_block
Retrieves the L1 start block number. If an overflow occurs during subtraction, the function returns the genesis block #0.
src/driver/mod.rs:367
↓ 2 callers
Method
is_ecotone_activation_block
Returns true if the block is the first block subject to the Ecotone hardfork
src/config/mod.rs:294
↓ 2 callers
Function
is_epoch_boundary
Returns `true` if the L2 block is the first in an epoch (sequence number 0)
src/runner/mod.rs:235
↓ 2 callers
Method
l2_info_by_timestamp
Returns a cached L2 block by block timestamp
src/derive/state.rs:67
↓ 2 callers
Method
new_payload
Sends an `engine_newPayloadV2` (V3 post Ecotone) message to the engine.
src/engine/api.rs:226
↓ 2 callers
Method
process_attributes
Initiates validation & production of a new block: - Sends the [PayloadAttributes] to the engine via `engine_forkchoiceUpdatedV2` (V3 post Ecotone) and
src/driver/engine_driver.rs:96
↓ 2 callers
Method
process_incoming
Receives new [BatcherTransactionMessage] messages from the channel and adds these to the end of the deque.
src/derive/stages/batcher_transactions.rs:53
↓ 2 callers
Method
purge
Resets the state of `self.attributes` by calling `Attributes::purge()`
src/derive/mod.rs:90
↓ 2 callers
Method
push_batcher_transactions
Sends Batcher Transactions & the L1 block they were received in to the Batcher Transactions receiver.
src/derive/mod.rs:72
↓ 2 callers
Method
push_payload
Sends the given [ExecutionPayload] to the [Engine] via `NewPayload`
src/driver/engine_driver.rs:150
↓ 2 callers
Function
reassemble_bytes
(output_pos: &mut usize, encoded_byte: [u8; 4], output: &mut [u8])
src/l1/blob_encoding.rs:100
↓ 2 callers
Method
recv_from_channel
Asynchronously receives from the block update channel. Returns `None` if the channel contains no messages.
src/l1/chain_watcher.rs:163
↓ 2 callers
Function
run_server
Starts the Magi RPC server
src/rpc/mod.rs:129
↓ 2 callers
Method
shutdown
Shuts down the driver
src/driver/mod.rs:149
↓ 2 callers
Function
start
Starts the [Discv5] discovery service and continually tries to find new peers. Returns a [Receiver] to receive [Peer] structs
src/network/service/discovery.rs:19
↓ 2 callers
Function
start_watcher
( l1_start_block: u64, l2_start_block: u64, config: Arc<Config>, )
src/l1/chain_watcher.rs:531
↓ 2 callers
Method
synced
True if there are no unfinalized blocks
src/driver/mod.rs:360
↓ 2 callers
Method
timestamp
Returns the batch timestamp
src/derive/stages/batches.rs:464
↓ 2 callers
Method
topics
The gossip topics accepted for new blocks
src/network/handlers/block_handler.rs:71
↓ 2 callers
Method
update_l1_info
Inserts data from the ``l1_info`` parameter into ``l1_hashes`` & ``l1_info`` maps. This also updates ``current_epoch_num`` to the block number of the
src/derive/state.rs:96
↓ 1 callers
Method
advance
Attempts to advance the execution node forward using either L1 info or blocks received on the p2p network.
src/driver/mod.rs:170
↓ 1 callers
Method
advance_safe_head
Attempts to advance the execution node forward one L1 block using derived L1 data. Errors if the most recent PayloadAttributes from the pipeline does
src/driver/mod.rs:184
↓ 1 callers
Method
advance_unsafe_head
Collects unsafe blocks received via p2p gossip and updates the forkchoice with the first available unsafe block.
src/driver/mod.rs:230
↓ 1 callers
Method
as_inputs
Returns a Block Input vector of the blocks in a batch.
src/derive/stages/batches.rs:472
↓ 1 callers
Method
assemble
Assembles the pending channel into channel data
src/derive/stages/channels.rs:192
↓ 1 callers
Method
await_engine_ready
Loops until the [EngineApi] is online and receives a response from the engine.
src/driver/mod.rs:161
↓ 1 callers
Method
batch_status
Returns the validity of a [Batch]
src/derive/stages/batches.rs:181
↓ 1 callers
Method
batcher_hash
Encodes batch sender as a [B256].
src/config/mod.rs:213
↓ 1 callers
Method
block_at
Fetches the L2 block for a given timestamp from the L2 Execution Client
src/driver/engine_driver.rs:208
↓ 1 callers
Method
block_valid
Determines if a block is valid. True if the block is less than 1 minute old, and correctly signed by the unsafe block signer.
src/network/handlers/block_handler.rs:99
↓ 1 callers
Function
bootnodes
Default bootnodes to use. Currently consists of 2 Base bootnodes & 1 Optimism bootnode.
src/network/service/discovery.rs:122
↓ 1 callers
Method
build_payload
Sends [PayloadAttributes] via a `ForkChoiceUpdated` message to the [Engine] and returns the [ExecutionPayload] sent by the Execution Client.
src/driver/engine_driver.rs:130
↓ 1 callers
Method
challenge_sync
Fast challenge mode - currently unsupported
src/runner/mod.rs:85
↓ 1 callers
Method
check_reorg
(&self)
src/l1/chain_watcher.rs:362
↓ 1 callers
Method
checkpoint_sync
Checkpoint sync mode. Syncs the execution client to a given checkpoint block, and then begins the normal derivation sync process via the [Driver] Not
src/runner/mod.rs:102
↓ 1 callers
Function
compute_l2_output_root
Computes the L2 output root. Refer to the [Optimism Spec](https://specs.optimism.io/protocol/proposals.html#l2-output-commitment-construction) for det
src/rpc/mod.rs:113
↓ 1 callers
Function
create_disc
Generates an [Enr] and creates a [Discv5] service struct
src/network/service/discovery.rs:68
↓ 1 callers
Function
create_swarm
Creates the libp2p [Swarm]
src/network/service/mod.rs:124
↓ 1 callers
Function
decode_address
Decodes arbitrary slice of bytes into an [Address]
src/derive/stages/span_batch.rs:425
↓ 1 callers
Function
decode_batches
Attempts to decode channel data into a [Batch] vector
src/derive/stages/batches.rs:408
↓ 1 callers
Function
decode_blob_data
Encodes a blob of data into a byte array
src/l1/blob_encoding.rs:10
↓ 1 callers
Function
decode_block_tx_counts
Decodes the number of transactions in the batch into a U64 vector
src/derive/stages/span_batch.rs:136
↓ 1 callers
Function
decode_post_ecotone_block_msg
Decodes a sequence of bytes to an [ExecutionPayloadEnvelope]. The Ecotone V3 block topic encoding includes the parent beacon block root as described i
src/network/handlers/block_handler.rs:147
↓ 1 callers
Function
decode_signatures
Decodes transaction `R` & `S` signature fields in the batch into a (U256, U256) vector
src/derive/stages/span_batch.rs:432
↓ 1 callers
Function
decode_tos
Decodes transaction `To` fields in the batch into an [Address] vector
src/derive/stages/span_batch.rs:412
↓ 1 callers
Function
decode_transactions
Decodes transactions in a batch and returns a [RawTransaction] vector
src/derive/stages/span_batch.rs:149
↓ 1 callers
Function
decode_tx_data
Decodes EIP-2718 `TransactionType` formatted transactions in the batch into a [TxData] vector
src/derive/stages/span_batch.rs:307
↓ 1 callers
Method
derive_attributes
Processes a given Block Input and returns [PayloadAttributes] for the block. Calls `derive_transactions` to generate the raw transactions
src/derive/stages/attributes.rs:75
↓ 1 callers
Method
derive_attributes_deposited
Derives the attributes deposited transaction for a given block and converts this to a [RawTransaction].
src/derive/stages/attributes.rs:155
↓ 1 callers
Method
derive_transactions
Derives the deposited transactions and all other L2 user transactions from a given block. Deposited txs include: - L1 Attributes Deposited (exists as
src/derive/stages/attributes.rs:119
↓ 1 callers
Method
derive_user_deposited
Derives the user deposited txs for the current epoch, and returns a [RawTransaction] vector
src/derive/stages/attributes.rs:168
↓ 1 callers
Method
encode
Encodes [AttributesDeposited] into `setL1BlockValues` transaction calldata, including the selector.
src/derive/stages/attributes.rs:348
↓ 1 callers
Method
engine_ready
Sends a `ForkchoiceUpdated` message to check if the [Engine] is ready.
src/driver/engine_driver.rs:83
↓ 1 callers
Method
equal
Returns if the provided JWT token is equal to the JWT secret.
src/engine/auth.rs:59
↓ 1 callers
Method
fast_sync
Fast sync mode - currently unsupported
src/runner/mod.rs:79
↓ 1 callers
Method
fetch_beacon_genesis_timestamp
Fetch the genesis timestamp from the beacon chain.
src/l1/blob_fetcher.rs:98
next →
1–100 of 297, ranked by callers