fix: rollback to tendermint v0.34.21 #38

Merged
0xmuralik merged 33 commits from murali/tendermint-rollback into main 2022-10-19 05:31:14 +00:00
0xmuralik commented 2022-09-30 06:45:17 +00:00 (Migrated from github.com)

Closes: #37

Description

Rollback to tendermint by taking https://github.com/evmos/ethermint as reference


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
Closes: #37 ## Description Rollback to tendermint by taking https://github.com/evmos/ethermint as reference ______ For contributor use: - [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer ______ For admin use: - [ ] Added appropriate labels to PR (ex. `WIP`, `R4R`, `docs`, etc) - [ ] Reviewers assigned - [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" ([coding standards](https://github.com/tendermint/coding/blob/master/README.md#merging-a-pr))
roysc reviewed 2022-09-30 06:45:17 +00:00
ashwinphatak (Migrated from github.com) reviewed 2022-09-30 06:45:17 +00:00
i-norden reviewed 2022-10-04 12:34:22 +00:00
i-norden left a comment
Member

LGTM on first pass but some of the tests are failing which weren't before. Need to take a closer look: tests need to be fixed, or need to convinced it is not an issue.

LGTM on first pass but some of the tests are failing which weren't before. Need to take a closer look: tests need to be fixed, or need to convinced it is not an issue.
@ -205,4 +211,3 @@
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace (
Member

Let's remove these commented out replaces

Let's remove these commented out replaces
@ -40,35 +42,36 @@ func startInProcess(cfg Config, val *Validator) error {
return err
}
Member

Let's remove these commented out lines

Let's remove these commented out lines
Member

Hi @0xmuralik, what is the status on this? Can you please get the remaining tests passing on this so that we can merge, thanks!

Hi @0xmuralik, what is the status on this? Can you please get the remaining tests passing on this so that we can merge, thanks!
github-code-scanning[bot] (Migrated from github.com) reviewed 2022-10-12 11:59:12 +00:00
@ -0,0 +384,4 @@
msg,
common.BytesToHash(block.Block.Hash()),
uint64(block.Block.Height),
uint64(idx),
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 11:59:12 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/317)
@ -0,0 +151,4 @@
b.logger.Debug("failed to decode transaction in block", "height", blockHeight, "error", err.Error())
continue
}
txGasUsed := uint64(eachTendermintTxResult.GasUsed)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 11:59:12 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/316)
@ -0,0 +178,4 @@
sumGasUsed := sorter[0].gasUsed
for i, p := range rewardPercentiles {
thresholdGasUsed := uint64(blockGasUsed * p / 100)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 11:59:12 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/315)
github-code-scanning[bot] (Migrated from github.com) reviewed 2022-10-12 12:05:24 +00:00
@ -0,0 +383,4 @@
return rpctypes.NewTransactionFromMsg(
msg,
common.BytesToHash(block.Block.Hash()),
uint64(block.Block.Height),
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 12:05:24 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/318)
github-code-scanning[bot] (Migrated from github.com) reviewed 2022-10-12 12:05:31 +00:00
@ -0,0 +364,4 @@
return nil, nil
}
} else {
i := int(idx)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 12:05:30 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/319)
github-code-scanning[bot] (Migrated from github.com) reviewed 2022-10-12 12:05:37 +00:00
@ -0,0 +348,4 @@
var msg *evmtypes.MsgEthereumTx
// find in tx indexer
res, err := b.GetTxByTxIndex(block.Block.Height, uint(idx))
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-12 12:05:37 +00:00

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion

Show more details

## Potential integer overflow by integer type conversion Potential integer overflow by integer type conversion [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/320)
i-norden reviewed 2022-10-14 00:02:42 +00:00
i-norden left a comment
Member

Hey @0xmuralik, looks good, but it's not really feasible for me to review a change set this large line-by-line. So I think what would help the most is if you can get the remaining github actions passing or provide an explanation for why it is okay for them not to be passing (in which case we eventually need to adjust the actions or tests so that they do all pass). Thanks!

