feat: fee market module (#491)

* feat: fee market module

* update proto

* queriers: CLI + gRPC

* gov params

* genesis

* enable height

* fixes

* fix app
This commit is contained in:
Federico Kunze Küllmer 2021-08-26 06:08:11 -04:00 committed by GitHub
parent 4b11ac66c4
commit f469db94ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 3544 additions and 647 deletions

View File

@ -102,6 +102,9 @@ import (
evmrest "github.com/tharsis/ethermint/x/evm/client/rest" evmrest "github.com/tharsis/ethermint/x/evm/client/rest"
evmkeeper "github.com/tharsis/ethermint/x/evm/keeper" evmkeeper "github.com/tharsis/ethermint/x/evm/keeper"
evmtypes "github.com/tharsis/ethermint/x/evm/types" evmtypes "github.com/tharsis/ethermint/x/evm/types"
"github.com/tharsis/ethermint/x/feemarket"
feemarketkeeper "github.com/tharsis/ethermint/x/feemarket/keeper"
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
) )
func init() { func init() {
@ -148,7 +151,9 @@ var (
evidence.AppModuleBasic{}, evidence.AppModuleBasic{},
transfer.AppModuleBasic{}, transfer.AppModuleBasic{},
vesting.AppModuleBasic{}, vesting.AppModuleBasic{},
// Ethermint modules
evm.AppModuleBasic{}, evm.AppModuleBasic{},
feemarket.AppModuleBasic{},
) )
// module account permissions // module account permissions
@ -215,6 +220,7 @@ type EthermintApp struct {
// Ethermint keepers // Ethermint keepers
EvmKeeper *evmkeeper.Keeper EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
// the module manager // the module manager
mm *module.Manager mm *module.Manager
@ -266,7 +272,7 @@ func NewEthermintApp(
// ibc keys // ibc keys
ibchost.StoreKey, ibctransfertypes.StoreKey, ibchost.StoreKey, ibctransfertypes.StoreKey,
// ethermint keys // ethermint keys
evmtypes.StoreKey, evmtypes.StoreKey, feemarkettypes.StoreKey,
) )
// Add the EVM transient store key // Add the EVM transient store key
@ -343,6 +349,10 @@ func NewEthermintApp(
tracer, bApp.Trace(), // debug EVM based on Baseapp options tracer, bApp.Trace(), // debug EVM based on Baseapp options
) )
app.FeeMarketKeeper = feemarketkeeper.NewKeeper(
appCodec, keys[feemarkettypes.StoreKey], app.GetSubspace(feemarkettypes.ModuleName),
)
// Create IBC Keeper // Create IBC Keeper
app.IBCKeeper = ibckeeper.NewKeeper( app.IBCKeeper = ibckeeper.NewKeeper(
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
@ -422,6 +432,7 @@ func NewEthermintApp(
transferModule, transferModule,
// Ethermint app modules // Ethermint app modules
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper), evm.NewAppModule(app.EvmKeeper, app.AccountKeeper),
feemarket.NewAppModule(app.FeeMarketKeeper),
) )
// During begin block slashing happens after distr.BeginBlocker so that // During begin block slashing happens after distr.BeginBlocker so that
@ -437,9 +448,11 @@ func NewEthermintApp(
minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName,
) )
// NOTE: fee market module must go last in order to retrieve the block gas used.
app.mm.SetOrderEndBlockers( app.mm.SetOrderEndBlockers(
crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName,
evmtypes.ModuleName, evmtypes.ModuleName, feemarkettypes.ModuleName,
) )
// NOTE: The genutils module must occur after staking so that pools are // NOTE: The genutils module must occur after staking so that pools are
@ -454,7 +467,7 @@ func NewEthermintApp(
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName,
authz.ModuleName, feegrant.ModuleName, authz.ModuleName, feegrant.ModuleName,
// Ethermint modules // Ethermint modules
evmtypes.ModuleName, evmtypes.ModuleName, feemarkettypes.ModuleName,
// NOTE: crisis module must go at the end to check for invariants on each module // NOTE: crisis module must go at the end to check for invariants on each module
crisistypes.ModuleName, crisistypes.ModuleName,
@ -696,5 +709,6 @@ func initParamsKeeper(
paramsKeeper.Subspace(ibchost.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName)
// ethermint subspaces // ethermint subspaces
paramsKeeper.Subspace(evmtypes.ModuleName) paramsKeeper.Subspace(evmtypes.ModuleName)
paramsKeeper.Subspace(feemarkettypes.ModuleName)
return paramsKeeper return paramsKeeper
} }

File diff suppressed because one or more lines are too long

View File

@ -439,210 +439,6 @@ paths:
type: string type: string
tags: tags:
- Query - Query
/ethermint/evm/v1/base_fee:
get:
summary: BaseFee queries the base fee of the parent block of the current block.
operationId: BaseFee
responses:
'200':
description: A successful response.
schema:
type: object
properties:
base_fee:
type: string
description: BaseFeeResponse returns the EIP1559 base fee.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
description: >-
A URL/resource name that uniquely identifies the type of
the serialized
protocol buffer message. This string must contain at
least
one "/" character. The last segment of the URL's path
must represent
the fully qualified name of the type (as in
`path/google.protobuf.Duration`). The name should be in
a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary
all types that they
expect it to use in the context of Any. However, for
URLs which use the
scheme `http`, `https`, or no scheme, one can optionally
set up a type
server that maps type URLs to message definitions as
follows:
* If no scheme is provided, `https` is assumed.
* An HTTP GET on the URL must yield a
[google.protobuf.Type][]
value in binary format, or produce an error.
* Applications are allowed to cache lookup results based
on the
URL, or have them precompiled into a binary to avoid any
lookup. Therefore, binary compatibility needs to be preserved
on changes to types. (Use versioned type names to manage
breaking changes.)
Note: this functionality is not currently available in
the official
protobuf release, and it is not used for type URLs
beginning with
type.googleapis.com.
Schemes other than `http`, `https` (or the empty scheme)
might be
used with implementation specific semantics.
value:
type: string
format: byte
description: >-
Must be a valid serialized protocol buffer of the above
specified type.
description: >-
`Any` contains an arbitrary serialized protocol buffer
message along with a
URL that describes the type of the serialized message.
Protobuf library provides support to pack/unpack Any values
in the form
of utility functions or additional generated methods of the
Any type.
Example 1: Pack and unpack a message in C++.
Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}
Example 2: Pack and unpack a message in Java.
Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
foo = any.unpack(Foo.class);
}
Example 3: Pack and unpack a message in Python.
foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
any.Unpack(foo)
...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...}
any, err := ptypes.MarshalAny(foo)
...
foo := &pb.Foo{}
if err := ptypes.UnmarshalAny(any, foo); err != nil {
...
}
The pack methods provided by protobuf library will by
default use
'type.googleapis.com/full.type.name' as the type URL and the
unpack
methods only use the fully qualified type name after the
last '/'
in the type URL, for example "foo.bar.com/x/y.z" will yield
type
name "y.z".
JSON
====
The JSON representation of an `Any` value uses the regular
representation of the deserialized, embedded message, with
an
additional field `@type` which contains the type URL.
Example:
package google.profile;
message Person {
string first_name = 1;
string last_name = 2;
}
{
"@type": "type.googleapis.com/google.profile.Person",
"firstName": <string>,
"lastName": <string>
}
If the embedded message type is well-known and has a custom
JSON
representation, that representation will be embedded adding
a field
`value` which holds the custom JSON in addition to the
`@type`
field. Example (for message [google.protobuf.Duration][]):
{
"@type": "type.googleapis.com/google.protobuf.Duration",
"value": "1.212s"
}
tags:
- Query
/ethermint/evm/v1/block_bloom: /ethermint/evm/v1/block_bloom:
get: get:
summary: BlockBloom queries the block bloom filter bytes at a given height. summary: BlockBloom queries the block bloom filter bytes at a given height.
@ -2294,11 +2090,6 @@ paths:
using *sdk.Int values using *sdk.Int values
instead of *big.Int. instead of *big.Int.
no_base_fee:
type: boolean
title: >-
no base fee forces the EIP-1559 base fee to 0 (needed for
0 price calls)
title: Params defines the EVM module parameters title: Params defines the EVM module parameters
description: >- description: >-
QueryParamsResponse defines the response type for querying x/evm QueryParamsResponse defines the response type for querying x/evm
@ -13715,11 +13506,6 @@ definitions:
values values
instead of *big.Int. instead of *big.Int.
no_base_fee:
type: boolean
title: >-
no base fee forces the EIP-1559 base fee to 0 (needed for 0 price
calls)
title: Params defines the EVM module parameters title: Params defines the EVM module parameters
ethermint.evm.v1.QueryAccountResponse: ethermint.evm.v1.QueryAccountResponse:
type: object type: object
@ -13746,12 +13532,6 @@ definitions:
description: >- description: >-
QueryBalanceResponse is the response type for the Query/Balance RPC QueryBalanceResponse is the response type for the Query/Balance RPC
method. method.
ethermint.evm.v1.QueryBaseFeeResponse:
type: object
properties:
base_fee:
type: string
description: BaseFeeResponse returns the EIP1559 base fee.
ethermint.evm.v1.QueryBlockBloomResponse: ethermint.evm.v1.QueryBlockBloomResponse:
type: object type: object
properties: properties:
@ -13976,11 +13756,6 @@ definitions:
*sdk.Int values *sdk.Int values
instead of *big.Int. instead of *big.Int.
no_base_fee:
type: boolean
title: >-
no base fee forces the EIP-1559 base fee to 0 (needed for 0 price
calls)
title: Params defines the EVM module parameters title: Params defines the EVM module parameters
description: >- description: >-
QueryParamsResponse defines the response type for querying x/evm QueryParamsResponse defines the response type for querying x/evm

