-
Notifications
You must be signed in to change notification settings - Fork 18
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
Miden blockexplorer - next iteration #205
Comments
A few small comments from me:
I think this may already be done. But the "dynamic row" is not there yet.
We'll need to define a strategy for how to reconcile data from the mapping file and the one stored in accounts.
In addition to this, we'll also need to show a couple of attributes for each procedure. Specifically, storage offset and storage size.
There are could be up to 255 storage slot (but usually will be much fewer - e.g., a basic wallet has only 1 storage slot). For key-value maps, we should probably show a table (e.g., with 2 columns) with currently populated key-value pairs.
This is really a "nice-to-have" - I would tackle it only after everything else is done. Also, another nice to have would be to be able to download |
This comment was marked as off-topic.
This comment was marked as off-topic.
I just realized I misunderstood what was needed, so I hid my above comment.
Contrary to note scripts, account code is a library, so it doesn't have a single, well-defined entrypoint, hence we cannot compute a single identifying MAST root for it (afaict). I think what can be done instead to identify standard account contracts is first gather all of its exported procedure's MAST roots (hashes). If this set of roots matches one of the following sets exactly (no more or less elements) then we can show a verified contract symbol and display the name of the contract:
As far as I can tell, the For display purposes, I think some proper names for these contracts would be desirable, e.g. "Basic Wallet" and "Fungible Faucet". The code for this is here.Note: This requires the use std::{self};
use miden_lib::transaction::TransactionKernel;
use walkdir::WalkDir;
fn main() {
let contracts_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/asm/miden/contracts/");
for entry in WalkDir::new(contracts_dir) {
let entry = entry.unwrap();
if entry.file_type().is_dir() {
continue;
}
let contract_bytes = std::fs::read(entry.path()).unwrap();
let contract_name = entry.path().strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap();
let assembler = TransactionKernel::assembler();
let lib = assembler.assemble_library([contract_bytes]).unwrap();
println!("Contract: {}", contract_name.display());
for module_info in lib.module_infos() {
for (_, proc_info) in module_info.procedures() {
println!("{} -> {}", proc_info.digest, proc_info.name);
}
}
println!("");
}
} |
Goal: next iteration of the block explorer
On our explorer (https://explorer.miden.io), we want to have a couple of updates and fixes.
General
Can you open-source the code and provide instructions on how to run it?
Main page (2 changes)
This could include a "dynamic row" in the block/transaction tables to say something "10 new blocks since refresh".
Blocks
Overview tab (2 changes)
Accounts
Assets tab (2 changes)
Code tab (2 changes)
Maybe @PhilippGackstatter can provide a mapping of the current MASM procedures.
Storage - new (1 change)
We want to show the account's storage. There are two ways to store something in the account.
Word
.Upload accounts - new
We want to be able to upload an account to the explorer. Accounts are serialized as
*.mac
files. So when I click on a private account, there needs to be an upload button; I then upload my account, and if the account hash matches, all data should be shown as if the account were a public account.Notes issued - new
We should also add "Notes" tab. This would show all notes sent out from the account (i.e., where note.sender == account_id).
Transactions tab
Instead of "Transactions" tab, it may make sense to show "Updates" tab. This tab could have a table with the following fields:
Created Notes
Note Tags (1 change)
We want to be able to search notes by
TAG
. TheTAG
is in the note metadata. There should be a separate "Note tags" page where we list all tags and then when we click on a specific tag, we can see all notes which have this tag.Consumed notes
Right now, this shows the same data as the "Notes" page. Instead, it should show a table of nullifiers. Specifically, this table would have two columns: "Note nullifier" and "Committed block number."
The text was updated successfully, but these errors were encountered: