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

fix(lib/babe, lib/runtime/wasmer): fixes for v0.9.8+ runtime #2075

Merged
merged 4 commits into from
Nov 30, 2021
Merged
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
4 changes: 2 additions & 2 deletions dot/rpc/modules/author.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ type decodedKey struct {
type ExtrinsicStatus struct {
IsFuture bool
IsReady bool
Isfinalised bool
Asfinalised common.Hash
IsFinalized bool
AsFinalized common.Hash
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
IsUsurped bool
AsUsurped common.Hash
IsBroadcast bool
Expand Down
3 changes: 2 additions & 1 deletion lib/babe/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ func (b *BlockBuilder) buildBlockExtrinsics(slot Slot, rt runtime.Instance) []*t
func (b *BlockBuilder) buildBlockInherents(slot Slot, rt runtime.Instance) ([][]byte, error) {
// Setup inherents: add timstap0
idata := types.NewInherentsData()
err := idata.SetInt64Inherent(types.Timstap0, uint64(time.Now().Unix()))
timestamp := uint64(time.Now().UnixMilli())
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
err := idata.SetInt64Inherent(types.Timstap0, timestamp)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion lib/runtime/wasmer/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -1906,10 +1906,14 @@ func ext_storage_clear_prefix_version_2(context unsafe.Pointer, prefixSpan, lim
return C.int64_t(ret)
}

if len(limit) == 0 {
// limit is None, set limit to max
limit = []byte{0xff, 0xff, 0xff, 0xff}
}

limitUint := binary.LittleEndian.Uint32(limit)
numRemoved, all := storage.ClearPrefixLimit(prefix, limitUint)
encBytes, err := toKillStorageResultEnum(all, numRemoved)

if err != nil {
logger.Errorf("[ext_storage_clear_prefix_version_2] failed to allocate memory: %s", err)
ret, _ := toWasmMemory(instanceContext, nil)
Expand Down