View File

@ -60,6 +60,22 @@
- [Query](#ethermint.evm.v1.Query) - [Query](#ethermint.evm.v1.Query)
- [ethermint/feemarket/v1/feemarket.proto](#ethermint/feemarket/v1/feemarket.proto)
- [Params](#ethermint.feemarket.v1.Params)
- [ethermint/feemarket/v1/genesis.proto](#ethermint/feemarket/v1/genesis.proto)
- [GenesisState](#ethermint.feemarket.v1.GenesisState)
- [ethermint/feemarket/v1/query.proto](#ethermint/feemarket/v1/query.proto)
- [QueryBaseFeeRequest](#ethermint.feemarket.v1.QueryBaseFeeRequest)
- [QueryBaseFeeResponse](#ethermint.feemarket.v1.QueryBaseFeeResponse)
- [QueryBlockGasRequest](#ethermint.feemarket.v1.QueryBlockGasRequest)
- [QueryBlockGasResponse](#ethermint.feemarket.v1.QueryBlockGasResponse)
- [QueryParamsRequest](#ethermint.feemarket.v1.QueryParamsRequest)
- [QueryParamsResponse](#ethermint.feemarket.v1.QueryParamsResponse)
- [Query](#ethermint.feemarket.v1.Query)
- [ethermint/types/v1/account.proto](#ethermint/types/v1/account.proto) - [ethermint/types/v1/account.proto](#ethermint/types/v1/account.proto)
- [EthAccount](#ethermint.types.v1.EthAccount) - [EthAccount](#ethermint.types.v1.EthAccount)
@ -210,7 +226,6 @@ Params defines the EVM module parameters
| `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function | | `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function |
| `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config | | `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config |
| `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters | | `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters |
| `no_base_fee` | [bool](#bool) | | no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) |
@ -895,7 +910,6 @@ Query defines the gRPC querier service.
| `BlockLogs` | [QueryBlockLogsRequest](#ethermint.evm.v1.QueryBlockLogsRequest) | [QueryBlockLogsResponse](#ethermint.evm.v1.QueryBlockLogsResponse) | BlockLogs queries all the ethereum logs for a given block hash. | GET|/ethermint/evm/v1/block_logs/{hash}| | `BlockLogs` | [QueryBlockLogsRequest](#ethermint.evm.v1.QueryBlockLogsRequest) | [QueryBlockLogsResponse](#ethermint.evm.v1.QueryBlockLogsResponse) | BlockLogs queries all the ethereum logs for a given block hash. | GET|/ethermint/evm/v1/block_logs/{hash}|
| `BlockBloom` | [QueryBlockBloomRequest](#ethermint.evm.v1.QueryBlockBloomRequest) | [QueryBlockBloomResponse](#ethermint.evm.v1.QueryBlockBloomResponse) | BlockBloom queries the block bloom filter bytes at a given height. | GET|/ethermint/evm/v1/block_bloom| | `BlockBloom` | [QueryBlockBloomRequest](#ethermint.evm.v1.QueryBlockBloomRequest) | [QueryBlockBloomResponse](#ethermint.evm.v1.QueryBlockBloomResponse) | BlockBloom queries the block bloom filter bytes at a given height. | GET|/ethermint/evm/v1/block_bloom|
| `Params` | [QueryParamsRequest](#ethermint.evm.v1.QueryParamsRequest) | [QueryParamsResponse](#ethermint.evm.v1.QueryParamsResponse) | Params queries the parameters of x/evm module. | GET|/ethermint/evm/v1/params| | `Params` | [QueryParamsRequest](#ethermint.evm.v1.QueryParamsRequest) | [QueryParamsResponse](#ethermint.evm.v1.QueryParamsResponse) | Params queries the parameters of x/evm module. | GET|/ethermint/evm/v1/params|
| `BaseFee` | [QueryBaseFeeRequest](#ethermint.evm.v1.QueryBaseFeeRequest) | [QueryBaseFeeResponse](#ethermint.evm.v1.QueryBaseFeeResponse) | BaseFee queries the base fee of the parent block of the current block. | GET|/ethermint/evm/v1/base_fee|
| `EthCall` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [MsgEthereumTxResponse](#ethermint.evm.v1.MsgEthereumTxResponse) | EthCall implements the `eth_call` rpc api | GET|/ethermint/evm/v1/eth_call| | `EthCall` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [MsgEthereumTxResponse](#ethermint.evm.v1.MsgEthereumTxResponse) | EthCall implements the `eth_call` rpc api | GET|/ethermint/evm/v1/eth_call|
| `EstimateGas` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [EstimateGasResponse](#ethermint.evm.v1.EstimateGasResponse) | EstimateGas implements the `eth_estimateGas` rpc api | GET|/ethermint/evm/v1/estimate_gas| | `EstimateGas` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [EstimateGasResponse](#ethermint.evm.v1.EstimateGasResponse) | EstimateGas implements the `eth_estimateGas` rpc api | GET|/ethermint/evm/v1/estimate_gas|
@ -903,6 +917,179 @@ Query defines the gRPC querier service.
<a name="ethermint/feemarket/v1/feemarket.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## ethermint/feemarket/v1/feemarket.proto
<a name="ethermint.feemarket.v1.Params"></a>
### Params
Params defines the EVM module parameters
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `no_base_fee` | [bool](#bool) | | no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) |
| `base_fee_change_denominator` | [uint32](#uint32) | | base fee change denominator bounds the amount the base fee can change between blocks. |
| `elasticity_multiplier` | [uint32](#uint32) | | elasticity multiplier bounds the maximum gas limit an EIP-1559 block may have. |
| `initial_base_fee` | [int64](#int64) | | initial base fee for EIP-1559 blocks. |
| `enable_height` | [int64](#int64) | | height at which the base fee calculation is enabled. |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<!-- end services -->
<a name="ethermint/feemarket/v1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## ethermint/feemarket/v1/genesis.proto
<a name="ethermint.feemarket.v1.GenesisState"></a>
### GenesisState
GenesisState defines the feemarket module's genesis state.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#ethermint.feemarket.v1.Params) | | params defines all the paramaters of the module. |
| `base_fee` | [string](#string) | | base fee is the exported value from previous software version. Zero by default. |
| `block_gas` | [uint64](#uint64) | | block gas is the amount of gas used on the last block before the upgrade. Zero by default. |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<!-- end services -->
<a name="ethermint/feemarket/v1/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## ethermint/feemarket/v1/query.proto
<a name="ethermint.feemarket.v1.QueryBaseFeeRequest"></a>
### QueryBaseFeeRequest
QueryBaseFeeRequest defines the request type for querying the EIP1559 base
fee.
<a name="ethermint.feemarket.v1.QueryBaseFeeResponse"></a>
### QueryBaseFeeResponse
BaseFeeResponse returns the EIP1559 base fee.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `base_fee` | [string](#string) | | |
<a name="ethermint.feemarket.v1.QueryBlockGasRequest"></a>
### QueryBlockGasRequest
QueryBlockGasRequest defines the request type for querying the EIP1559 base
fee.
<a name="ethermint.feemarket.v1.QueryBlockGasResponse"></a>
### QueryBlockGasResponse
QueryBlockGasResponse returns block gas used for a given height.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `gas` | [int64](#int64) | | |
<a name="ethermint.feemarket.v1.QueryParamsRequest"></a>
### QueryParamsRequest
QueryParamsRequest defines the request type for querying x/evm parameters.
<a name="ethermint.feemarket.v1.QueryParamsResponse"></a>
### QueryParamsResponse
QueryParamsResponse defines the response type for querying x/evm parameters.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#ethermint.feemarket.v1.Params) | | params define the evm module parameters. |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<a name="ethermint.feemarket.v1.Query"></a>
### Query
Query defines the gRPC querier service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Params` | [QueryParamsRequest](#ethermint.feemarket.v1.QueryParamsRequest) | [QueryParamsResponse](#ethermint.feemarket.v1.QueryParamsResponse) | Params queries the parameters of x/feemarket module. | GET|/feemarket/evm/v1/params|
| `BaseFee` | [QueryBaseFeeRequest](#ethermint.feemarket.v1.QueryBaseFeeRequest) | [QueryBaseFeeResponse](#ethermint.feemarket.v1.QueryBaseFeeResponse) | BaseFee queries the base fee of the parent block of the current block. | GET|/feemarket/evm/v1/base_fee|
| `BlockGas` | [QueryBlockGasRequest](#ethermint.feemarket.v1.QueryBlockGasRequest) | [QueryBlockGasResponse](#ethermint.feemarket.v1.QueryBlockGasResponse) | BlockGas queries the gas used at a given block height | GET|/feemarket/evm/v1/block_gas|
<!-- end services -->
<a name="ethermint/types/v1/account.proto"></a> <a name="ethermint/types/v1/account.proto"></a>
<p align="right"><a href="#top">Top</a></p> <p align="right"><a href="#top">Top</a></p>

2
go.mod
View File

@ -47,7 +47,7 @@ require (
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect
google.golang.org/genproto v0.0.0-20210824181836-a4879c3d0e89 google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda
google.golang.org/grpc v1.40.0 google.golang.org/grpc v1.40.0
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
nhooyr.io/websocket v1.8.7 // indirect nhooyr.io/websocket v1.8.7 // indirect

4
go.sum
View File

@ -1425,8 +1425,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210824181836-a4879c3d0e89 h1:x1dY+qZWu7fKPOOo4mM9kMcUfVVlDvHreE17KGDho00= google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda h1:iT5uhT54PtbqUsWddv/nnEWdE5e/MTr+Nv3vjxlBP1A=
google.golang.org/genproto v0.0.0-20210824181836-a4879c3d0e89/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=

View File

@ -26,8 +26,6 @@ message Params {
(gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.moretags) = "yaml:\"chain_config\"",
(gogoproto.nullable) = false (gogoproto.nullable) = false
]; ];
// no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls)
bool no_base_fee = 6 [ (gogoproto.moretags) = "yaml:\"no_base_fee\"" ];
} }
// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values

View File

@ -68,11 +68,6 @@ service Query {
option (google.api.http).get = "/ethermint/evm/v1/params"; option (google.api.http).get = "/ethermint/evm/v1/params";
} }
// BaseFee queries the base fee of the parent block of the current block.
rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) {
option (google.api.http).get = "/ethermint/evm/v1/base_fee";
}
// EthCall implements the `eth_call` rpc api // EthCall implements the `eth_call` rpc api
rpc EthCall(EthCallRequest) returns (MsgEthereumTxResponse) { rpc EthCall(EthCallRequest) returns (MsgEthereumTxResponse) {
option (google.api.http).get = "/ethermint/evm/v1/eth_call"; option (google.api.http).get = "/ethermint/evm/v1/eth_call";

View File

@ -0,0 +1,20 @@
syntax = "proto3";
package ethermint.feemarket.v1;
import "gogoproto/gogo.proto";
option go_package = "github.com/tharsis/ethermint/x/feemarket/types";
// Params defines the EVM module parameters
message Params {
// no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls)
bool no_base_fee = 1;
// base fee change denominator bounds the amount the base fee can change between blocks.
uint32 base_fee_change_denominator = 2;
// elasticity multiplier bounds the maximum gas limit an EIP-1559 block may have.
uint32 elasticity_multiplier = 3;
// initial base fee for EIP-1559 blocks.
int64 initial_base_fee = 4;
// height at which the base fee calculation is enabled.
int64 enable_height = 5;
}

View File

@ -0,0 +1,22 @@
syntax = "proto3";
package ethermint.feemarket.v1;
import "gogoproto/gogo.proto";
import "ethermint/feemarket/v1/feemarket.proto";
option go_package = "github.com/tharsis/ethermint/x/feemarket/types";
// GenesisState defines the feemarket module's genesis state.
message GenesisState {
// params defines all the paramaters of the module.
Params params = 1 [(gogoproto.nullable) = false];
// base fee is the exported value from previous software version.
// Zero by default.
string base_fee = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// block gas is the amount of gas used on the last block before the upgrade.
// Zero by default.
uint64 block_gas = 3;
}

View File

@ -0,0 +1,58 @@
syntax = "proto3";
package ethermint.feemarket.v1;
import "gogoproto/gogo.proto";
// import "cosmos/base/query/v1beta1/pagination.proto";
import "google/api/annotations.proto";
import "ethermint/feemarket/v1/feemarket.proto";
option go_package = "github.com/tharsis/ethermint/x/feemarket/types";
// Query defines the gRPC querier service.
service Query {
// Params queries the parameters of x/feemarket module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/feemarket/evm/v1/params";
}
// BaseFee queries the base fee of the parent block of the current block.
rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) {
option (google.api.http).get = "/feemarket/evm/v1/base_fee";
}
// BlockGas queries the gas used at a given block height
rpc BlockGas(QueryBlockGasRequest) returns (QueryBlockGasResponse) {
option (google.api.http).get = "/feemarket/evm/v1/block_gas";
}
}
// QueryParamsRequest defines the request type for querying x/evm parameters.
message QueryParamsRequest {}
// QueryParamsResponse defines the response type for querying x/evm parameters.
message QueryParamsResponse {
// params define the evm module parameters.
Params params = 1 [ (gogoproto.nullable) = false ];
}
// QueryBaseFeeRequest defines the request type for querying the EIP1559 base
// fee.
message QueryBaseFeeRequest {}
// BaseFeeResponse returns the EIP1559 base fee.
message QueryBaseFeeResponse {
string base_fee = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}
// QueryBlockGasRequest defines the request type for querying the EIP1559 base
// fee.
message QueryBlockGasRequest {}
// QueryBlockGasResponse returns block gas used for a given height.
message QueryBlockGasResponse {
int64 gas = 1;
}

View File

@ -1,7 +1,6 @@
package keeper package keeper
import ( import (
"fmt"
"time" "time"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
@ -30,20 +29,6 @@ func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.Vali
infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) infCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
k.WithContext(infCtx) k.WithContext(infCtx)
baseFee := k.CalculateBaseFee(ctx)
// only set base fee if the NoBaseFee param is false
if baseFee != nil {
k.SetBaseFee(ctx, baseFee)
k.SetBlockGasUsed(ctx)
k.Ctx().EventManager().EmitEvent(sdk.NewEvent(
"block_gas",
sdk.NewAttribute("height", fmt.Sprintf("%d", ctx.BlockHeight())),
sdk.NewAttribute("amount", fmt.Sprintf("%d", ctx.BlockGasMeter().GasConsumedToLimit())),
))
}
bloom := ethtypes.BytesToBloom(k.GetBlockBloomTransient().Bytes()) bloom := ethtypes.BytesToBloom(k.GetBlockBloomTransient().Bytes())
k.SetBlockBloom(infCtx, req.Height, bloom) k.SetBlockBloom(infCtx, req.Height, bloom)

View File

@ -132,58 +132,6 @@ func (k Keeper) ChainID() *big.Int {
return k.eip155ChainID return k.eip155ChainID
} }
// ----------------------------------------------------------------------------
// Parent Block Gas Used
// Required by EIP1559 base fee calculation.
// ----------------------------------------------------------------------------
// GetBlockGasUsed returns the last block gas used value from the store.
func (k Keeper) GetBlockGasUsed(ctx sdk.Context) uint64 {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyPrefixBlockGasUsed)
if len(bz) == 0 {
return 0
}
return sdk.BigEndianToUint64(bz)
}
// SetBlockGasUsed gets the current block gas consumed to the store.
// CONTRACT: this should be only called during EndBlock.
func (k Keeper) SetBlockGasUsed(ctx sdk.Context) {
if ctx.BlockGasMeter() == nil {
k.Logger(ctx).Error("block gas meter is nil when setting block gas used")
return
}
store := ctx.KVStore(k.storeKey)
gasBz := sdk.Uint64ToBigEndian(ctx.BlockGasMeter().GasConsumedToLimit())
store.Set(types.KeyPrefixBlockGasUsed, gasBz)
}
// ----------------------------------------------------------------------------
// Parent Base Fee
// Required by EIP1559 base fee calculation.
// ----------------------------------------------------------------------------
// GetBlockGasUsed returns the last block gas used value from the store.
func (k Keeper) GetBaseFee(ctx sdk.Context) *big.Int {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyPrefixBaseFee)
if len(bz) == 0 {
return new(big.Int).SetUint64(types.InitialBaseFee) // TODO: use geth params
}
return new(big.Int).SetBytes(bz)
}
// SetBlockGasUsed gets the current block gas consumed to the store.
// CONTRACT: this should be only called during EndBlock.
func (k Keeper) SetBaseFee(ctx sdk.Context, baseFee *big.Int) {
store := ctx.KVStore(k.storeKey)
store.Set(types.KeyPrefixBaseFee, baseFee.Bytes())
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Block Bloom // Block Bloom
// Required by Web3 API. // Required by Web3 API.

View File

@ -10,13 +10,6 @@ import (
"github.com/tharsis/ethermint/types" "github.com/tharsis/ethermint/types"
) )
// TODO: remove once migrated to latest go-ethereum
const (
BaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks.
ElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have.
InitialBaseFee = 1000000000 // Initial base fee for EIP-1559 blocks.
)
// nolint: deadcode, unused // nolint: deadcode, unused
func newDynamicFeeTx(tx *ethtypes.Transaction) *DynamicFeeTx { func newDynamicFeeTx(tx *ethtypes.Transaction) *DynamicFeeTx {
txData := &DynamicFeeTx{ txData := &DynamicFeeTx{

View File

@ -37,8 +37,6 @@ type Params struct {
ExtraEIPs []int64 `protobuf:"varint,4,rep,packed,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty" yaml:"extra_eips"` ExtraEIPs []int64 `protobuf:"varint,4,rep,packed,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty" yaml:"extra_eips"`
// chain config defines the EVM chain configuration parameters // chain config defines the EVM chain configuration parameters
ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"`
// no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls)
NoBaseFee bool `protobuf:"varint,6,opt,name=no_base_fee,json=noBaseFee,proto3" json:"no_base_fee,omitempty" yaml:"no_base_fee"`
} }
func (m *Params) Reset() { *m = Params{} } func (m *Params) Reset() { *m = Params{} }
@ -108,13 +106,6 @@ func (m *Params) GetChainConfig() ChainConfig {
return ChainConfig{} return ChainConfig{}
} }
func (m *Params) GetNoBaseFee() bool {
if m != nil {
return m.NoBaseFee
}
return false
}
// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values
// instead of *big.Int. // instead of *big.Int.
type ChainConfig struct { type ChainConfig struct {
@ -534,87 +525,86 @@ func init() {
func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) }
var fileDescriptor_d21ecc92c8c8583e = []byte{ var fileDescriptor_d21ecc92c8c8583e = []byte{
// 1277 bytes of a gzipped FileDescriptorProto // 1249 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcf, 0x6f, 0xdb, 0x36, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0x4f, 0x6f, 0xdb, 0xb6,
0x1b, 0xc7, 0xe3, 0xd8, 0x49, 0x6c, 0x4a, 0xb6, 0x55, 0xd6, 0xcd, 0xeb, 0xb6, 0x78, 0xa3, 0xbc, 0x1b, 0xc7, 0xe3, 0xd8, 0x49, 0x64, 0x4a, 0xb6, 0x55, 0xd6, 0xcd, 0xcf, 0x6d, 0xf1, 0x8b, 0x32,
0x3c, 0xbc, 0xf0, 0x80, 0x36, 0x6e, 0x52, 0x64, 0x2b, 0x0a, 0xec, 0x10, 0xa5, 0x69, 0x97, 0xae, 0x1e, 0x06, 0x0f, 0x68, 0xe3, 0x26, 0x45, 0xb0, 0xa2, 0xc0, 0x0e, 0x71, 0x9a, 0x76, 0xe9, 0x8a,
0xd8,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0x6d, 0xc5, 0xce, 0x0b, 0x00,
0xed, 0xf9, 0x33, 0x7f, 0x28, 0x1f, 0xfa, 0xf2, 0xa7, 0xee, 0x6c, 0xca, 0x07, 0xfc, 0xc3, 0xbf, 0x00,
0x03, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xab, 0x31, 0x31, 0x06, 0x0c, 0x00, 0x00,
} }
func (m *Params) Marshal() (dAtA []byte, err error) { func (m *Params) Marshal() (dAtA []byte, err error) {
@ -637,16 +627,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.NoBaseFee {
i--
if m.NoBaseFee {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x30
}
{ {
size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i])
if err != nil { if err != nil {
@ -1216,9 +1196,6 @@ func (m *Params) Size() (n int) {
} }
l = m.ChainConfig.Size() l = m.ChainConfig.Size()
n += 1 + l + sovEvm(uint64(l)) n += 1 + l + sovEvm(uint64(l))
if m.NoBaseFee {
n += 2
}
return n return n
} }
@ -1633,26 +1610,6 @@ func (m *Params) Unmarshal(dAtA []byte) error {
return err return err
} }
iNdEx = postIndex iNdEx = postIndex
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field NoBaseFee", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvm
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.NoBaseFee = bool(v != 0)
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipEvm(dAtA[iNdEx:]) skippy, err := skipEvm(dAtA[iNdEx:])

View File

@ -38,14 +38,13 @@ func ParamKeyTable() paramtypes.KeyTable {
} }
// NewParams creates a new Params instance // NewParams creates a new Params instance
func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, noBaseFee bool, extraEIPs ...int64) Params { func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, extraEIPs ...int64) Params {
return Params{ return Params{
EvmDenom: evmDenom, EvmDenom: evmDenom,
EnableCreate: enableCreate, EnableCreate: enableCreate,
EnableCall: enableCall, EnableCall: enableCall,
ExtraEIPs: extraEIPs, ExtraEIPs: extraEIPs,
ChainConfig: config, ChainConfig: config,
NoBaseFee: noBaseFee,
} }
} }
@ -58,7 +57,6 @@ func DefaultParams() Params {
EnableCall: true, EnableCall: true,
ChainConfig: DefaultChainConfig(), ChainConfig: DefaultChainConfig(),
ExtraEIPs: nil, ExtraEIPs: nil,
NoBaseFee: true,
} }
} }
@ -76,7 +74,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool), paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool),
paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs), paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs),
paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig), paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig),
paramtypes.NewParamSetPair(ParamStoreKeyNoBaseFee, &p.NoBaseFee, validateBool),
} }
} }

View File

@ -15,7 +15,7 @@ func TestParamsValidate(t *testing.T) {
{"default", DefaultParams(), false}, {"default", DefaultParams(), false},
{ {
"valid", "valid",
NewParams("ara", true, true, DefaultChainConfig(), true, 2929, 1884, 1344), NewParams("ara", true, true, DefaultChainConfig(), 2929, 1884, 1344),
false, false,
}, },
{ {
@ -40,7 +40,7 @@ func TestParamsValidate(t *testing.T) {
}, },
{ {
"invalid chain config", "invalid chain config",
NewParams("ara", true, true, ChainConfig{}, true, 2929, 1884, 1344), NewParams("ara", true, true, ChainConfig{}, 2929, 1884, 1344),
false, false,
}, },
} }

View File

@ -1217,87 +1217,86 @@ func init() {
func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) } func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) }
var fileDescriptor_e15a877459347994 = []byte{ var fileDescriptor_e15a877459347994 = []byte{
// 1279 bytes of a gzipped FileDescriptorProto // 1260 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x13, 0x47, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x13, 0xc7,
0x14, 0xf7, 0x12, 0x63, 0x87, 0x17, 0xa0, 0xe9, 0x10, 0x20, 0x6c, 0x83, 0x63, 0x06, 0x92, 0x38, 0x17, 0xf7, 0x12, 0x63, 0x87, 0x17, 0xc2, 0x37, 0xdf, 0x21, 0x40, 0xd8, 0x06, 0xc7, 0x0c, 0x24,
0x10, 0x76, 0x89, 0x5b, 0x21, 0x15, 0xa9, 0x2a, 0x38, 0x0a, 0x14, 0x01, 0x15, 0x35, 0x51, 0x0f, 0x71, 0x20, 0xec, 0x12, 0xb7, 0x42, 0x2a, 0x52, 0x55, 0xe2, 0x28, 0x50, 0x04, 0x54, 0xd4, 0x44,
0xbd, 0x58, 0xe3, 0xf5, 0x74, 0x6d, 0xc5, 0xde, 0x31, 0x9e, 0xb5, 0xeb, 0x34, 0x4d, 0x5b, 0x55, 0x3d, 0xf4, 0x62, 0x8d, 0xd7, 0xd3, 0xb5, 0x15, 0x7b, 0xc7, 0x78, 0xd6, 0xae, 0xd3, 0x28, 0xad,
0x2a, 0x42, 0xe2, 0x52, 0xa9, 0xf7, 0x0a, 0xa9, 0x1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0x00, 0x00, 0xff, 0xff, 0x8b, 0x1a, 0xe1, 0x0e, 0x18, 0x0f, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -1334,8 +1333,6 @@ type QueryClient interface {
BlockBloom(ctx context.Context, in *QueryBlockBloomRequest, opts ...grpc.CallOption) (*QueryBlockBloomResponse, error) BlockBloom(ctx context.Context, in *QueryBlockBloomRequest, opts ...grpc.CallOption) (*QueryBlockBloomResponse, error)
// Params queries the parameters of x/evm module. // Params queries the parameters of x/evm module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// BaseFee queries the base fee of the parent block of the current block.
BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error)
// EthCall implements the `eth_call` rpc api // EthCall implements the `eth_call` rpc api
EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error)
// EstimateGas implements the `eth_estimateGas` rpc api // EstimateGas implements the `eth_estimateGas` rpc api
@ -1440,15 +1437,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil return out, nil
} }
func (c *queryClient) BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) {
out := new(QueryBaseFeeResponse)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1.Query/BaseFee", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { func (c *queryClient) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) {
out := new(MsgEthereumTxResponse) out := new(MsgEthereumTxResponse)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1.Query/EthCall", in, out, opts...) err := c.cc.Invoke(ctx, "/ethermint.evm.v1.Query/EthCall", in, out, opts...)
@ -1491,8 +1479,6 @@ type QueryServer interface {
BlockBloom(context.Context, *QueryBlockBloomRequest) (*QueryBlockBloomResponse, error) BlockBloom(context.Context, *QueryBlockBloomRequest) (*QueryBlockBloomResponse, error)
// Params queries the parameters of x/evm module. // Params queries the parameters of x/evm module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// BaseFee queries the base fee of the parent block of the current block.
BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error)
// EthCall implements the `eth_call` rpc api // EthCall implements the `eth_call` rpc api
EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error) EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error)
// EstimateGas implements the `eth_estimateGas` rpc api // EstimateGas implements the `eth_estimateGas` rpc api
@ -1533,9 +1519,6 @@ func (*UnimplementedQueryServer) BlockBloom(ctx context.Context, req *QueryBlock
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (*UnimplementedQueryServer) BaseFee(ctx context.Context, req *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BaseFee not implemented")
}
func (*UnimplementedQueryServer) EthCall(ctx context.Context, req *EthCallRequest) (*MsgEthereumTxResponse, error) { func (*UnimplementedQueryServer) EthCall(ctx context.Context, req *EthCallRequest) (*MsgEthereumTxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EthCall not implemented") return nil, status.Errorf(codes.Unimplemented, "method EthCall not implemented")
} }
@ -1727,24 +1710,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBaseFeeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).BaseFee(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethermint.evm.v1.Query/BaseFee",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BaseFee(ctx, req.(*QueryBaseFeeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_EthCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_EthCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EthCallRequest) in := new(EthCallRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -1825,10 +1790,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Params", MethodName: "Params",
Handler: _Query_Params_Handler, Handler: _Query_Params_Handler,
}, },
{
MethodName: "BaseFee",
Handler: _Query_BaseFee_Handler,
},
{ {
MethodName: "EthCall", MethodName: "EthCall",
Handler: _Query_EthCall_Handler, Handler: _Query_EthCall_Handler,

View File

@ -557,24 +557,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
} }
func request_Query_BaseFee_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBaseFeeRequest
var metadata runtime.ServerMetadata
msg, err := client.BaseFee(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_BaseFee_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBaseFeeRequest
var metadata runtime.ServerMetadata
msg, err := server.BaseFee(ctx, &protoReq)
return msg, metadata, err
}
var ( var (
filter_Query_EthCall_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} filter_Query_EthCall_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
) )
@ -853,26 +835,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}) })
mux.Handle("GET", pattern_Query_BaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_BaseFee_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@ -1154,26 +1116,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}) })
mux.Handle("GET", pattern_Query_BaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_BaseFee_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@ -1238,8 +1180,6 @@ var (
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BaseFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "base_fee"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_EthCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "eth_call"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_EthCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "eth_call"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "estimate_gas"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "estimate_gas"}, "", runtime.AssumeColonVerbOpt(true)))
@ -1266,8 +1206,6 @@ var (
forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage
forward_Query_BaseFee_0 = runtime.ForwardResponseMessage
forward_Query_EthCall_0 = runtime.ForwardResponseMessage forward_Query_EthCall_0 = runtime.ForwardResponseMessage
forward_Query_EstimateGas_0 = runtime.ForwardResponseMessage forward_Query_EstimateGas_0 = runtime.ForwardResponseMessage

View File

@ -0,0 +1,139 @@
package cli
import (
"fmt"
"strconv"
"github.com/spf13/cobra"
"google.golang.org/grpc/metadata"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
grpctypes "github.com/cosmos/cosmos-sdk/types/grpc"
"github.com/tharsis/ethermint/x/feemarket/types"
)
// GetQueryCmd returns the parent command for all x/feemarket CLI query commands.
func GetQueryCmd() *cobra.Command {
cmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for the fee market module",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
cmd.AddCommand(
GetBlockGasCmd(),
GetBaseFeeCmd(),
GetParamsCmd(),
)
return cmd
}
// GetBlockGasCmd queries the gas used in a block
func GetBlockGasCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "block-gas [height]",
Short: "Get the block gas used at a given block height",
Long: "Get the block gas used at a given block height. If the height is not provided, it will use the latest height from context.",
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
ctx := cmd.Context()
if len(args) == 1 {
height := args[0]
_, err := strconv.ParseInt(height, 10, 64)
if err != nil {
return fmt.Errorf("invalid height: %w", err)
}
ctx = metadata.AppendToOutgoingContext(ctx, grpctypes.GRPCBlockHeightHeader, height)
}
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.BlockGas(ctx, &types.QueryBlockGasRequest{})
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}
// GetParamsCmd queries the fee market params
func GetParamsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Get the fee market params",
Long: "Get the fee market parameter values.",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}
// GetBaseFeeCmd queries the base fee at a given height
func GetBaseFeeCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "base-fee [height]",
Short: "Get the base fee amount at a given block height",
Long: "Get the base fee amount at a given block height. If the height is not provided, it will use the latest height from context.",
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
ctx := cmd.Context()
if len(args) == 1 {
height := args[0]
_, err := strconv.ParseInt(height, 10, 64)
if err != nil {
return fmt.Errorf("invalid height: %w", err)
}
ctx = metadata.AppendToOutgoingContext(ctx, grpctypes.GRPCBlockHeightHeader, height)
}
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.BaseFee(ctx, &types.QueryBaseFeeRequest{})
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}

