cosmos-sdk/tests/e2e
Facundo Medica 6a03586074
fix: remove previous header in Prepare/Process Proposal + provide chain id in baseapp + fix context for verifying txs (#15303)
## Description

### Issue
Some values (like chain ID) were being leaked from the previous block/initialization into PrepareProposal and ProcessProposal, these values are only available if:
1. The node has never been stopped since the genesis block (as these values are set on `InitChain`)
2. The node has already commited a block (as the previous header was being used for the new state of prepare and process proposal).

So if a node is restarted, during the first prepare and process proposal these values won't be populated, and that will cause issues if they are being used.

### Solution

Remove any previous header information from a previous block in the prepare and process proposal contexts, making things consistent at every height.

- Added ChainID to baseapp
- Use an empty header in Commit() with only the chain id set
- Fix context for prepare and process proposal

Closes: #15269



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2023-03-13 17:15:39 +00:00
..
auth refactor: Refactor TxSearch (#14758) 2023-02-24 16:08:53 +00:00
authz test: fix more flaky tests (#14699) 2023-01-20 00:06:01 +01:00
bank test: rename e2e tests (#13913) 2022-12-15 10:55:01 +01:00
client/grpc/cmtservice fix: Change proposer address cast for sdk_block conversion (#15243) 2023-03-02 17:08:13 +01:00
crisis refactor: migrate e2e/crisis away from testify suite (#14545) 2023-01-09 20:01:47 +00:00
distribution test: fix flaky tests + new method RetryForBlocks (#14609) 2023-01-17 15:58:29 +00:00
evidence refactor: make x/evidence a standalone module (#14724) 2023-01-24 10:01:26 +01:00
feegrant refactor: x/feegrant to stand alone (#14649) 2023-01-25 16:39:54 +00:00
gov refactor: add burnable params to governance (#15151) 2023-02-28 20:44:46 +00:00
group fix: x/group pagination from CLI (#14923) 2023-02-06 13:56:00 +00:00
mint test: rename e2e tests (#13913) 2022-12-15 10:55:01 +01:00
nft refactor: rename nft to cosmosssdk.io/x/nft (#14725) 2023-01-23 11:48:34 +00:00
params fix: remove previous header in Prepare/Process Proposal + provide chain id in baseapp + fix context for verifying txs (#15303) 2023-03-13 17:15:39 +00:00
server refactor(log): associate test logger with testing.T instance (#15261) 2023-03-03 20:26:45 +00:00
slashing test: rename e2e tests (#13913) 2022-12-15 10:55:01 +01:00
staking feat: create-validator now takes a json file as arg (#14864) 2023-02-22 05:43:13 +00:00
tx test: use pointer receivers to avoid lock copies (#15217) 2023-02-28 18:27:57 +00:00
upgrade refactor: rename to CometBFT (#14914) 2023-02-06 18:11:14 +00:00