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

feat: add Walrus devnet Move code + an example of building against it #94

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions contracts/blob_store/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 2
manifest_digest = "537E35587055E526E85CD04C400536AFFEC5CC0BE833EB4B5FAC245850C34C96"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

[[move.package]]
name = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.29.2", subdir = "crates/sui-framework/packages/move-stdlib" }

[[move.package]]
name = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.29.2", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.29.2"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x8bf57168d5acb0e83efa49905a326d0d624ff147955106d94fb09b6abdaa7bbc"
latest-published-id = "0x8bf57168d5acb0e83efa49905a326d0d624ff147955106d94fb09b6abdaa7bbc"
published-version = "1"
10 changes: 10 additions & 0 deletions contracts/blob_store/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "blob_store"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.29.2" }

[addresses]
blob_store = "0x0"
sui = "0x2"
5 changes: 5 additions & 0 deletions contracts/blob_store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# blob_store

This is the Move source code for the Walrus devnet instance. We provide this so developers can experiment with building Walrus apps that require Move extensions. This code is published on Sui testnet at package ID `0x8bf57168d5acb0e83efa49905a326d0d624ff147955106d94fb09b6abdaa7bbc`.

Check failure on line 3 in contracts/blob_store/README.md

View workflow job for this annotation

GitHub Actions / Lint all markdown files

Line length

contracts/blob_store/README.md:3:101 MD013/line-length Line length [Expected: 100; Actual: 283] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md

A word of caution: Walrus testnet will use new Move packages with struct layouts and function signatures that may not be compatible with this package. Move code that builds against this package will need to rewritten.

Check failure on line 5 in contracts/blob_store/README.md

View workflow job for this annotation

GitHub Actions / Lint all markdown files

Line length

contracts/blob_store/README.md:5:101 MD013/line-length Line length [Expected: 100; Actual: 217] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md
51 changes: 51 additions & 0 deletions contracts/blob_store/docs/msg_formats.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0


We document here off-chain message formats.

Signatures
----------

All certified or signed messages SHOULD be signed with the scheme:
BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_

Public keys are 48 byte vector<u8>.
Signatures are 96 byte vector<u8>.

Signed Message Header
---------------------

All messages MUST start with a header of 3 + 8 bytes:
- (Intent_type, Intent_version, Intent_app_id) : (u8, u8, u8)
- epoch: u64
- body: remaining vec<u8>, no length prefix

The intent types are enumerated below, the version is as of now 0,
and the app id for storage is 3. Th epoch is the storage epoch the
signing storage node is in when signing the message.

Intent types (add here):

const SYNC_DONE_MSG_TYPE: u8 = 0;
const BLOB_CERT_MSG_TYPE: u8 = 1;
const INVALID_BLOB_ID_MSG_TYPE : u8 = 2;

SYNC_DONE message
-----------------

The body is empty, and the epoch for which sync is done is the epoch in the header.


BLOB_CERT message
-----------------

The body is the blob_id : u256 (32 bytes) of a blob. The storage node certified that all
shards that were assigned to it for the message epoch have been received, checked and
persisted to store.

INVALID_BLOB_ID
---------------

The body is the blob_id : u256 (32 bytes) of a blob. The storage node certified that
it has verified an inconsistency proof and the blob id is invalid.
Loading
Loading