Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Feb 12, 2024
1 parent d254c54 commit 7187074
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/runtime/wazero/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ func ext_trie_blake2_256_ordered_root_version_1(ctx context.Context, m api.Modul

func ext_trie_blake2_256_ordered_root_version_2(
ctx context.Context, m api.Module, dataSpan uint64, version uint32) uint32 {
fmt.Println("executing: ext_trie_blake2_256_ordered_root_version_2")
rtCtx := ctx.Value(runtimeContextKey).(*runtime.Context)
if rtCtx == nil {
panic("nil runtime context")
Expand Down Expand Up @@ -2301,6 +2302,7 @@ func ext_storage_root_version_1(ctx context.Context, m api.Module) uint64 {
}

func ext_storage_root_version_2(ctx context.Context, m api.Module, version uint32) uint64 { //skipcq: RVV-B0012
fmt.Println("executing: ext_storage_root_version_2")
rtCtx := ctx.Value(runtimeContextKey).(*runtime.Context)
if rtCtx == nil {
panic("nil runtime context")
Expand Down
7 changes: 6 additions & 1 deletion lib/trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ func (t *Trie) Put(keyLE, value []byte) (err error) {
t.handleTrackedDeltas(success, pendingDeltas)
}()

fmt.Printf("inserting a value, trie version: %d\n", t.version)
err = t.insertKeyLE(keyLE, value, pendingDeltas)
if err != nil {
return err
Expand Down Expand Up @@ -1506,5 +1507,9 @@ func intToByteSlice(n int) (slice []byte) {
}

func mustBeHashed(trieVersion TrieLayout, storageValue []byte) bool {
return trieVersion == V1 && len(storageValue) > V1.MaxInlineValue()
mustBe := trieVersion == V1 && len(storageValue) > V1.MaxInlineValue()
if mustBe {
fmt.Printf("must be hashed: %v\n", mustBe)
}
return mustBe
}

0 comments on commit 7187074

Please sign in to comment.