38
x/feemarket/genesis.go Normal file
View File

@ -0,0 +1,38 @@
package feemarket
import (
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tharsis/ethermint/x/feemarket/keeper"
"github.com/tharsis/ethermint/x/feemarket/types"
)
// InitGenesis initializes genesis state based on exported genesis
func InitGenesis(
ctx sdk.Context,
k keeper.Keeper,
data types.GenesisState,
) []abci.ValidatorUpdate {
k.SetParams(ctx, data.Params)
k.SetBaseFee(ctx, data.BaseFee.BigInt())
k.SetBlockGasUsed(ctx, data.BlockGas)
return []abci.ValidatorUpdate{}
}
// ExportGenesis exports genesis state of the fee market module
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
baseFee := sdk.ZeroInt()
baseFeeInt := k.GetBaseFee(ctx)
if baseFeeInt != nil {
baseFee = sdk.NewIntFromBigInt(baseFeeInt)
}
return &types.GenesisState{
Params: k.GetParams(ctx),
BaseFee: baseFee,
BlockGas: k.GetBlockGasUsed(ctx),
}
}

View File

@ -0,0 +1,43 @@
package keeper
import (
"fmt"
"time"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tharsis/ethermint/x/feemarket/types"
)
// EndBlock also retrieves the bloom filter value from the transient store and commits it to the
// KVStore. The EVM end block logic doesn't update the validator set, thus it returns
// an empty slice.
func (k *Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
baseFee := k.CalculateBaseFee(ctx)
if baseFee == nil {
return
}
// only set base fee if the NoBaseFee param is false
k.SetBaseFee(ctx, baseFee)
if ctx.BlockGasMeter() == nil {
k.Logger(ctx).Error("block gas meter is nil when setting block gas used")
return
}
gasUsed := ctx.BlockGasMeter().GasConsumedToLimit()
k.SetBlockGasUsed(ctx, gasUsed)
ctx.EventManager().EmitEvent(sdk.NewEvent(
"block_gas",
sdk.NewAttribute("height", fmt.Sprintf("%d", ctx.BlockHeight())),
sdk.NewAttribute("amount", fmt.Sprintf("%d", ctx.BlockGasMeter().GasConsumedToLimit())),
))
}

