Skip to content

Foundational Store Substreams integration#661

Merged
billettc merged 38 commits intodevelopfrom
feature/establish-foundationnal-store-intrinsics
Sep 16, 2025
Merged

Foundational Store Substreams integration#661
billettc merged 38 commits intodevelopfrom
feature/establish-foundationnal-store-intrinsics

Conversation

@UlysseCorbeil
Copy link
Contributor

No description provided.

@UlysseCorbeil UlysseCorbeil requested review from billettc and maoueh July 24, 2025 19:40
@UlysseCorbeil UlysseCorbeil force-pushed the feature/establish-foundationnal-store-intrinsics branch from 3550837 to b1f02fb Compare July 24, 2025 19:54
@UlysseCorbeil
Copy link
Contributor Author

Sorry about the commit history, I had to rebase so github didnt show hundreds of "changed" files coming from a merge

@UlysseCorbeil UlysseCorbeil self-assigned this Aug 15, 2025
Comment on lines 458 to 464
if s, ok := r.(string); ok {
e := fmt.Errorf("wasmtime error: %s", s)
p.execoutStorage.ConfigMap[executorName].WriteDeterministicError(ctx, execOutput.Clock().Number, e)
out.err = e
return
}
panic(fmt.Errorf("unknown error: %s", r))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to understand better this change. Why it would be wasmtime here actually? We have more than one vm processor.

Also, when recovering from panic, just checking for r.(string) is usually not enough, you need to check for error too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a silent panic here, it just failed without crashing iirc so I added an error we can see and if it ever reaches that panic, means something went very wrong

Comment on lines 430 to 452
// Deserialize
var req pbstore.GetAllRequest
if err := proto.Unmarshal(reqData, &req); err != nil {
call.ReturnError(fmt.Errorf("failed to unmarshal GetAllRequest: %w", err))
stack[0] = 0
return
}

resp, err := call.DoFoundationalStoreGetAll(storeIndex, req.BlockNumber, req.Keys)
if err != nil {
call.ReturnError(fmt.Errorf("foundational store error: %w", err))
stack[0] = 0
return
}

// Serialize response
respData, err := proto.Marshal(resp)
if err != nil {
call.ReturnError(fmt.Errorf("failed to marshal GetAllResponse: %w", err))
stack[0] = 0
return
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should create an helper for those as we will also need in JavaScript!

@billettc billettc merged commit 0d23150 into develop Sep 16, 2025
7 checks passed
@billettc billettc deleted the feature/establish-foundationnal-store-intrinsics branch September 16, 2025 14:25
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.

3 participants

Comments