Skip to content

Commit

Permalink
Merge branch 'main' into rp/ica
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Apr 2, 2024
2 parents 2c48dbc + 90a5d2d commit c893fb4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: make test-coverage

- name: Upload coverage.txt
uses: codecov/[email protected].0
uses: codecov/[email protected].1
with:
file: ./coverage.txt

Expand Down
20 changes: 1 addition & 19 deletions app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr
app.ParamsKeeper,
app.MsgGateKeeper,
)

var txs [][]byte
// This if statement verifies whether the preparation of the proposal
// pertains to the first block. If it does, the block is constructed using
// an empty set of transactions. However, even without this validation,
// the initial block is anticipated to be devoid of transactions, as
// established by the findings presented in
// https://github.com/celestiaorg/celestia-app/issues/1899;
// The inclusion of this check is out of an abundance of caution.
// The rationale behind having an empty first block revolves around the fact
// that no transactions can enter the mempool since no committed state exists
// until after the first block is committed (at which point the Genesis state
// gets committed too). Consequently, the prepare proposal request for the
// first block is expected to contain no transaction, so is the first block.
if app.LastBlockHeight() == 0 {
txs = make([][]byte, 0)
} else {
txs = FilterTxs(app.Logger(), sdkCtx, handler, app.txConfig, req.BlockData.Txs)
}
txs := FilterTxs(app.Logger(), sdkCtx, handler, app.txConfig, req.BlockData.Txs)

// build the square from the set of valid and prioritised transactions.
// The txs returned are the ones used in the square and block
Expand Down
22 changes: 0 additions & 22 deletions app/test/prepare_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,3 @@ func queryAccountInfo(capp *app.App, accs []string, kr keyring.Keyring) []blobfa
}
return infos
}

func TestPrepareProposalZeroTxsInFirstBlock(t *testing.T) {
accounts := testfactory.GenerateAccounts(6)
testApp, _, kr := testutil.NewTestAppWithGenesisSet(app.DefaultConsensusParams(), accounts...)
require.Equal(t, int64(0), testApp.LastBlockHeight())
encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
sendTxs := coretypes.Txs{testutil.SendTxWithManualSequence(
t,
encCfg.TxConfig,
kr,
accounts[0],
accounts[1],
1000,
testutil.ChainID,
1,
1,
)}.ToSliceOfBytes()
resp := testApp.PrepareProposal(abci.RequestPrepareProposal{
BlockData: &tmproto.Data{Txs: sendTxs},
})
require.Len(t, resp.BlockData.Txs, 0)
}
2 changes: 1 addition & 1 deletion pkg/appconsts/initial_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
// DefaultMinGasPrice is the default min gas price that gets set in the app.toml file.
// The min gas price acts as a filter. Transactions below that limit will not pass
// a nodes `CheckTx` and thus not be proposed by that node.
DefaultMinGasPrice = 0.002
DefaultMinGasPrice = 0.002 // utia

// DefaultUnbondingTime is the default time a validator must wait
// to unbond in a proof of stake system. Any validator within this
Expand Down
11 changes: 7 additions & 4 deletions pkg/appconsts/v2/app_consts.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package v2

const (
Version uint64 = 2
SquareSizeUpperBound int = 128
SubtreeRootThreshold int = 64
GlobalMinGasPrice float64 = 0.002 // same as DefaultMinGasPrice
Version uint64 = 2
SquareSizeUpperBound int = 128
SubtreeRootThreshold int = 64
// GlobalMinGasPrice is used by x/minfee to prevent transactions from being
// included in a block if they specify a gas price lower than this
// parameter. GlobalMinGasPrice == DefaultMinGasPrice.
GlobalMinGasPrice float64 = 0.002 // utia
)
2 changes: 1 addition & 1 deletion specs/src/specs/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ are blocked by the `x/paramfilter` module.
| ibc.ConnectionGenesis.MaxExpectedTimePerBlock | 7500000000000 (75 seconds) | Maximum expected time per block in nanoseconds under normal operation. | True |
| ibc.Transfer.ReceiveEnabled | true | Enable receiving tokens via IBC. | True |
| ibc.Transfer.SendEnabled | true | Enable sending tokens via IBC. | True |
| minfee.GlobalMinGasPrice | 0.002 | All transactions must have a gas price greater than or equal to this value. | True |
| minfee.GlobalMinGasPrice | 0.002 utia | All transactions must have a gas price greater than or equal to this value. | True |
| mint.BondDenom | utia | Denomination that is inflated and sent to the distribution module account. | False |
| mint.DisinflationRate | 0.10 (10%) | The rate at which the inflation rate decreases each year. | False |
| mint.InitialInflationRate | 0.08 (8%) | The inflation rate the network starts at. | False |
Expand Down
1 change: 1 addition & 0 deletions test/e2e/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func (n *Node) GenesisValidator() genesis.Validator {
},
ConsensusKey: n.SignerKey,
NetworkKey: n.NetworkKey,
Stake: n.SelfDelegation / 2,
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/blocktime/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`blocktime` is a simple tool to analyze block production rates of a chain. It scrapes the latest headers through the RPC endpoint of a provided node and calculates the average, min, max and standard deviation of the intervals between the last `n` blocks (default: 100).

To read up on starting a node and exposing the RPC endpoint go to the docs [here](https://docs.celestia.org/nodes/consensus-node)
To read up on starting a node and exposing the RPC endpoint go to the docs [here](https://docs.celestia.org/nodes/full-consensus-node)

## Usage

Expand Down

0 comments on commit c893fb4

Please sign in to comment.