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

Cosmos gas multiplier params #1546

Closed
wants to merge 262 commits into from
Closed

Cosmos gas multiplier params #1546

wants to merge 262 commits into from

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Apr 16, 2024

Describe your changes and provide context

Testing performed to validate your change

  • Tested on local chain and verified multiplier

codchen and others added 30 commits March 26, 2024 14:16
[EVM] add endpoint to get block transaction count
* [EVM] add get transaction receipt endpoint

* refactor tests
[EVM] add getTransaction endpoints
[EVM] refactor gas logic
* [EVM] add endpoint to return fee history

* bump to 1.21
* Implement get code, storage, balance endpoints

* revert logging change

* also using bank keeper to check for balances

* appease linter
* simulate api

* add tests

* linter
* [EVM] add subscription utility

* finished new filter

* finished tests for new filter

* finished uninstall filter

* query tendermint for events

* in progress

* got first couple of tests done

* finished tests for get logs

* get filter logs and get filter changes

* refactor

* get filter logs accepts multiple addresses

* use multiple addresses and use cursor map

* remove bad test

* remove prints and todos

* minor fix

* fix lint errors and failing test

* poc to pass filtercriteria into JSON RPC

* made topics 2d array and adjusted regex

* GetLogs tests work

* Finished other functions

* remove unncessary inputs from NewFilterAPI

* add expiration/timeouts for filters

* removed error from UninstallFilter

* minor fix

* appease linter

---------

Co-authored-by: codchen <[email protected]>
* [EVM] return gas info in message handler correctly

* add comments
* integration

* fix tests
* [EVM] add transaction type to associate account

* tests
* [EVM] add transaction type to associate account

* [EVM] convert balance decimal points

* [EVM] add ACL dependencies for EVM transactions

* Revert "[EVM] add ACL dependencies for EVM transactions"

This reverts commit 5376a87.

* address comments
* added new block filter

* wip

* finished tests

* minor fix

* fix lint

* minor fix

* fix test
* [EVM] surface VM error

* rebase

* add endpoints
* [EVM] several bug fixes

* tests

* add CheckTx nonce handling
* [EVM] several bug fixes

* [EVM] add wasmd precompiles

* [EVM] wasmd precompile

* query method

* add tests
* added new block filter

* wip

* finished tests

* minor fix

* fix lint

* minor fix

* added basic endpoint and created sendWSRequestAndListen

* no goroutine in test

* removed params

* able to call my subscribe endpoint

* subscribe2 works but not subscribe

* got back msg from ws but hard to decode

* subscription api uses sub manager, manager thread safe

* able to send many messages through ws conn

* newHeads tests work

* newHeads works

* subscribe works need to cleanup

* test with multiple addrs, remove prints

* cleanup

* cleanup

* fix test

* fix linter

* fix linter 2

* fix linter 3

* address comments

* add unsubscribe in mock client

* fix linter 4

* fix extra subscribe param

* fix test
* [EVM] handle nonce gap in CheckTx

* disable compatibility check
* chore: forge init

* forge install: forge-std

v1.7.2

* moved foundry.toml and github workflows to top level

* forge install: openzeppelin-contracts

v5.0.0

* added impl + tests for native sei tokens as erc20s

* fix

* fix

* remove Counter boilerplate code

* minor fix
…1159)

* able to txn deployment to go through

* cleanup

* remove prints

* remove prints

* fix linter

* minor fix
stevenlanders and others added 3 commits April 15, 2024 14:46
* Add wasmd execute batch to precompile

* Add some wasm hardhat it stuff

* update script

* Update deployment script

* fix tests

* update to add instantiate
@Kbhat1 Kbhat1 requested review from codchen and philipsu522 April 16, 2024 21:02
@@ -10,6 +10,7 @@ type GasMeterSetterDecorator struct {
}

func (d GasMeterSetterDecorator) AnteDeps(txDeps []sdkacltypes.AccessOperation, tx sdk.Tx, txIndex int, next sdk.AnteDepGenerator) (newTxDeps []sdkacltypes.AccessOperation, err error) {
// TODO: Remove below since no more wasm dependency discount
Copy link
Contributor Author

@Kbhat1 Kbhat1 Apr 16, 2024

Choose a reason for hiding this comment

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

Verifying in local chain / tests and then will remove this since we have no more wasm dependency discount

@@ -344,7 +344,7 @@ require (
)

replace (
github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.1.0
github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.0.10-0.20240415230844-461d7d3b8890 // TODO: Update once sei-wasmd PR merged
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be updated once sei-wasmd new tag is published

go.mod Outdated
@@ -354,7 +354,7 @@ replace (
github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.35
// Latest goleveldb is broken, we have to stick to this version
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.2.41-seiv2
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.2.41-seiv2.0.20240416201336-c52dc88f0dd3 // TODO: Update once sei-tendermint PR merged
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be updated once sei-tendermint new tag is published

app/app.go Outdated
MaxGas: endBlockResp.ConsensusParamUpdates.Block.MaxGas,
MaxBytes: endBlockResp.ConsensusParamUpdates.Block.MaxBytes,
MaxGas: endBlockResp.ConsensusParamUpdates.Block.MaxGas,
CosmosGasMultiplierNumerator: endBlockResp.ConsensusParamUpdates.Block.CosmosGasMultiplierNumerator,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need migration for new consensus params?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codchen we removed this in favor of just adding in a new param in cosmos layer: sei-protocol/sei-cosmos#487

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

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

Project coverage is 60.99%. Comparing base (7470aae) to head (4afbda8).
Report is 10 commits behind head on seiv2.

❗ Current head 4afbda8 differs from pull request most recent head 0a82d4d. Consider uploading reports for the commit 0a82d4d to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            seiv2    #1546      +/-   ##
==========================================
+ Coverage   60.73%   60.99%   +0.25%     
==========================================
  Files         366      366              
  Lines       26047    26048       +1     
==========================================
+ Hits        15819    15887      +68     
+ Misses       9228     9152      -76     
- Partials     1000     1009       +9     
Files Coverage Δ
app/antedecorators/gas.go 62.50% <75.00%> (-11.97%) ⬇️
app/ante.go 54.11% <40.00%> (-1.98%) ⬇️

... and 18 files with indirect coverage changes

go.mod Outdated
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.80-seiv2
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.81-seiv2.0.20240417141123-88fd96d3e0b4 // TODO: Update once sei-cosmos PR merged
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be updated once sei-cosmos new tag is published

return func(simulate bool, ctx sdk.Context, gasLimit uint64, tx sdk.Tx) sdk.Context {
if simulate || ctx.BlockHeight() == 0 {
if ctx.BlockHeight() == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why don't we have simulate specific gas meter behavior? - we should still have some infinite gas meter that then applies the scaling factor to be able to accurate simulate, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we should be careful here given that the cachekv is no longer emitting events, and this is a difference in how the store accesses happen

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for the purposes of this change, just to be safe, we should reintroduce the event emissions in cachekv (despite performance consequences) to ensure the parallel dag resource accesses remain accurate. This will need to be updated in sei-cosmos and then reflected here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@udpatil for first comment, new infinite multiplier gas meter has been added for simulation

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

Successfully merging this pull request may close these issues.