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

Chainspec with Metadata #29

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Chainspec with Metadata #29

merged 1 commit into from
Jan 13, 2025

Conversation

mkchungs
Copy link
Collaborator

@mkchungs mkchungs commented Jan 13, 2025

Following the suggestions from #24, Chanspec has now been enhanced with StructType & Metadata:

type KeyVal struct {
	Key        []byte `json:"k"`
	Value      []byte `json:"v"`
	StructType string `json:"struct_type,omitempty"`
	Metadata   string `json:"meta,omitempty"`
}

Example:

...
		[
            "0x01fe00ff00ff00ff930bed80bb11dd6dfd43b1655fd441595bd019b66960192f",
            "0x00000000000000000020006200000000005428110000002810000000281c000000284133073200140a0400fffe00000000330b08330732009511f87b1014080000fffe000000008087808804140a00e0fdfe000000003309640a0b821095110832003307320021842a80540aa004904a05",
            "account_preimage",
            "s=1|h=0x74930bed80bb11dd6dfd43b1655fd441595bd019b66960192f9964f61eceee84|plen=113"
        ]
...

        [
            "0xff01000000000000000000000000000000000000000000000000000000000000",
            "0x74930bed80bb11dd6dfd43b1655fd441595bd019b66960192f9964f61eceee84a08601000000000064000000000000006400000000000000c20000000000000002000000",
            "service_account",
            "s=1|b=100000 g=100 m=100 l=194 i=2|clen=32"
        ]

This shall provide all information needed for decoding of the structs. Noted that:
(1) key is 32 bytes (not 31 bytes).
(2) If (1) is true, then running state transition does not require any knowledges of non c1-c15 keys {a_s, a_p, a_l} -- as long as other clients can start with same state root and list of [{k,v}]

@mkchungs mkchungs changed the title WIth metadata Chainspec with Metadata Jan 13, 2025
@mkchungs mkchungs merged commit 91cdccd into main Jan 13, 2025
@mkchungs mkchungs deleted the chainspec_with_metadata branch January 13, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant