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

Problem: tx format conversions not necessary #478

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Apr 24, 2024

Closes: #471

Solution:

  • embed ethtypes.Transaction type inside the protobuf message directly.
$ go test -benchmem -v ./app/... -run "^$" -bench="BenchmarkERC20Transfer/memiavl-stm-16" -count 6
$ benchstat /tmp/before /tmp/after
goos: darwin
goarch: arm64
pkg: github.com/crypto-org-chain/cronos/v2/app
                                │ /tmp/before │            /tmp/after             │
                                │   sec/op    │   sec/op     vs base              │
ERC20Transfer/memiavl-stm-16-16   134.0m ± 2%   127.1m ± 4%  -5.11% (p=0.002 n=6)

                                │ /tmp/before  │             /tmp/after             │
                                │     B/op     │     B/op      vs base              │
ERC20Transfer/memiavl-stm-16-16   538.5Mi ± 0%   487.3Mi ± 0%  -9.51% (p=0.002 n=6)

                                │ /tmp/before │             /tmp/after             │
                                │  allocs/op  │  allocs/op   vs base               │
ERC20Transfer/memiavl-stm-16-16   7.353M ± 0%   6.263M ± 0%  -14.82% (p=0.002 n=6)

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@yihuang yihuang requested a review from mmsqe April 24, 2024 05:28
@yihuang yihuang marked this pull request as draft April 24, 2024 05:28
yihuang added a commit to yihuang/go-ethereum that referenced this pull request Apr 24, 2024
the time field is a roadblock to reuse the Transaction type in an external system,
remove it since we don't use it in ethermint/cronos.

see: crypto-org-chain/ethermint#478
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 68.80000% with 78 lines in your changes are missing coverage. Please review.

Project coverage is 61.71%. Comparing base (40463e8) to head (c323cd4).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #478      +/-   ##
===========================================
- Coverage    62.93%   61.71%   -1.22%     
===========================================
  Files          126      127       +1     
  Lines         9480     9442      -38     
===========================================
- Hits          5966     5827     -139     
- Misses        2974     3077     +103     
+ Partials       540      538       -2     
Files Coverage Δ
app/ante/fees.go 76.81% <100.00%> (+1.13%) ⬆️
app/ante/setup.go 83.60% <100.00%> (+2.35%) ⬆️
indexer/kv_indexer.go 70.17% <100.00%> (+0.53%) ⬆️
rpc/backend/blocks.go 86.46% <100.00%> (-0.11%) ⬇️
rpc/types/utils.go 0.00% <ø> (ø)
x/evm/keeper/config.go 93.75% <100.00%> (ø)
x/evm/keeper/gas.go 86.95% <100.00%> (ø)
x/evm/keeper/hooks.go 100.00% <100.00%> (ø)
x/evm/keeper/keeper.go 85.84% <100.00%> (ø)
x/evm/keeper/state_transition.go 74.46% <100.00%> (+0.78%) ⬆️
... and 13 more

... and 3 files with indirect coverage changes

@yihuang yihuang force-pushed the cleanup-tx branch 2 times, most recently from 98a96cb to 6c734fb Compare April 25, 2024 08:21
@yihuang yihuang marked this pull request as ready for review April 25, 2024 08:21
Copy link
Collaborator

@mmsqe mmsqe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems we might also need fix the data for raw

x/evm/types/msg.go Show resolved Hide resolved
Solution:
- embed ethtypes.Transaction into MsgEthereumTx protobuf message as the core component.

restore ValidateBasic

fix json format

cleanup

fix json

fix json
@yihuang yihuang merged commit aa05efc into crypto-org-chain:develop Apr 29, 2024
37 of 40 checks passed
@yihuang yihuang deleted the cleanup-tx branch April 29, 2024 03:04
mmsqe pushed a commit to mmsqe/go-ethereum that referenced this pull request Sep 24, 2024
the time field is a roadblock to reuse the Transaction type in an external system,
remove it since we don't use it in ethermint/cronos.

see: crypto-org-chain/ethermint#478
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

Successfully merging this pull request may close these issues.

Problem: inefficient transaction format
2 participants