Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: need to add rpc method debug_intermediateRoots #715

Closed
adu-web3 opened this issue Nov 2, 2021 · 3 comments · Fixed by #754
Closed

Problem: need to add rpc method debug_intermediateRoots #715

adu-web3 opened this issue Nov 2, 2021 · 3 comments · Fixed by #754
Labels
C:JSON-RPC JSON-RPC client

Comments

@adu-web3
Copy link
Contributor

adu-web3 commented Nov 2, 2021

debug_intermediateRoots is not supported yet.
need to implement debug_intermediateRoots in rpc/ethereum/namespaces/debug/api.go and other related files.

@leejw51crypto
Copy link
Contributor

leejw51crypto commented Nov 10, 2021

for intermediatesRoots, it need to use trie directly
to get temporary worldstate roothash.

func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
	// Finalise all the dirty storage states and write them into the tries
	s.Finalise(deleteEmptyObjects)


........
	// Track the amount of time wasted on hashing the account trie
	if metrics.EnabledExpensive {
		defer func(start time.Time) { s.AccountHashes += time.Since(start) }(time.Now())
	}
	return s.trie.Hash()
}

but current paradigm, we're using rpc client, cannot access merkletrie directly yet.

so

  1. add api handler for debug_intermediateRoots
  2. return empty hash for each tx

@fedekunze
Copy link
Contributor

let's return an empty hash on the RPC for now and create a new issue to implement intermediate roots @Muggle-Du

@fedekunze fedekunze added the C:JSON-RPC JSON-RPC client label Nov 16, 2021
@adu-web3
Copy link
Contributor Author

let's return an empty hash on the RPC for now and create a new issue to implement intermediate roots @Muggle-Du

ok

adu-web3 added a commit to adu-web3/ethermint that referenced this issue Nov 16, 2021
fedekunze added a commit that referenced this issue Nov 16, 2021
* Problem: need to add JSON-RPC endpoint debug_intermediateRoots

Closes #715

* currently return emtpy hash

* add changelog entry

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:JSON-RPC JSON-RPC client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants