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

ethereum/rpc/backend: (*EVMBackend).BlockBloom should create a global []byte slice for evmtypes.AttributeKeyEthereumBloom to reduce string->[]byte conversions #573

Closed
odeke-em opened this issue Sep 18, 2021 · 0 comments · Fixed by #595

Comments

@odeke-em
Copy link
Contributor

Noticed while auditing code and hunting for ways to improve transaction throughput, instead of incurring this continual expense in
https://github.com/tharsis/ethermint/blob/b8ae5984c54f79d76cfc95518f77b4226a05b940/ethereum/rpc/backend/backend.go#L202

you could just create a global like this

var bAttributeKeyEthereumBloom = []byte(evmtypes.AttributeKeyEthereumBloom)

and then later on

if bytes.Equal(attr.Key, bAttributeKeyEthereumBloom) {
     return ethtypes.BytesToBloom(attr.Value), nil
}

Only problem is that setting up a backend is so much work so no benchmarks, otherwise you can definitely see the improvement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant