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

Need improvements of get blocks/headers RPC APIs #146

Closed
trinhdn97 opened this issue Apr 2, 2021 · 1 comment
Closed

Need improvements of get blocks/headers RPC APIs #146

trinhdn97 opened this issue Apr 2, 2021 · 1 comment
Assignees

Comments

@trinhdn97
Copy link
Contributor

  • The format of data field in event logs is not consistent between tx_getTransactionReceipt and other filter APIs. The log data returned by tx_getTransactionReceipt API is prefix with 0x while other filter APIs don't return the logs data with any prefix.
  • The "latest" header/block/state should not be the CurrentBlock which is processing in consensus manager. For example, the HeaderByNumber is curently implemented as below
func (k *KardiaService) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) *types.Header {
	// Return the latest block if rpc.LatestBlockNumber has been passed in
	if number == rpc.LatestBlockNumber {
		return k.blockchain.CurrentBlock().Header()
	}
	return k.blockchain.GetHeaderByHeight(number.Uint64())
}

The "latest" header should be the header before k.blockchain.CurrentBlock().Header(). That CurrentBlock in KardiaChain network is equal to "pending" block in Ethereum network, which is processing by miners. The same for "latest" block and state.

  • The block hash field of get blocks/headers by hash RPC APIs should allow "earliest", "pending" and "latest" keyword for convinient.
@trinhdn97 trinhdn97 self-assigned this Apr 2, 2021
@trinhdn97
Copy link
Contributor Author

Resolved in #143

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

No branches or pull requests

1 participant