bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 23쪽 중 14쪽
to-end execution time**, as reported in Table 3 of the original paper.
Compared to Grevm 2.0, the new lock-free scheduler in Grevm 2.1 significantly improves overall performance, especially for simple and fast transactions like ERC20 and raw transfers, where we observed nearly **2×** higher throughput. For more complex transactions such as Uniswap swaps, performance drops by 32%. However, since the achieved throughput already surpasses our target of 1 Gigagas/s—reaching 11.25 Gigagas/s—we believe this is a worthwhile trade-off.
| Test | Num Txs | DB Latency | Sequential | Grevm 2.0 | Grevm 2.1 | Speedup |
| --------------- | ------- | ---------- | ---------- | --------- | --------- | ------- |
| Raw Transfers | 47620 | 0 | 185.74 | 123.01 | 66.17 | 1.85 |
| | | 100us | 7511.1 | 152.96 | 155.34 | 0.98 |
| ERC20 Transfers | 33628 | 0 | 329.55 | 105.51 | 65.19 | 1.61 |
| | | 100us | 10681 | 205.30 | 205.48 | 0.99 |
| Uniswap Swaps | 6413 | 0 | 771.83 | 60.36 | 88.89 | 0.68 |
| | | 100us | 24530 | 403.18 | 439.35 | 0.91 |
*Table 2: Grevm 2.0 v.s. Grevm 2.1 (uint = milliseconds)*
### Contention Transactions
We uses the same setup for contention transactions as 1.0, with a **hot ratio** parameter to simulate contention in transaction workloads. This parameter allows us to model skewed access patterns, where certain accounts or contracts are accessed more frequently than others.
* **Number of User Accounts**: **100,000** accounts used in the test.
* **Hot Ratio**: Defines the probability that a transaction will access one of the hot accounts.
* **Hot Ratio = 0%**: Simulates a uniform workload where each read/write accesses random accounts.
* **Hot Ratio > 0%**: Simulates a skewed workload by designating 10% of the total accounts as **hot accounts**. Each read/write operation has a probability equal to the hot ratio of accessing a hot account.
We also introduced a a test set called **Hybrid**, consisting of
* **60% Native Transfers**: Simple Ether transfers between accounts.
* **20% ERC20 Transfers**: Token transfers within three ERC20 token contracts.
* **20% Uniswap Swaps**: Swap transactions within two independent Uniswap pairs.
| Test | Num Txs | Total Gas |
| --------------- | ------- | ------------- |
| Raw Transfers | 47,620 | 1,000,020,000 |
| ERC20 Transfers | 33,628 | 1,161,842,024 |
| Hybrid | 36,580 | 1,002,841,727 |
*Table 3: Contention Transactions Execution Test Setup*
In Grevm 1.0, the performance of high-contention transactions was constrained by their high interdependence. Grevm 2.1 significantly improves performance in high-conflict scenarios. With a **30% hot ratio**, Grevm 2.1 outperforms 1.0 in all test cases except for ERC20 transfers with zero latency, where experimental variance is a factor. The most notable improvement is in the **Hybrid test case**, where Grevm 2.1 achieves a **29× speedup over sequential execution**, which is **5.55× over Grevm 1.0**, reaching a throughput of **2.96 gigagas/s**.
| Test | Num Txs | DB Latency | Sequential | Grevm 1.0 | Grevm 2.1 | Total Speedup | ThroughPut(Gigagas/s) |
| --------------- | ------- | ---------- | ---------- | --------- | --------- | ------------- | --------------------- |
| Raw Transfers | 47620 | 0 | 228.03 | 171.65 | 85.54 | 2.67 | 11.69 |
| | | 100us | 8933.0 | 4328.08 | 183.14 | 48.78 | 5.46 |
| ERC20 Transfers | 33628 | 0 | 366.76 | 92.07 | 88.89 | 4.13 | 11.25 |
| | | 100us | 11526 | 438.03 | 226.48 | 50.89 | 4.42 |
| Hybrid | 36580 | 0 | 333.66 | 220.14 | 235.33 | 1.42 | 4.25 |
| | | 100us | 9799.9 | 1874.7 | 344.88 | 28.42 | 2.90 |
*Table 4: Grevm 2.1 Contention Transactions Execution Speedup (unit = milliseconds, hot ratio = 30%)*
### Non-Parallelizable Transactions
To compare the performance of Grevm 2.1 and Block-STM in inherently non-parallelizable cases, we conducted a test with transactions that are highly dependent on each other. In this scenario, transactions form a chain where each transaction depends on the previous one, making parallel execution impossible. All tests are running with `db_latency = 0`. Same as Grevm 1.0, we use pevm as the reference implementation for Block-STM.
| Test | Num Txs | Sequential | Parallel | Speedup | Gigagas/s | CPU Usage |
| --------------------- | ------- | ---------- | -------- | ------- | --------- | --------- |
| Worst ERC20 Transfers | 33,628 | 350.32 | 369.96 | 0.95 | 2.70 | 128% |
| Worst Uniswap | 6,414 | 550.19 | 567.32 | 0.97 | 1.76 | 115% |
*Table 5: Grevm 2.1 Non-Parallelizable Transactions Test (unit = milliseconds)*
In these tests, Grevm 2.1 experiences only a **5% performance degradation** for ERC20 transfers and **3%** for Uniswap swaps compared to sequential execution. This result is a significant improvement over Block-STM, which suffers a **\~30% slowdown** in similar scenarios in our benchmark (see Table 5), aligning with the worst-case benchmark results reported in the Block-STM paper.
A more impressive result is the **CPU usage**, sampled using `pidstat`. Grevm 2.1 uses only **128% CPU for ERC20 transfers** and **115% CPU for Uniswap swaps**, whereas Block-STM consumes **2987% and 2761% CPU**, respectively. This represents a **95% reduction in CPU usage** compared to Block-STM. These findings highlight Grevm 2.1's efficiency in handling inherently non-parallelizable transactions, enhancing the execution engine's resilience against worst-case transaction dependencies.
| Test | Num Txs | Sequential Total | Grevm Parallel | Speedup | Gigagas/s | CPU Usage |
| ------------- | ------- | ---------------- | -------------- | ------- | --------- | --------- |
| Worst ERC20 | 33,628 | 292.45 | 423.45 | 0.69 | 2.36 | 2987% |
| Worst Uniswap | 6,414 | 488.12 | 687.13 | 0.71 | 1.46 | 2761% |
*Table 6: Block-STM (pevm implementation) Non-Parallelizable Transactions Test (unit = milliseconds)*
## Comparison, Analysis, and Future Work
### Optimistic Parallelism (Block-STM) Is MORE Efficient Than Expected
In parallel block execution, the dependencies between transactions play a crucial role in system performance. To quantify this impact, we introduce two key metrics: **Dependency Distance** and **Dependent Ratio**. If a transaction $$T\_j$$ depends on a preceding transaction $$T\_i$$, their dependency distance is defined as:
$$
\text{dependency\_distance} = j - i
$$
where $$j$$ and $$i$$ are the transaction indices. The number of transactions within a block that have dependencies is denoted as `with_dependent_txs`, and the dependent ratio is given by:
$$
\text{dependent\_ratio} = \frac{\text{with\_dependent\_txs}}{\text{block\_txs}}
$$
where **block\_txs** represents the total number of transactions in the block. The following figure illustrates the relationship between conflict rate and dependency distance under **fully optimistic execution**, based on a **1 Gigagas** block containing **47,620** normal transfer transactions:

The analysis reveals that even when **dependency\_distance = 1**, later transactions still have a certain probability of reading the correct data from earlier ones. When **dependency\_distance ≥ 4**, conflict rates drop significantly, showing an approximately inverse relationship with dependency distance.
This insight is highly practical: even in blocks with a high number of interdependent transactions, optimistic execution strategies (such as **Block-STM**) do not necessarily lead to excessive transaction re-execution. This is because transactions with greater dependency distances are less likely to conflict, minimizing performance degradation caused by re-executions. Moreover, when simple transactions—such as raw transfers and ERC20 transfers—are executed quickly, later transactions are more likely to read correct data from earlier ones. This happens because earlier transactions may have already completed execution, even when later transactions are running in parallel. Furthermore, if transaction reordering is an option, interleaving transactions with gapped dependencies can significantly improve optimistic parallelism by minimizing conflicts caused by short dependency distances.
This principle provides us the theoretical foundation for optimizing parallel execution engines, enabling maximum performance while ensuring correctness. For transactions with **short dependency distances (dependency\_distance ≤ 3)**, a more conservative scheduling strategy (e.g., **Task Group**) can help reduce conflicts. Meanwhile, transactions with **larger dependency distances** can be processed using fully optimistic execution to maximize parallelism and throughput.
### Implications of Dependency Distance on DAG Scheduling
When `dependency_distance` is large enough, hints and the dependency DAG play a less critical role, as transactions can be optimistically executed in parallel with minimal risk of re-execution. However, when it is small (e.g., $$≤ 3$$), the likelihood of conflicts increases, leading to frequent re-execution of affected transactions. Without dynamic dependency updates, some conflicting transactions may require over 10 execution attempts before confirmation. Introducing dynamic updates to the dependency DAG can significantly reduce the number of retries:
* **Execution-phase updates**: Lowers retries to about 5.
* **Validation-phase updates**: Further reduces retries to around 3.
* **Finality-phase updates**: Limits retries to at most 2.
Both dependency updates and transaction re-executions introduce overhead, requiring a balance where `dependency_distance` serves as the primary optimization metric.
In high-conflict scenarios, hints accuracy becomes particularly important. When hints are reliable, even execution-phase dependency removals can prevent conflicts, enabling faster scheduling. Conversely, inaccurate hints lead to frequent dependency DAG updates, degrading performance.
Task Group mechanism also mitigates reliance on hints accuracy. To ensure less-conflict execution even when hints are inaccurate, only transactions with `dependency_distance = 1` are grouped into task groups, preserving sequential execution and minimizing performance loss.
Overall, Grevm 2.1 offers no major advantage over Block-STM in low-conflict scenarios. However, in high-conflict environments, Grevm 2.1 significantly reduces retries (lowering CPU consumption) and optimizes execution based on `dependency_distance` when hints are reliable.
### Validation Scheduling
In Grevm 2.1, validation scheduling is slower than in Block-STM for two key reasons.
The first is straightforward: Grevm 2.1 does not execute transactions strictly in index order, whereas validation must proceed sequentially. As a result, validation often stalls, waiting for earlier transactions to complete before it can proceed, causing scheduling delays.
The second reason stems from an often-overlooked Block-STM optimization for validation. Block-STM introduces a `write_new_locations` flag for each transaction, indicating whether transactions have written to a new memory location. If a transaction encounters a conflict, `validation_idx` advances immediately to `tx + 1`, meaning validation does not need to wait for the conflicting transaction to be re-executed. After re-execution, if `write_new_locations = false`, only a single validation task is required, and `validation_idx` remains unchanged. It only advances when `write_new_locations = true`. Since this flag is rarely `true` after a retry, Block-STM efficiently accelerates validation by avoiding unnecessary re-validations for non-conflicting transactions.
Since validation is a prerequisite for finality, and features like remove dynamic dependency, async-commit, miner, and self-destruct all depend on finality, optimizing Grevm 2.0’s validation speed is critical.
A simple approach would be to validate transactions immediately after execution, following Block-STM’s strategy of checking the `write_set` of earlier transactions. However, this method also requires scanning the `read_set` of later transactions, which is computationally expensive. Checking the `write_set` of earlier transactions involves verifying only the latest written location, whereas checking the `read_set` of later transactions requires scanning all subsequent transactions to confirm they accessed the correct data—an inefficient process.
A more effective solution is to validate a transaction’s `write_set` and, if its modifications exceed the predicted range of hints, handle those out-of-range transactions using the standard validation process. However, for transactions within the hints range, their read/write sets do not require validation. Thus, optimizing Grevm 2.0’s validation speed relies heavily on hints accuracy. By dynamically refining hints and improving the validation mechanism, the system can significantly enhance performance while maintaining correctness.
### Future Work
Based on the above analysis, we propose several directions for future research:
1. **More efficient dependency DAG management.** Our findings indicate that using a single lock—whether Rust’s standard locks or a high-performance implementation like `parking_lot`—can reduce scheduler and overall performance by **10-20% (\~20ms, depending on transaction count and execution time).**, comparing with Block-STM's neat atomic index counter, To address this, we plan to investigate lock-free data structures to enhance the DAG manager’s efficiency.
2. **Optimizing validation.** Inspired by Block-STM’s `write_new_locations` flag, we aim to develop more efficient validation algorithms using sophisticated, high-performance data structures to minimize unnecessary re-validations.
3. **Empirical hints accuracy analysis.** We plan to conduct a comprehensive study on hints accuracy to determine the optimal balance between hints-based scheduling and dynamic dependency updates, based on real-world data from EVM blockchains like Ethereum, BNB chain, and Base.
## Authors
* <https://github.com/AshinGau>
* <https://github.com/nekomoto911>
* <https://github.com/stumble>
# Native Oracle
Cross-chain data has always been the soft spot of L1 design. Whether it's an asset bridge, a price feed, or any other piece of off-chain truth, the data has to enter the chain *somewhere* — and where that "somewhere" lives determines who you have to trust.
Most chains push that responsibility outside their consensus. An external oracle network signs the data, or a separate committee of bridge signers attests to deposits. The chain itself stays clean, but a new trust assumption is bolted on the side. If that side-channel breaks, the chain keeps running — but the data is wrong.
Gravity L1 collapses this. The same validators that produce blocks under AptosBFT also observe external data, vote on it, and write it to L1. There is no external oracle network. No multisig committee. The bridge isn't a separate service; it's a contract that receives data **already committed by the validator set**.
This is what "native" means in **Native Oracle**: the validator-attestation pipeline is part of the chain's state machine, not a service running next to it. The security of any data that lands on Native Oracle is the security of the chain itself — same validator set, same BFT thresholds, same finality window.
This post walks through the primitive, the one application built on it today (the Ethereum → Gravity L1 asset bridge), and the design space it opens up.
***
## The Core Abstraction
Native Oracle is a single contract deployed at a fixed system address on Gravity L1:
```
NativeOracle → 0x00000000000000000000000000000001625F4000
```
It exposes one core operation, callable only by `SYSTEM_CALLER` — a privileged consensus-time identity, *not* a normal account:
```solidity
function record(
uint32 sourceType, // 0 = BLOCKCHAIN; more reserved
uint256 sourceId, // e.g. chain ID
uint128 nonce, // must equal currentNonce + 1
uint256 blockNumber, // source-side provenance
bytes payload, // opaque blob
uint256 callbackGasLimit
) external;
```
A `recordBatch(...)` variant exists for delivering multiple events from the same source in one transaction.
Three design choices are worth pulling out:
**1. Replay protection is centralized.** Native Oracle enforces `nonce == currentNonce + 1` per `(sourceType, sourceId)` — strictly sequential, no gaps. An old message can never be replayed because the contract has already moved past its nonce. Application-level handlers don't need to maintain their own seen-nonce maps; in fact, the bridge receiver explicitly drops that work and leaves only a `__deprecated_processedNonces` storage slot for layout compatibility.
**2. Callbacks are routed, not pulled.** Each `(sourceType, sourceId)` pair can register a callback contract. When data is recorded, Native Oracle calls `onOracleEvent(...)` on the registered handler with a caller-specified gas limit. Resolution is two-layer: a default handler per source type, optionally overridden by a specialized handler for a specific `sourceId`. Governance manages the registry.
**3. Callbacks are fail-safe.** The handler returns `shouldStore: bool` — a handler that has fully consumed the payload (applied it to its own state) can return `false` to skip persistence and save gas. If the handler reverts or runs out of gas, Native Oracle catches it, emits `CallbackFailed(reason)`, and stores the payload anyway. The recording succeeds regardless. The data is committed by consensus; the application logic is best-effort.
The result is a clean separation: **Native Oracle is responsible for *****truth*** (consensus-attested, replay-safe), **and the application contract is responsible for *****meaning*** (decoding and acting on the payload).
***
## The Consensus Layer
Each Gravity validator runs an oracle observer alongside its block-production duties. For every registered task, the observer:
1. Polls the source endpoint (today, an Ethereum RPC) for the relevant events.
2. Restricts itself to **finalized** state — only events past Ethereum finality are eligible, eliminating reorg surprises.
3. Tracks a cursor (last scanned block) and a last-processed nonce, persisted to disk for fast restart.
4. Emits its observed batch into the consensus layer.
These observations then flow through the *same* AptosBFT machinery that orders normal transactions. Validators sign their observations; a quorum certificate forms; the agreed batch is committed in-line with regular block production. **There is no separate consensus instance, no separate signer set, no separate liveness assumption.**
When the batch is committed, the system call `NativeOracle.recordBatch(...)` is constructed and dispatched as a SYSTEM\_CALLER transaction, landing the data on L1 in the same block-execution flow as everything else.
This is what gives the bridge its security guarantee: **a deposit is finalized on Gravity when ⅔+ of validators have attested to its Ethereum finalization**, enforced by the same BFT thresholds the network uses to produce blocks. There is no separate bridge to compromise.
***
## End-to-End Today: ETH → Gravity Asset Bridge
The first application wired end-to-end through Native Oracle is the G token bridge: lock G on Ethereum, receive native G on Gravity. Here's the full path.

### Step 1 — Ethereum side
The user calls `GBridgeSender.bridgeToGravity(amount, recipient)` (or `bridgeToGravityWithPermit(...)` for gasless approval). The프로젝트로 돌아가기