Hey @0xmuralik, looks good, but it's not really feasible for me to review a change set this large line-by-line. So I think what would help the most is if you can get the remaining github actions passing or provide an explanation for why it is okay for them not to be passing (in which case we eventually need to adjust the actions or tests so that they do all pass). Thanks!
0xmuralik commented 2022-10-14 07:09:26 +00:00 (Migrated from github.com)

Hey @i-norden, Most of the failing tests from gosec and lint are false postives and very few need to be addressed. We can add comments to ignore these errors. I suggesting addressing these in a different PR.
And the protobuf breaking test is just to mention the changes in proto files; nothing to worry about.

Hey @i-norden, Most of the failing tests from gosec and lint are false postives and very few need to be addressed. We can add comments to ignore these errors. I suggesting addressing these in a different PR. And the protobuf breaking test is just to mention the changes in proto files; nothing to worry about.
Member

@0xmuralik are the failing test-soliditys an artifact of the CI? 1-3 is passing but 2-3, and 3-3 are not.

@0xmuralik are the failing `test-solidity`s an artifact of the CI? 1-3 is passing but 2-3, and 3-3 are not.
0xmuralik commented 2022-10-17 05:43:59 +00:00 (Migrated from github.com)

@0xmuralik are the failing test-soliditys an artifact of the CI? 1-3 is passing but 2-3, and 3-3 are not.

RangeError: Maximum call stack size exceeded same error appears on laconicd main and ethermint main. These were failing before too. May be there is a limit on compiled contracts we an use in a test or something like that. Nothing to worry afaik.

> @0xmuralik are the failing `test-solidity`s an artifact of the CI? 1-3 is passing but 2-3, and 3-3 are not. `RangeError: Maximum call stack size exceeded` same error appears on laconicd main and ethermint main. These were failing before too. May be there is a limit on compiled contracts we an use in a test or something like that. Nothing to worry afaik.
github-code-scanning[bot] (Migrated from github.com) reviewed 2022-10-18 10:51:13 +00:00
@ -0,0 +120,4 @@
for i := 0; i < n; i++ {
// don't need that much entropy for simulation
privkeySeed := make([]byte, 15)
_, _ = r.Read(privkeySeed)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:13 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/371)
@ -0,0 +124,4 @@
prv := secp256k1.GenPrivKeyFromSecret(privkeySeed)
ethPrv := &ethsecp256k1.PrivKey{}
_ = ethPrv.UnmarshalAmino(prv.Bytes()) // UnmarshalAmino simply copies the bytes and assigns them to ethPrv.Key
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:12 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/370)
@ -0,0 +228,4 @@
if args.Nonce == nil {
// get the nonce from the account retriever
// ignore error in case tge account doesn't exist yet
nonce, _ := b.getAccountNonce(*args.From, true, 0, b.logger)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:12 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/368)
@ -0,0 +89,4 @@
// CurrentHeader returns the latest block header
func (b *Backend) CurrentHeader() *ethtypes.Header {
header, _ := b.HeaderByNumber(rpctypes.EthLatestBlockNumber)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:12 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/367)
@ -0,0 +134,4 @@
return nil, err
}
address, _ := sdk.AccAddressFromBech32(res.AccountAddress)
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:12 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/366)
@ -0,0 +198,4 @@
}
// ignore error as we only care about the length of the list
list, _ := b.clientCtx.Keyring.List()
github-code-scanning[bot] (Migrated from github.com) commented 2022-10-18 10:51:12 +00:00

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.

Show more details

## Returned error is not propagated up the stack. Returned error is not propagated up the stack. [Show more details](https://github.com/cerc-io/laconicd/security/code-scanning/365)
i-norden approved these changes 2022-10-18 12:22:36 +00:00
i-norden left a comment
Member

LGTM

LGTM
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconicd-deprecated#38
No description provided.