Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
72d0478
feat: aggregated-mode structure + silly sp1 program
MarcosNicolau Mar 28, 2025
7a95c59
feat: interfaces + basic service to run sp1
MarcosNicolau Mar 28, 2025
0a46e9c
feat: sp1 aggregation program
MarcosNicolau Mar 28, 2025
4aa0e46
refactor: rename libs and functions
MarcosNicolau Mar 29, 2025
a0aa4af
feat: prove feature to not run prover locally
MarcosNicolau Mar 29, 2025
7065367
feat: proof aggregation service contract
MarcosNicolau Mar 30, 2025
6f2b090
feat: proof aggregation service deploy scripts
MarcosNicolau Mar 30, 2025
38eea41
chore: update anvil state json
MarcosNicolau Mar 30, 2025
993333d
refactor: use mock client for mock proves
MarcosNicolau Mar 30, 2025
69db30c
feat: verify proofs
MarcosNicolau Mar 31, 2025
943b83d
refactor: folder structure
MarcosNicolau Mar 31, 2025
051c882
refactor: move files around more
MarcosNicolau Mar 31, 2025
6ffb456
feat: proof aggregator backend
MarcosNicolau Mar 31, 2025
c674b3b
feat: merkle tree hash with keccak
MarcosNicolau Mar 31, 2025
bb7f7d2
fix: write proofs to sp1 stdin
MarcosNicolau Mar 31, 2025
554abb1
feat: verify supported proofs
MarcosNicolau Mar 31, 2025
4fa59f4
feat: sign transaction + merkle root computation
MarcosNicolau Mar 31, 2025
8885b02
feat: backend initialization
MarcosNicolau Mar 31, 2025
bcab0d1
feat: load local proofs and add to proof aggregator
MarcosNicolau Mar 31, 2025
4645f14
fix: skip when no proofs in queue
MarcosNicolau Mar 31, 2025
7ff2d4c
feat: set proof as missed on error
MarcosNicolau Mar 31, 2025
0217c99
docs: aggregation mode readme
MarcosNicolau Mar 31, 2025
7d4e14b
feat: read config from yaml file
MarcosNicolau Mar 31, 2025
ff12d58
chore: add config files + make commands
MarcosNicolau Mar 31, 2025
99a6a37
feat: s3 service
MarcosNicolau Mar 31, 2025
f9a8acc
refactor: move queue to its own struct
MarcosNicolau Mar 31, 2025
f7ed7b9
feat: proofs fetcher
MarcosNicolau Mar 31, 2025
cef6e1a
feat: main method initializer
MarcosNicolau Mar 31, 2025
6fc017d
chore: deps
MarcosNicolau Mar 31, 2025
b5c7aa3
feat: fetch logs instead of listening for events via ws
MarcosNicolau Apr 1, 2025
86a2815
refactor: remove vk from sp1 proof
MarcosNicolau Apr 1, 2025
1ab8c7e
chore: add more tracing logs
MarcosNicolau Apr 1, 2025
1be8530
feat: remove queue and returns proofs from fetcher
MarcosNicolau Apr 1, 2025
93fcccd
chore: update aligned service manager abi
MarcosNicolau Apr 1, 2025
1935850
feat: aggregated proof getter for ProofAggregationService
MarcosNicolau Apr 1, 2025
cd20c34
docs: update readme instructions
MarcosNicolau Apr 1, 2025
428ac5d
chore: update proof aggregator config
MarcosNicolau Apr 1, 2025
407808b
feat: get block number based on provided config param
MarcosNicolau Apr 1, 2025
9f94d11
feat: remove looping and run service only once
MarcosNicolau Apr 1, 2025
db5a2b0
docs: update readme instructions
MarcosNicolau Apr 1, 2025
2a4791d
feat: send blob transaction
MarcosNicolau Apr 1, 2025
18be091
fix: start_proof_aggregator_local_with_proving command
MarcosNicolau Apr 1, 2025
34a0c55
Fix readme and makefile
MauroToscano Apr 3, 2025
7efb80e
Merge branch 'feat/aggregation-mode' of github.com:yetanotherco/align…
MauroToscano Apr 3, 2025
28757e0
feat: attach blob to contract transaction instead of being separate
MarcosNicolau Apr 3, 2025
8ba0339
feat: take blob versioned hash instead of blob tx in verify contract
MarcosNicolau Apr 3, 2025
3406e43
feat(contracts): merge events into a single one with a new status field
MarcosNicolau Apr 3, 2025
1b22fd7
feat: aligned proof aggregation model and contract interface
MarcosNicolau Apr 3, 2025
36a9a93
feat: [wip] periodically fetch from ProofAggregatorService events
MarcosNicolau Apr 3, 2025
7f500c6
Merge branch 'feat/aggregation-mode' into feat/aggregation-mode-explorer
MarcosNicolau Apr 3, 2025
2a11aa0
feat: fetch logs from contract
MarcosNicolau Apr 3, 2025
0f07b05
Aggregation mode simplification (#1845)
MauroToscano Apr 3, 2025
e3883d0
Merge remote-tracking branch 'origin/feat/aggregation-mode' into feat…
MarcosNicolau Apr 3, 2025
2e11a4b
feat: beacon client to fetch blob data
MarcosNicolau Apr 4, 2025
8dc3273
fix: compilation warnings
MarcosNicolau Apr 4, 2025
22a493f
chore: .env variables
MarcosNicolau Apr 4, 2025
95337bf
feat: foreign key for agg mode proofs
MarcosNicolau Apr 7, 2025
39e4018
feat: aggregated proofs migration
MarcosNicolau Apr 7, 2025
ca56e00
feat: eth client to get block by number
MarcosNicolau Apr 7, 2025
0e71dd5
feat: blob decoding + parse events binaries
MarcosNicolau Apr 7, 2025
d5741ed
feat: periodic fetch decoded blob data
MarcosNicolau Apr 7, 2025
f95139f
refactor: more idiomatic elixir and made panics explicit
MarcosNicolau Apr 7, 2025
6e0c26b
fix: ecto schema association
MarcosNicolau Apr 7, 2025
dd7fa37
feat: aggregated proof route + fetch data
MarcosNicolau Apr 7, 2025
7ad8641
chore: better tracing for agg periodic tasks
MarcosNicolau Apr 7, 2025
6831ab4
Merge remote-tracking branch 'origin/staging' into feat/aggregation-m…
MarcosNicolau Apr 7, 2025
7db5f31
fix merge
MarcosNicolau Apr 7, 2025
2712e9e
fix readme in merge
MarcosNicolau Apr 7, 2025
9760145
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 7, 2025
57f35f9
feat: aggregated proof view
MarcosNicolau Apr 7, 2025
7d2d9fb
chore: rename agg_proofs views dir
MarcosNicolau Apr 7, 2025
e8a2eff
feat: aggregated proofs table view
MarcosNicolau Apr 8, 2025
54281dd
refactor: get block header by hash
MarcosNicolau Apr 8, 2025
7736b8d
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 8, 2025
d319392
feat: nav selector for operators and restakes
MarcosNicolau Apr 8, 2025
9cb29e7
feat: agg proofs statistic to home page
MarcosNicolau Apr 8, 2025
dab2b61
feat: improve responsiveness in navbar
MarcosNicolau Apr 8, 2025
1fbdb11
feat: remove loading bar in agg proofs
MarcosNicolau Apr 8, 2025
97019e9
Merge branch 'staging' into feat/aggregation-mode-explorer
MarcosNicolau Apr 8, 2025
cb06d2f
feat: update models to new contract version
MarcosNicolau Apr 8, 2025
c4f2633
feat: block_timestamp field for agg proof model
MarcosNicolau Apr 8, 2025
2ef2201
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 8, 2025
98f8597
feat: update views to new models + parse time ago
MarcosNicolau Apr 8, 2025
2b718f2
feat: blob versioned hash to agg proofs table
MarcosNicolau Apr 8, 2025
c5a45ac
feat: proof aggregation service address in home
MarcosNicolau Apr 8, 2025
4d131d3
fix: use blobscan instead of etherscan for blobs
MarcosNicolau Apr 8, 2025
68c2fd0
fix: order in contracts component
MarcosNicolau Apr 8, 2025
48be71c
feat: agg_proofs relation by uuid instead of merkle root
MarcosNicolau Apr 9, 2025
d0a6015
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 9, 2025
08c26b5
refactor: indexing by proof id instead of merkle_root
MarcosNicolau Apr 9, 2025
981828d
refactor: juli's comments
MarcosNicolau Apr 9, 2025
0b55d41
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 9, 2025
609d744
fix: edge case of repeated proofs for different proofs ids
MarcosNicolau Apr 9, 2025
1751ae9
Merge branch 'feat/aggregation-mode-explorer' into feat/aggregation-m…
MarcosNicolau Apr 9, 2025
ddc14b6
style: remove nav dropdown arrows
MarcosNicolau Apr 10, 2025
3d66f25
chore: fetch aggregated proofs every 1 minute
JuArce Apr 10, 2025
185ec07
Merge branch 'refs/heads/feat/aggregation-mode-explorer' into feat/ag…
JuArce Apr 10, 2025
836558f
Merge branch 'staging' into feat/aggregation-mode-explorer-views
MarcosNicolau Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions explorer/lib/explorer/models/aggregated_proofs.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule AggregatedProofs do
require Logger
use Ecto.Schema
import Ecto.Query
import Ecto.Changeset

@primary_key {:id, :binary_id, autogenerate: true}
Expand Down Expand Up @@ -59,4 +60,30 @@ defmodule AggregatedProofs do
|> Explorer.Repo.update()
end
end

def get_aggregated_proof_by_id(id) do
Explorer.Repo.get_by(AggregatedProofs, id: id)
end

def get_paginated_proofs(%{page: page, page_size: size}) do
query =
from(proof in AggregatedProofs,
order_by: [desc: proof.block_number],
limit: ^size,
offset: ^((page - 1) * size),
select: proof
)

Explorer.Repo.all(query)
end

def get_last_page(page_size) do
total_proofs = Explorer.Repo.aggregate(AggregatedProofs, :count, :id)
last_page = div(total_proofs, page_size)
if rem(total_proofs, page_size) > 0, do: last_page + 1, else: last_page
end

def get_number_of_agg_proofs() do
Explorer.Repo.aggregate(AggregatedProofs, :count, :id)
end
end
11 changes: 11 additions & 0 deletions explorer/lib/explorer/models/aggregation_mode_proof.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule AggregationModeProof do
require Logger
use Ecto.Schema
import Ecto.Changeset
import Ecto.Query

# Different from proofs.ex (we could use the same but the hashes are constructed different)
@primary_key {:id, :id, autogenerate: true}
Expand Down Expand Up @@ -47,4 +48,14 @@ defmodule AggregationModeProof do
|> Explorer.Repo.update()
end
end

def get_all_proof_hashes(id) do
query =
from(proof in AggregationModeProof,
where: proof.agg_proof_id == ^id,
select: proof.proof_hash
)

Explorer.Repo.all(query)
end
end
50 changes: 50 additions & 0 deletions explorer/lib/explorer_web/components/agg_proofs_table.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
defmodule ExplorerWeb.AggProofsTable do
use Phoenix.Component
use ExplorerWeb, :live_component

attr(:agg_proofs, :list, required: true)

def agg_proofs_table(assigns) do
~H"""
<.table id="agg_proofs" rows={@proofs}>
<:col :let={proof} label="Merkle root" class="text-left">
<.link navigate={~p"/aggregated_proofs/#{proof.id}"}>
<span class="inline-flex gap-x-3 items-center group-hover:text-foreground/80">
<%= Helpers.shorten_hash(proof.merkle_root, 6) %>
<.right_arrow />
<.tooltip>
<%= proof.merkle_root %>
</.tooltip>
</span>
</.link>
</:col>
<:col :let={proof} label="Age">
<span class="md:px-0" title={proof.age}>
<%= proof.age %>
</span>
</:col>
<:col :let={proof} label="Block Number">
<%= proof.block_number |> Helpers.format_number() %>
</:col>

<:col :let={proof} label="Blob versioned hash" class="text-left">
<.a href={
"#{Helpers.get_blobscan_url()}/blob/#{proof.blob_versioned_hash}"}
class="inline-flex gap-x-3 items-center group-hover:text-foreground/80 no-underline font-normal"
>
<span class="inline-flex gap-x-3 items-center group-hover:text-foreground/80">
<%= Helpers.shorten_hash(proof.blob_versioned_hash, 6) %>
<.tooltip>
<%= proof.blob_versioned_hash %>
</.tooltip>
</span>
</.a>
</:col>

<:col :let={proof} label="Number of proofs">
<%= proof.number_of_proofs |> Helpers.format_number() %>
</:col>
</.table>
"""
end
end
4 changes: 4 additions & 0 deletions explorer/lib/explorer_web/components/contracts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ defmodule ContractsComponent do
{:ok,
assign(socket,
contracts: [
%{
contract_name: "AlignedProofAggregationService",
address: addresses["alignedProofAggregationService"]
},
%{
contract_name: "AlignedServiceManager",
address: addresses["alignedLayerServiceManager"]
Expand Down
33 changes: 33 additions & 0 deletions explorer/lib/explorer_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,39 @@ defmodule ExplorerWeb.CoreComponents do
"""
end

@doc """
Renders a dynamic badge component for the batcher.
"""
attr(:class, :string, default: nil)
attr(:status, :integer)
slot(:inner_block, default: nil)

def dynamic_badge_for_agg_proof(assigns) do
~H"""
<.badge
variant={
case @status do
0 -> "accent"
1 -> "destructive"
2 -> "foreground"
end
}
class={
classes([
@class
])
}
>
<%= case @status do
0 -> "Verified"
1 -> "Failed"
2 -> "Missed"
end %>
<%= render_slot(@inner_block) %>
</.badge>
"""
end

@doc """
Renders a selector dropdown on hover component with buttons that trigger actions on click.

Expand Down
1 change: 1 addition & 0 deletions explorer/lib/explorer_web/components/footer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule FooterComponent do
{"General",
[
{"Batches", "/batches"},
{"Aggregation", "/aggregated_proofs"},
{"Operators", "/operators"},
{"Restake", "/restaked"}
]},
Expand Down
Loading