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

keep the original context for GetCommittedState api #383

Merged
merged 8 commits into from
Aug 4, 2021

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jul 30, 2021

Closes: #376

Currently, the unit test don't pass as expected yet, not sure why, investigating.

Description

A contract that can reproduce the difference in gas consumption between ethermint main and geth:

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 */
contract Storage {

    uint256 number;

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) public {
        number = num + 1;
        number = num;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view returns (uint256){
        return number;
    }
}

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)

@codecov
Copy link

codecov bot commented Aug 3, 2021

Codecov Report

Merging #383 (43bb4f9) into main (f7bcc8d) will increase coverage by 0.04%.
The diff coverage is 89.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   50.49%   50.53%   +0.04%     
==========================================
  Files          48       48              
  Lines        4828     4836       +8     
==========================================
+ Hits         2438     2444       +6     
- Misses       2291     2293       +2     
  Partials       99       99              
Impacted Files Coverage Δ
x/evm/keeper/keeper.go 69.88% <77.77%> (+0.42%) ⬆️
x/evm/keeper/grpc_query.go 71.11% <100.00%> (-0.10%) ⬇️
x/evm/keeper/state_transition.go 62.16% <100.00%> (-0.34%) ⬇️
x/evm/keeper/statedb.go 84.72% <100.00%> (+0.07%) ⬆️

Copy link
Contributor

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

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

lgtm

x/evm/keeper/state_transition.go Outdated Show resolved Hide resolved
x/evm/keeper/statedb_test.go Outdated Show resolved Hide resolved
x/evm/keeper/statedb_test.go Show resolved Hide resolved
x/evm/keeper/statedb_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

ACK

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 this pull request may close these issues.

GetCommittedState don't query the committed state
3 participants