View File

@ -7,10 +7,6 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/common/math"
// "github.com/ethereum/go-ethereum/params"
"github.com/tharsis/ethermint/x/evm/types"
) )
// CalculateBaseFee calculates the base fee for the current block. This is only calculated once per // CalculateBaseFee calculates the base fee for the current block. This is only calculated once per
@ -18,31 +14,25 @@ import (
// NOTE: This code is inspired from the go-ethereum EIP1559 implementation and adapted to Cosmos SDK-based // NOTE: This code is inspired from the go-ethereum EIP1559 implementation and adapted to Cosmos SDK-based
// chains. For the canonical code refer to: https://github.com/ethereum/go-ethereum/blob/master/consensus/misc/eip1559.go // chains. For the canonical code refer to: https://github.com/ethereum/go-ethereum/blob/master/consensus/misc/eip1559.go
func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int { func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int {
consParams := ctx.ConsensusParams()
params := k.GetParams(ctx) params := k.GetParams(ctx)
if params.NoBaseFee { if params.NoBaseFee {
return nil return nil
} }
chainConfig := params.ChainConfig consParams := ctx.ConsensusParams()
cfg := chainConfig.EthereumConfig(k.eip155ChainID)
// If the current block is the first EIP-1559 block, return the InitialBaseFee. // If the current block is the first EIP-1559 block, return the InitialBaseFee.
// if !chainConfig.EthereumConfig(k.eip155ChainID).IsLondon(big.NewInt(ctx.BlockHeight())) { if ctx.BlockHeight() <= params.EnableHeight {
// return new(big.Int).SetUint64(types.InitialBaseFee) return new(big.Int).SetInt64(params.InitialBaseFee)
// }
// FIXME: remove and uncomment line above
height := big.NewInt(ctx.BlockHeight())
rules := cfg.Rules(height)
if rules.IsBerlin || cfg.IsMuirGlacier(height) || rules.IsIstanbul || rules.IsByzantium || rules.IsConstantinople {
return new(big.Int).SetUint64(types.InitialBaseFee)
} }
// get the block gas used and the base fee values for the parent block. // get the block gas used and the base fee values for the parent block.
parentBaseFee := k.GetBaseFee(ctx) parentBaseFee := k.GetBaseFee(ctx)
if parentBaseFee == nil {
parentBaseFee = new(big.Int).SetInt64(params.InitialBaseFee)
}
parentGasUsed := k.GetBlockGasUsed(ctx) parentGasUsed := k.GetBlockGasUsed(ctx)
gasLimit := new(big.Int).SetUint64(math.MaxUint64) gasLimit := new(big.Int).SetUint64(math.MaxUint64)
@ -50,13 +40,13 @@ func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int {
gasLimit = big.NewInt(consParams.Block.MaxGas) gasLimit = big.NewInt(consParams.Block.MaxGas)
} }
parentGasTargetBig := new(big.Int).Div(gasLimit, big.NewInt(types.ElasticityMultiplier)) // TODO: update to geth parentGasTargetBig := new(big.Int).Div(gasLimit, new(big.Int).SetUint64(uint64(params.ElasticityMultiplier)))
if !parentGasTargetBig.IsUint64() { if !parentGasTargetBig.IsUint64() {
return new(big.Int).SetUint64(types.InitialBaseFee) // TODO: update to geth return new(big.Int).SetInt64(params.InitialBaseFee)
} }
parentGasTarget := parentGasTargetBig.Uint64() parentGasTarget := parentGasTargetBig.Uint64()
baseFeeChangeDenominator := new(big.Int).SetUint64(types.BaseFeeChangeDenominator) // TODO: update to geth baseFeeChangeDenominator := new(big.Int).SetUint64(uint64(params.BaseFeeChangeDenominator))
// If the parent gasUsed is the same as the target, the baseFee remains unchanged. // If the parent gasUsed is the same as the target, the baseFee remains unchanged.
if parentGasUsed == parentGasTarget { if parentGasUsed == parentGasTarget {

View File

@ -0,0 +1,47 @@
package keeper
import (
"context"
"math/big"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tharsis/ethermint/x/feemarket/types"
)
var _ types.QueryServer = Keeper{}
// Params implements the Query/Params gRPC method
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := k.GetParams(ctx)
return &types.QueryParamsResponse{
Params: params,
}, nil
}
// BaseFee implements the Query/BaseFee gRPC method
func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
baseFee := k.GetBaseFee(ctx)
if baseFee == nil {
// TODO: should this be 0? 1? error?
baseFee = big.NewInt(0)
}
return &types.QueryBaseFeeResponse{
BaseFee: sdk.NewIntFromBigInt(baseFee),
}, nil
}
// BlockGas implements the Query/BlockGas gRPC method
func (k Keeper) BlockGas(c context.Context, _ *types.QueryBlockGasRequest) (*types.QueryBlockGasResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
gas := k.GetBlockGasUsed(ctx)
return &types.QueryBlockGasResponse{
Gas: int64(gas),
}, nil
}

View File

@ -0,0 +1,91 @@
package keeper
import (
"math/big"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tharsis/ethermint/x/feemarket/types"
)
// Keeper grants access to the Fee Market module state.
type Keeper struct {
// Protobuf codec
cdc codec.BinaryCodec
// Store key required for the Fee Market Prefix KVStore.
storeKey sdk.StoreKey
// module specific parameter space that can be configured through governance
paramSpace paramtypes.Subspace
}
// NewKeeper generates new fee market module keeper
func NewKeeper(
cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace,
) Keeper {
// set KeyTable if it has not already been set
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
}
return Keeper{
cdc: cdc,
storeKey: storeKey,
paramSpace: paramSpace,
}
}
// Logger returns a module-specific logger.
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", types.ModuleName)
}
// ----------------------------------------------------------------------------
// Parent Block Gas Used
// Required by EIP1559 base fee calculation.
// ----------------------------------------------------------------------------
// GetBlockGasUsed returns the last block gas used value from the store.
func (k Keeper) GetBlockGasUsed(ctx sdk.Context) uint64 {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyPrefixBlockGasUsed)
if len(bz) == 0 {
return 0
}
return sdk.BigEndianToUint64(bz)
}
// SetBlockGasUsed gets the block gas consumed to the store.
// CONTRACT: this should be only called during EndBlock.
func (k Keeper) SetBlockGasUsed(ctx sdk.Context, gas uint64) {
store := ctx.KVStore(k.storeKey)
gasBz := sdk.Uint64ToBigEndian(gas)
store.Set(types.KeyPrefixBlockGasUsed, gasBz)
}
// ----------------------------------------------------------------------------
// Parent Base Fee
// Required by EIP1559 base fee calculation.
// ----------------------------------------------------------------------------
// GetBlockGasUsed returns the last block gas used value from the store.
func (k Keeper) GetBaseFee(ctx sdk.Context) *big.Int {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyPrefixBaseFee)
if len(bz) == 0 {
return nil
}
return new(big.Int).SetBytes(bz)
}
// SetBlockGasUsed gets the current block gas consumed to the store.
// CONTRACT: this should be only called during EndBlock.
func (k Keeper) SetBaseFee(ctx sdk.Context, baseFee *big.Int) {
store := ctx.KVStore(k.storeKey)
store.Set(types.KeyPrefixBaseFee, baseFee.Bytes())
}

View File

@ -0,0 +1,18 @@
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tharsis/ethermint/x/feemarket/types"
)
// GetParams returns the total set of fee market parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, &params)
return params
}
// SetParams sets the fee market parameters to the param space.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, &params)
}

157
x/feemarket/module.go Normal file
View File

@ -0,0 +1,157 @@
package feemarket
import (
"context"
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/tharsis/ethermint/x/feemarket/client/cli"
"github.com/tharsis/ethermint/x/feemarket/keeper"
"github.com/tharsis/ethermint/x/feemarket/types"
)
var (
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
)
// AppModuleBasic defines the basic application module used by the fee market module.
type AppModuleBasic struct{}
// Name returns the fee market module's name.
func (AppModuleBasic) Name() string {
return types.ModuleName
}
// RegisterLegacyAminoCodec performs a no-op as the fee market module doesn't support amino.
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}
// ConsensusVersion returns the consensus state-breaking version for the module.
func (AppModuleBasic) ConsensusVersion() uint64 {
return 1
}
// DefaultGenesis returns default genesis state as raw bytes for the fee market
// module.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesisState())
}
// ValidateGenesis is the validation check of the Genesis
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var genesisState types.GenesisState
if err := cdc.UnmarshalJSON(bz, &genesisState); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
}
return genesisState.Validate()
}
// RegisterRESTRoutes performs a no-op as the EVM module doesn't expose REST
// endpoints
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
}
func (b AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, serveMux *runtime.ServeMux) {
if err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(c)); err != nil {
panic(err)
}
}
// GetTxCmd returns the root tx command for the fee market module.
func (AppModuleBasic) GetTxCmd() *cobra.Command {
return nil
}
// GetQueryCmd returns no root query command for the fee market module.
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
}
// RegisterInterfaces registers interfaces and implementations of the fee market module.
func (AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {}
// ____________________________________________________________________________
// AppModule implements an application module for the fee market module.
type AppModule struct {
AppModuleBasic
keeper keeper.Keeper
}
// NewAppModule creates a new AppModule object
func NewAppModule(k keeper.Keeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{},
keeper: k,
}
}
// Name returns the fee market module's name.
func (AppModule) Name() string {
return types.ModuleName
}
// RegisterInvariants interface for registering invariants. Performs a no-op
// as the fee market module doesn't expose invariants.
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
// RegisterQueryService registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}
// Route returns the message routing key for the fee market module.
func (am AppModule) Route() sdk.Route {
return sdk.Route{}
}
// QuerierRoute returns the fee market module's querier route name.
func (AppModule) QuerierRoute() string { return types.RouterKey }
// LegacyQuerierHandler returns nil as the fee market module doesn't expose a legacy
// Querier.
func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return nil
}
// BeginBlock returns the begin block for the fee market module.
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {}
// EndBlock returns the end blocker for the fee market module. It returns no validator
// updates.
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
am.keeper.EndBlock(ctx, req)
return []abci.ValidatorUpdate{}
}
// InitGenesis performs genesis initialization for the fee market module. It returns
// no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState types.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, am.keeper, genesisState)
return []abci.ValidatorUpdate{}
}
// ExportGenesis returns the exported genesis state as raw bytes for the fee market
// module.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
gs := ExportGenesis(ctx, am.keeper)
return cdc.MustMarshalJSON(gs)
}

View File

@ -0,0 +1,462 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: ethermint/feemarket/v1/feemarket.proto
package types
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Params defines the EVM module parameters
type Params struct {
// no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls)
NoBaseFee bool `protobuf:"varint,1,opt,name=no_base_fee,json=noBaseFee,proto3" json:"no_base_fee,omitempty"`
// base fee change denominator bounds the amount the base fee can change between blocks.
BaseFeeChangeDenominator uint32 `protobuf:"varint,2,opt,name=base_fee_change_denominator,json=baseFeeChangeDenominator,proto3" json:"base_fee_change_denominator,omitempty"`
// elasticity multiplier bounds the maximum gas limit an EIP-1559 block may have.
ElasticityMultiplier uint32 `protobuf:"varint,3,opt,name=elasticity_multiplier,json=elasticityMultiplier,proto3" json:"elasticity_multiplier,omitempty"`
// initial base fee for EIP-1559 blocks.
InitialBaseFee int64 `protobuf:"varint,4,opt,name=initial_base_fee,json=initialBaseFee,proto3" json:"initial_base_fee,omitempty"`
// height at which the base fee calculation is enabled.
EnableHeight int64 `protobuf:"varint,5,opt,name=enable_height,json=enableHeight,proto3" json:"enable_height,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
func (m *Params) String() string { return proto.CompactTextString(m) }
func (*Params) ProtoMessage() {}
func (*Params) Descriptor() ([]byte, []int) {
return fileDescriptor_4feb8b20cf98e6e1, []int{0}
}
func (m *Params) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Params.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Params) XXX_Merge(src proto.Message) {
xxx_messageInfo_Params.Merge(m, src)
}
func (m *Params) XXX_Size() int {
return m.Size()
}
func (m *Params) XXX_DiscardUnknown() {
xxx_messageInfo_Params.DiscardUnknown(m)
}
var xxx_messageInfo_Params proto.InternalMessageInfo
func (m *Params) GetNoBaseFee() bool {
if m != nil {
return m.NoBaseFee
}
return false
}
func (m *Params) GetBaseFeeChangeDenominator() uint32 {
if m != nil {
return m.BaseFeeChangeDenominator
}
return 0
}
func (m *Params) GetElasticityMultiplier() uint32 {
if m != nil {
return m.ElasticityMultiplier
}
return 0
}
func (m *Params) GetInitialBaseFee() int64 {
if m != nil {
return m.InitialBaseFee
}
return 0
}
func (m *Params) GetEnableHeight() int64 {
if m != nil {
return m.EnableHeight
}
return 0
}
func init() {
proto.RegisterType((*Params)(nil), "ethermint.feemarket.v1.Params")
}
func init() {
proto.RegisterFile("ethermint/feemarket/v1/feemarket.proto", fileDescriptor_4feb8b20cf98e6e1)
}
var fileDescriptor_4feb8b20cf98e6e1 = []byte{
// 298 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xc1, 0x4a, 0x33, 0x31,
0x14, 0x85, 0x9b, 0xbf, 0xbf, 0x45, 0xa3, 0x15, 0x19, 0xaa, 0x0c, 0x0a, 0xa1, 0x28, 0xc8, 0xac,
0x66, 0x28, 0x5d, 0xbb, 0xa9, 0x22, 0xdd, 0x08, 0xd2, 0xa5, 0x9b, 0x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, 0x8a, 0xe2, 0x3d, 0xaf, 0x1d, 0x6d, 0xc2, 0xa1, 0xcf, 0x06, 0xc3, 0xf7, 0x95,
0x60, 0xcb, 0x95, 0x60, 0x9f, 0x2b, 0xc1, 0xde, 0xd6, 0xa2, 0xb1, 0x5c, 0x8b, 0xc6, 0xc7, 0x5a,
0x34, 0x9e, 0xd2, 0x12, 0xa9, 0x9a, 0x15, 0xe9, 0xd8, 0xa8, 0x8c, 0x2a, 0x69, 0x1d, 0xba, 0x2c,
0x0c, 0xfe, 0xfa, 0x67, 0x72, 0x5a, 0x4c, 0xc1, 0x15, 0x2d, 0x3f, 0x5f, 0xff, 0x3b, 0x00, 0x00,
0xff, 0xff, 0x69, 0x30, 0x96, 0xce, 0x96, 0x01, 0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Params) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.EnableHeight != 0 {
i = encodeVarintFeemarket(dAtA, i, uint64(m.EnableHeight))
i--
dAtA[i] = 0x28
}
if m.InitialBaseFee != 0 {
i = encodeVarintFeemarket(dAtA, i, uint64(m.InitialBaseFee))
i--
dAtA[i] = 0x20
}
if m.ElasticityMultiplier != 0 {
i = encodeVarintFeemarket(dAtA, i, uint64(m.ElasticityMultiplier))
i--
dAtA[i] = 0x18
}
if m.BaseFeeChangeDenominator != 0 {
i = encodeVarintFeemarket(dAtA, i, uint64(m.BaseFeeChangeDenominator))
i--
dAtA[i] = 0x10
}
if m.NoBaseFee {
i--
if m.NoBaseFee {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintFeemarket(dAtA []byte, offset int, v uint64) int {
offset -= sovFeemarket(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Params) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.NoBaseFee {
n += 2
}
if m.BaseFeeChangeDenominator != 0 {
n += 1 + sovFeemarket(uint64(m.BaseFeeChangeDenominator))
}
if m.ElasticityMultiplier != 0 {
n += 1 + sovFeemarket(uint64(m.ElasticityMultiplier))
}
if m.InitialBaseFee != 0 {
n += 1 + sovFeemarket(uint64(m.InitialBaseFee))
}
if m.EnableHeight != 0 {
n += 1 + sovFeemarket(uint64(m.EnableHeight))
}
return n
}
func sovFeemarket(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozFeemarket(x uint64) (n int) {
return sovFeemarket(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Params) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Params: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field NoBaseFee", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.NoBaseFee = bool(v != 0)
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BaseFeeChangeDenominator", wireType)
}
m.BaseFeeChangeDenominator = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.BaseFeeChangeDenominator |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ElasticityMultiplier", wireType)
}
m.ElasticityMultiplier = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ElasticityMultiplier |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field InitialBaseFee", wireType)
}
m.InitialBaseFee = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.InitialBaseFee |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field EnableHeight", wireType)
}
m.EnableHeight = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFeemarket
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.EnableHeight |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipFeemarket(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFeemarket
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipFeemarket(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFeemarket
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFeemarket
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFeemarket
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthFeemarket
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupFeemarket
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthFeemarket
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthFeemarket = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowFeemarket = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupFeemarket = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,26 @@
package types
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// DefaultGenesisState sets default fee market genesis state.
func DefaultGenesisState() *GenesisState {
return &GenesisState{
Params: DefaultParams(),
BaseFee: sdk.ZeroInt(),
BlockGas: 0,
}
}
// Validate performs basic genesis state validation returning an error upon any
// failure.
func (gs GenesisState) Validate() error {
if gs.BaseFee.IsNegative() {
return fmt.Errorf("base fee cannot be negative: %s", gs.BaseFee)
}
return gs.Params.Validate()
}

View File

@ -0,0 +1,416 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: ethermint/feemarket/v1/genesis.proto
package types
import (
fmt "fmt"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// GenesisState defines the feemarket module's genesis state.
type GenesisState struct {
// params defines all the paramaters of the module.
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
// base fee is the exported value from previous software version.
// Zero by default.
BaseFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=base_fee,json=baseFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"base_fee"`
// block gas is the amount of gas used on the last block before the upgrade.
// Zero by default.
BlockGas uint64 `protobuf:"varint,3,opt,name=block_gas,json=blockGas,proto3" json:"block_gas,omitempty"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_6241c21661288629, []int{0}
}
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *GenesisState) XXX_Merge(src proto.Message) {
xxx_messageInfo_GenesisState.Merge(m, src)
}
func (m *GenesisState) XXX_Size() int {
return m.Size()
}
func (m *GenesisState) XXX_DiscardUnknown() {
xxx_messageInfo_GenesisState.DiscardUnknown(m)
}
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
func (m *GenesisState) GetParams() Params {
if m != nil {
return m.Params
}
return Params{}
}
func (m *GenesisState) GetBlockGas() uint64 {
if m != nil {
return m.BlockGas
}
return 0
}
func init() {
proto.RegisterType((*GenesisState)(nil), "ethermint.feemarket.v1.GenesisState")
}
func init() {
proto.RegisterFile("ethermint/feemarket/v1/genesis.proto", fileDescriptor_6241c21661288629)
}
var fileDescriptor_6241c21661288629 = []byte{
// 286 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x31, 0x4b, 0xc3, 0x40,
0x14, 0xc7, 0x73, 0x5a, 0x6a, 0x1b, 0x9d, 0x82, 0x48, 0xa9, 0x70, 0x0d, 0x22, 0x25, 0x8b, 0x77,
0x54, 0x57, 0xa7, 0x0c, 0xd6, 0x6e, 0x12, 0x37, 0x97, 0x72, 0x89, 0xaf, 0x49, 0x88, 0xc9, 0x85,
0x7b, 0x67, 0xd1, 0x6f, 0xe1, 0x87, 0xf1, 0x43, 0x74, 0xec, 0x28, 0x0e, 0x45, 0x92, 0x2f, 0x22,
0xb9, 0x96, 0xb6, 0x83, 0x4e, 0x77, 0xbc, 0xf7, 0xfb, 0xbf, 0x1f, 0xfc, 0xed, 0x4b, 0xd0, 0x09,
0xa8, 0x3c, 0x2d, 0x34, 0x9f, 0x01, 0xe4, 0x42, 0x65, 0xa0, 0xf9, 0x7c, 0xc4, 0x63, 0x28, 0x00,
0x53, 0x64, 0xa5, 0x92, 0x5a, 0x3a, 0x67,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
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.BlockGas != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.BlockGas))
i--
dAtA[i] = 0x18
}
{
size := m.BaseFee.Size()
i -= size
if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
{
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
offset -= sovGenesis(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GenesisState) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = m.Params.Size()
n += 1 + l + sovGenesis(uint64(l))
l = m.BaseFee.Size()
n += 1 + l + sovGenesis(uint64(l))
if m.BlockGas != 0 {
n += 1 + sovGenesis(uint64(m.BlockGas))
}
return n
}
func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGenesis(x uint64) (n int) {
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GenesisState) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BlockGas", wireType)
}
m.BlockGas = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.BlockGas |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGenesis(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGenesis
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGenesis
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGenesis
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)

25
x/feemarket/types/keys.go Normal file
View File

@ -0,0 +1,25 @@
package types
const (
// ModuleName string name of module
ModuleName = "feemarket"
// StoreKey key for base fee and block gas used.
// The Fee Market module should use a prefix store.
StoreKey = ModuleName
// RouterKey uses module name for routing
RouterKey = ModuleName
)
// prefix bytes for the EVM persistent store
const (
prefixBlockGasUsed = iota + 1
prefixBaseFee
)
// KVStore key prefixes
var (
KeyPrefixBlockGasUsed = []byte{prefixBlockGasUsed}
KeyPrefixBaseFee = []byte{prefixBaseFee}
)

136
x/feemarket/types/params.go Normal file
View File

@ -0,0 +1,136 @@
package types
import (
"fmt"
"math"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)
const (
DefaultBaseFeeChangeDenominator = 8
DefaultElasticityMultiplier = 2
DefaultInitialBaseFee = 1000000000
)
var _ paramtypes.ParamSet = &Params{}
// Parameter keys
var (
ParamStoreKeyNoBaseFee = []byte("NoBaseFee")
ParamStoreKeyBaseFeeChangeDenominator = []byte("BaseFeeChangeDenominator")
ParamStoreKeyElasticityMultiplier = []byte("ElasticityMultiplier")
ParamStoreKeyInitialBaseFee = []byte("InitialBaseFee")
ParamStoreKeyEnableHeight = []byte("EnableHeight")
)
// ParamKeyTable returns the parameter key table.
func ParamKeyTable() paramtypes.KeyTable {
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
}
// NewParams creates a new Params instance
func NewParams(noBaseFee bool, baseFeeChangeDenom, elasticityMultiplier uint32, initialBaseFee, enableHeight int64) Params {
return Params{
NoBaseFee: noBaseFee,
BaseFeeChangeDenominator: baseFeeChangeDenom,
ElasticityMultiplier: elasticityMultiplier,
InitialBaseFee: initialBaseFee,
EnableHeight: enableHeight,
}
}
// DefaultParams returns default evm parameters
func DefaultParams() Params {
// TODO: use geth parameters
return Params{
NoBaseFee: true,
BaseFeeChangeDenominator: DefaultBaseFeeChangeDenominator,
ElasticityMultiplier: DefaultElasticityMultiplier,
InitialBaseFee: DefaultInitialBaseFee,
EnableHeight: math.MaxInt64,
}
}
// ParamSetPairs returns the parameter set pairs.
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
return paramtypes.ParamSetPairs{
paramtypes.NewParamSetPair(ParamStoreKeyNoBaseFee, &p.NoBaseFee, validateBool),
paramtypes.NewParamSetPair(ParamStoreKeyBaseFeeChangeDenominator, &p.BaseFeeChangeDenominator, validateBaseFeeChangeDenominator),
paramtypes.NewParamSetPair(ParamStoreKeyElasticityMultiplier, &p.ElasticityMultiplier, validateElasticityMultiplier),
paramtypes.NewParamSetPair(ParamStoreKeyInitialBaseFee, &p.InitialBaseFee, validateInitialBaseFee),
paramtypes.NewParamSetPair(ParamStoreKeyEnableHeight, &p.EnableHeight, validateEnableHeight),
}
}
// Validate performs basic validation on fee market parameters.
func (p Params) Validate() error {
if p.BaseFeeChangeDenominator == 0 {
return fmt.Errorf("base fee change denominator cannot be 0")
}
if p.InitialBaseFee < 0 {
return fmt.Errorf("initial base fee cannot be negative: %d", p.InitialBaseFee)
}
if p.EnableHeight < 0 {
return fmt.Errorf("enable height cannot be negative: %d", p.EnableHeight)
}
return nil
}
func validateBool(i interface{}) error {
_, ok := i.(bool)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
return nil
}
func validateBaseFeeChangeDenominator(i interface{}) error {
value, ok := i.(uint32)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if value == 0 {
return fmt.Errorf("base fee change denominator cannot be 0")
}
return nil
}
func validateElasticityMultiplier(i interface{}) error {
_, ok := i.(uint32)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
return nil
}
func validateInitialBaseFee(i interface{}) error {
value, ok := i.(int64)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if value < 0 {
return fmt.Errorf("initial base fee cannot be negative: %d", value)
}
return nil
}
func validateEnableHeight(i interface{}) error {
value, ok := i.(int64)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if value < 0 {
return fmt.Errorf("enable height cannot be negative: %d", value)
}
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,272 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: ethermint/feemarket/v1/query.proto
/*
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package types
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryParamsRequest
var metadata runtime.ServerMetadata
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryParamsRequest
var metadata runtime.ServerMetadata
msg, err := server.Params(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_BaseFee_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBaseFeeRequest
var metadata runtime.ServerMetadata
msg, err := client.BaseFee(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_BaseFee_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBaseFeeRequest
var metadata runtime.ServerMetadata
msg, err := server.BaseFee(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_BlockGas_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBlockGasRequest
var metadata runtime.ServerMetadata
msg, err := client.BlockGas(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_BlockGas_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryBlockGasRequest
var metadata runtime.ServerMetadata
msg, err := server.BlockGas(ctx, &protoReq)
return msg, metadata, err
}
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_BaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_BaseFee_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_BlockGas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_BlockGas_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BlockGas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterQueryHandler(ctx, mux, conn)
}
// RegisterQueryHandler registers the http handlers for service Query to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn))
}
// RegisterQueryHandlerClient registers the http handlers for service Query
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_BaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_BaseFee_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_BlockGas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_BlockGas_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BlockGas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"feemarket", "evm", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BaseFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"feemarket", "evm", "v1", "base_fee"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BlockGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"feemarket", "evm", "v1", "block_gas"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
forward_Query_Params_0 = runtime.ForwardResponseMessage
forward_Query_BaseFee_0 = runtime.ForwardResponseMessage
forward_Query_BlockGas_0 = runtime.ForwardResponseMessage
)