Skip to content

Commit

Permalink
refactor: remove unneeded propose and da oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Sep 10, 2024
1 parent 64e7cf3 commit 0303f15
Show file tree
Hide file tree
Showing 43 changed files with 200 additions and 823 deletions.
1 change: 0 additions & 1 deletion .github/workflows/devnet-deploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ jobs:
echo "TF_VAR_REGISTRY_CONTRACT_ADDRESS=$(extract registryAddress)" >>$GITHUB_ENV
echo "TF_VAR_INBOX_CONTRACT_ADDRESS=$(extract inboxAddress)" >>$GITHUB_ENV
echo "TF_VAR_OUTBOX_CONTRACT_ADDRESS=$(extract outboxAddress)" >>$GITHUB_ENV
echo "TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$(extract availabilityOracleAddress)" >>$GITHUB_ENV
echo "TF_VAR_FEE_JUICE_CONTRACT_ADDRESS=$(extract feeJuiceAddress)" >>$GITHUB_ENV
echo "TF_VAR_FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$(extract feeJuicePortalAddress)" >>$GITHUB_ENV
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ services:
REGISTRY_CONTRACT_ADDRESS: "0x589a9634c1d00c62e47b3b7a790c8dc986b3d40d"
INBOX_CONTRACT_ADDRESS: "0x12d9b5effc69bf5c0c29c8258c6b6fa95a08de74"
OUTBOX_CONTRACT_ADDRESS: "0x3ec4b6c68a8c2ce4c78cdd465b3019b11a568d1d"
AVAILABILITY_ORACLE_CONTRACT_ADDRESS: "0x98a4089127f3f5d555656f1c9b1801342c9d6bce"
FEE_JUICE_CONTRACT_ADDRESS: "0x73c43b919973711e096bfc04c9d4b3be511ffc0b"
FEE_JUICE_PORTAL_CONTRACT_ADDRESS: "0xdf25b0a34dbee9f25518f7a4d63bab8b3bb3e496"
ETHEREUM_HOST:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ As for that, we highly recommend reading [this very nice post](https://dba.xyz/d
Essentially Data Publication $\subset$ Data Availability, since if it is available, it must also have been published.
This difference might be small but becomes important in a few moments.

Progressing the state of the validating light node requires that we can convince it (and therefore the [availability oracle](./index.md#availability-oracle)) that the data was published - as it needs to compute the public inputs for the proof.
Progressing the state of the validating light node requires that we can convince it that the data was published - as it needs to compute the public inputs for the proof.
The exact method of computing these public inputs can vary depending on the data layer, but generally, it could be by providing the data directly or by using data availability sampling or a data availability committee.

The exact mechanism greatly impacts the security and cost of the system, and will be discussed in the following sections.
Expand Down Expand Up @@ -246,7 +246,7 @@ Assuming that this is a decent guess, and we can estimate the data requirements
Using the values from just above for transaction data requirements, we can get a ball park estimate of what we can expect to require at different throughput levels.

<!-- prettier-ignore -->
|Throughput | Everyone | Someone | Total |
|Throughput | Everyone | Someone | Total |
|:-----:|:-----:|:-----:|:-----:|
| 1 TPS | $512 \dfrac{byte}{s}$ | $1036 \dfrac{byte}{s}$ | $1548 \dfrac{byte}{s}$ |
| 10 TPS | $5120 \dfrac{byte}{s}$ | $10360 \dfrac{byte}{s}$ | $15480 \dfrac{byte}{s}$ |
Expand Down
40 changes: 8 additions & 32 deletions docs/docs/protocol-specs/l1-smart-contracts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ When presented with a new [`ProvenBlock`](../rollup-circuits/root-rollup.md) and
The `archive` used as public input is the archive after the new header is inserted (see [root rollup](./../rollup-circuits/root-rollup.md)).

```python
def process(block: ProvenBlock, proof: Proof):
def propose(block: ProvenBlock, proof: Proof):
header = block.header
block_number = header.global_variables.block_number

Expand Down Expand Up @@ -57,19 +57,15 @@ Namely, we need the cross-chain messages to be published to L1, but the rest of
:::info Validium or Rollup
If a different data availability layer than Ethereum is used for the block body, we are effectively building a Validium.
If we use Ethereum for the block body, we are building a Rollup.

For more information around the requirements we have for the availability, see [Data Availability](../data-publication-and-availability/index.md).
:::

Using the data structures defined throughout the [rollup circuits](./../rollup-circuits/index.md) section, we can outline the validating light node structure as follows:

```mermaid
classDiagram
class AvailabilityOracle {
available: Map[Fr => bool]
mut publish(effects: TxEffect[]): Fr
is_available(txs_hash: Fr): bool
}
class Inbox {
consume(): bytes32
}
Expand All @@ -84,9 +80,8 @@ class Verifier {
class StateTransitioner {
archive: Snapshot
process(header: Header, archive: Fr, proof: Proof)
propose(header: Header, archive: Fr, proof: Proof, body: Body)
}
StateTransitioner --> AvailabilityOracle: is_available()
StateTransitioner --> Inbox: consume()
StateTransitioner --> Outbox: insert()
StateTransitioner --> Verifier: verify()
Expand All @@ -110,7 +105,6 @@ class StateTransitioner:
slot_number: uint128

VERIFIER: immutable(IVerifier)
AVAILABILITY_ORACLE: immutable(IAvailabilityOracle)
INBOX: immutable(IInbox)
OUTBOX: immutable(IOutbox)
VERSION: immutable(uint256)
Expand All @@ -126,13 +120,14 @@ class StateTransitioner:
self.blocks.append(BlockLog({archive: bytes32(0), slot_number: 0}))
self.GENESIS_TIME = block.timestamp

def process(
def propose(
self,
header: Header,
archive: Fr,
proof: Proof
proof: Proof,
body: Body
):
assert self.AVAILABILITY_ORACLE.is_available(header.content_commitment.txs_hash)
assert body.compute_commitment() == header.content_commitment
assert self.validate_header(header)
assert VERIFIER.verify(header, archive, proof)
assert self.INBOX.consume() == header.content_commitment.in_hash
Expand Down Expand Up @@ -162,25 +157,6 @@ class StateTransitioner:
return True
```

### Availability Oracle

The state transitioner should be connected to an oracle which addresses the availability condition.

For the case of a rollup, this "oracle" will be deriving the `TxsHash` from calldata and blobs.
For a validium it should be connected to a bridge that it can use to verify that the data is available on the other chain.

For a generic DA that publishes data commitments to Ethereum, the oracle could be a snark proof that opens the data commitment from the bridge and computes the `TxsHash` from it.

By having the availability oracle be independent from state progression we can even do multi-transaction blocks, e.g., use multiple transactions or commitments from other DA layers to construct the `TxsHash` for a large block.

For more information around the requirements we have for the availability oracle, see [Data Availability](../data-publication-and-availability/index.md).

An interesting observation around the availability oracle is that the `OutHash` and `InHash` don't need to be explicitly proven available through it.
The `InHash` is already proven as part of the L1 inbox, as we will see in a second.
And the `OutHash` consists entirely of a subset of the contents of the `TxsHash`, which is already proven available.

<!-- TODO: consider giving this registry an adjective to describe what it's for. We're seeing several registries in the aztec protocol, so need to distinguish them. -->

### Registry

To keep one location where all the core rollup contracts can be found, we have a registry contract.
Expand Down
2 changes: 0 additions & 2 deletions helm-charts/aztec-network/files/config/config-prover-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}'
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')
outbox_address=$(echo "$output" | grep -oP 'L2 -> L1 Outbox Address: \K0x[a-fA-F0-9]{40}')
availability_oracle_address=$(echo "$output" | grep -oP 'Availability Oracle Address: \K0x[a-fA-F0-9]{40}')
fee_juice_address=$(echo "$output" | grep -oP 'Fee Juice Address: \K0x[a-fA-F0-9]{40}')
fee_juice_portal_address=$(echo "$output" | grep -oP 'Fee Juice Portal Address: \K0x[a-fA-F0-9]{40}')

Expand All @@ -26,7 +25,6 @@ export ROLLUP_CONTRACT_ADDRESS=$rollup_address
export REGISTRY_CONTRACT_ADDRESS=$registry_address
export INBOX_CONTRACT_ADDRESS=$inbox_address
export OUTBOX_CONTRACT_ADDRESS=$outbox_address
export AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$availability_oracle_address
export FEE_JUICE_CONTRACT_ADDRESS=$fee_juice_address
export FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$fee_juice_portal_address
EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}'
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')
outbox_address=$(echo "$output" | grep -oP 'L2 -> L1 Outbox Address: \K0x[a-fA-F0-9]{40}')
availability_oracle_address=$(echo "$output" | grep -oP 'Availability Oracle Address: \K0x[a-fA-F0-9]{40}')
fee_juice_address=$(echo "$output" | grep -oP 'Fee Juice Address: \K0x[a-fA-F0-9]{40}')
fee_juice_portal_address=$(echo "$output" | grep -oP 'Fee Juice Portal Address: \K0x[a-fA-F0-9]{40}')

Expand All @@ -37,7 +36,6 @@ export ROLLUP_CONTRACT_ADDRESS=$rollup_address
export REGISTRY_CONTRACT_ADDRESS=$registry_address
export INBOX_CONTRACT_ADDRESS=$inbox_address
export OUTBOX_CONTRACT_ADDRESS=$outbox_address
export AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$availability_oracle_address
export FEE_JUICE_CONTRACT_ADDRESS=$fee_juice_address
export FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$fee_juice_portal_address
export VALIDATOR_PRIVATE_KEY=$private_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ data:
registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}')
inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}')
outbox_address=$(echo "$output" | grep -oP 'L2 -> L1 Outbox Address: \K0x[a-fA-F0-9]{40}')
availability_oracle_address=$(echo "$output" | grep -oP 'Availability Oracle Address: \K0x[a-fA-F0-9]{40}')
fee_juice_address=$(echo "$output" | grep -oP 'Fee Juice Address: \K0x[a-fA-F0-9]{40}')
fee_juice_portal_address=$(echo "$output" | grep -oP 'Fee Juice Portal Address: \K0x[a-fA-F0-9]{40}')
Expand All @@ -29,7 +28,6 @@ data:
export REGISTRY_CONTRACT_ADDRESS=$registry_address
export INBOX_CONTRACT_ADDRESS=$inbox_address
export OUTBOX_CONTRACT_ADDRESS=$outbox_address
export AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$availability_oracle_address
export FEE_JUICE_CONTRACT_ADDRESS=$fee_juice_address
export FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$fee_juice_portal_address
EOF
Expand Down
Loading

0 comments on commit 0303f15

Please sign in to comment.