Skip to content
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

Show Celestia Blobs on Arbitrum chains #2556

Closed
ulyanas opened this issue Feb 4, 2025 · 2 comments · Fixed by #2562
Closed

Show Celestia Blobs on Arbitrum chains #2556

ulyanas opened this issue Feb 4, 2025 · 2 comments · Fixed by #2562
Assignees
Labels
client feature feature New substantial feature pre-release Tasks in pre-release right now

Comments

@ulyanas
Copy link

ulyanas commented Feb 4, 2025

For Arbitrum Orbit chains that use Celestia DA, Blockscout has to show Celestia Blobs in Batches similar to OP chains.

Ideally on the batch page we need to show:

  1. Celestia blob details: commitment and height under the toggle "Show data availability info"/"Hide data availability info" (like for AnyTrust)
  2. a link to Celenium explorer. The link should be composed as following:
    1. Convert the commitment from hex to base64 and URL-encode it:

      commitment = url_encode(hex_to_base64(commitment)) = "Pr5aQ%2FR%2Fv2nbAD5UO7J%2BSHWSnt4vqaJdCfC9CC1dIPA%3D"
    2. Repeat the process with the namespace (namespace must be configured through an env variable as a hex string, e.g. ca1de12a9905be97beaf for Rari Testnet):

      namespace = url_encode(hex_to_base64(namespace)) = "AAAAAAAAAAAAAAAAAAAAAAAAAMod4SqZBb6Xvq8%3D"
    3. Construct the URL using the namespace as the hash (URL to the Celenium must be configured through an env variable): https://mocha.celenium.io/blob?commitment=Pr5aQ%2FR%2Fv2nbAD5UO7J%2BSHWSnt4vqaJdCfC9CC1dIPA%3D&hash=AAAAAAAAAAAAAAAAAAAAAAAAAMod4SqZBb6Xvq8%3D&height=4520041

The batch page must be available by both URLs:

  • https://blockscout.url/batches/{batch_id}
    • API: https://blockscout.url/api/v2/arbitrum/batches/{batch_id}
  • https://blockscout.url/batches/celestia/{height}/{commitment}
    • API: https://blockscout.url/api/v2/arbitrum/batches/da/celestia/{height}/{commitment}

We have a test deployment via Autoscout:

  • Batch page in Blockscout UI: https://rari-testnet.cloud.blockscout.com/batches/80377
  • Batch information by ID through Blockscout API:
    curl --request GET \
      --url https://rari-testnet.cloud.blockscout.com/api/v2/arbitrum/batches/80377
    
    {
    	"after_acc": "0x5567cc1bc43f75e1952633f6c8aeea9cbd0d0eba3633289fe8a5b674268bc3be",
    	"before_acc": "0x4a71bddc2cf848b2531a99352fc468bf03ccb7af471d6d25b05342f2eaf2f8d0",
    	"commitment_transaction": {
    		"block_number": 121020339,
    		"hash": "0xda4bd0b4a9ea3ae0c7e020ada411aea2e52cde1e5f87116f1c931eb3d6eeeede",
    		"status": "finalized",
    		"timestamp": "2025-02-04T17:49:34.000000Z"
    	},
    	"data_availability": {
    		"batch_data_container": "in_celestia",
    		"height": 4520041,
    		"transaction_commitment": "0x3ebe5a43f47fbf69db003e543bb27e4875929ede2fa9a25d09f0bd082d5d20f0"
    	},
    	"end_block": 740509,
    	"number": 80377,
    	"start_block": 740502,
    	"transactions_count": 23
    }
  • Batch information by Celestia data through Blockscout API:
    curl --request GET \
      --url https://rari-testnet.cloud.blockscout.com/api/v2/arbitrum/batches/da/celestia/4520041/0x3ebe5a43f47fbf69db003e543bb27e4875929ede2fa9a25d09f0bd082d5d20f0
    
    {
    	"after_acc": "0x5567cc1bc43f75e1952633f6c8aeea9cbd0d0eba3633289fe8a5b674268bc3be",
    	"before_acc": "0x4a71bddc2cf848b2531a99352fc468bf03ccb7af471d6d25b05342f2eaf2f8d0",
    	"commitment_transaction": {
    		"block_number": 121020339,
    		"hash": "0xda4bd0b4a9ea3ae0c7e020ada411aea2e52cde1e5f87116f1c931eb3d6eeeede",
    		"status": "finalized",
    		"timestamp": "2025-02-04T17:49:34.000000Z"
    	},
    	"data_availability": {
    		"batch_data_container": "in_celestia",
    		"height": 4520041,
    		"transaction_commitment": "0x3ebe5a43f47fbf69db003e543bb27e4875929ede2fa9a25d09f0bd082d5d20f0"
    	},
    	"end_block": 740509,
    	"number": 80377,
    	"start_block": 740502,
    	"transactions_count": 23
    }

Custom backend: https://hub.docker.com/layers/blockscout/blockscout-arbitrum/6.10.1-alpha.9/images/sha256-ccb3f9b63a1c30e595a175dab85c83fcb1271927b6c524dae21fb1ae7bc7d3c6
(need to ask DevOps team to deploy it properly)

@ulyanas
Copy link
Author

ulyanas commented Feb 5, 2025

Could you please also fix Batch data container value naming?
celestia > Celestia
anytrust > AnyTrust

@ulyanas ulyanas added feature New substantial feature client feature labels Feb 5, 2025
@tom2drum tom2drum self-assigned this Feb 7, 2025
@tom2drum
Copy link
Collaborator

tom2drum commented Feb 7, 2025

New ENV variable value for Rari-testnet
NEXT_PUBLIC_ROLLUP_DA_CELESTIA_NAMESPACE=0x00000000000000000000000000000000000000ca1de12a9905be97beaf

@github-actions github-actions bot added the pre-release Tasks in pre-release right now label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client feature feature New substantial feature pre-release Tasks in pre-release right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants