Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The code does not check the range of max-tx-bytes in the config file, leading to a runtime panic. #2007

Closed
sdjasj opened this issue Dec 29, 2024 · 0 comments
Labels
bug Something isn't working linear Created by Linear-GitHub Sync

Comments

@sdjasj
Copy link

sdjasj commented Dec 29, 2024

Seid version
name: sei
server_name:
version: v4.1.7-evm-devnet
commit: 6e0c934
build_tags: netgo ledger,
go: go version go1.22.4 linux/amd64
build_deps:

  • cosmossdk.io/errors@v1.0.0
  • filippo.io/edwards25519@v1.0.0-rc.1
  • github.com/99designs/keyring@v1.2.1

Chain ID
Local 4-docker-node chain

Describe the bug
Changing the value of the max-tx-bytes configuration option under [mempool] in the config.toml file to -2 will trigger a panic: runtime error: makeslice: len out of range. After reviewing the source code of SEI, it was found that the issue arises because there is no check for the value of max-tx-bytes, and it directly performs make([]byte, cfg.MaxTxBytes).

To Reproduce
Steps to reproduce the behavior:

  1. Change the value of the max-tx-bytes configuration option under [mempool] in the config.toml file to -2
  2. Restart the node
  3. panic: runtime error: makeslice: len out of range occurs

Expected behavior
SEI should properly handle the case where the max-tx-bytes value is negative and provide a user-friendly message, instead of triggering a panic directly.

Additional context
Here is the panic log.
seid-3.log

Here is the config file

proxy-app = "tcp://127.0.0.1:26658"
moniker = "sei-node-0"
mode = "validator"
db-backend = "goleveldb"
db-dir = "data"
log-level = "info"
log-format = "plain"
genesis-file = "config/genesis.json"
node-key-file = "config/node_key.json"
abci = "socket"
filter-peers = false

[priv-validator]
key-file = "config/priv_validator_key.json"
state-file = "data/priv_validator_state.json"
laddr = ""
client-certificate-file = ""
client-key-file = ""
root-ca-file = ""

[rpc]
laddr = "tcp://0.0.0.0:26657"
cors-allowed-origins = []
cors-allowed-methods = [ "HEAD", "GET", "POST",]
cors-allowed-headers = [ "Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time",]
unsafe = false
max-open-connections = 900
max-subscription-clients = 100
max-subscriptions-per-client = 5
experimental-disable-websocket = false
event-log-window-size = "30s"
event-log-max-items = 0
timeout-broadcast-tx-commit = "10s"
max-body-bytes = 1000000
max-header-bytes = 1048576
tls-cert-file = ""
tls-key-file = ""
pprof-laddr = "localhost:6060"

[p2p]
queue-type = "priority"
laddr = "tcp://0.0.0.0:26656"
external-address = ""
bootstrap-peers = ""
persistent-peers = "bc6492eb3874b3ba9de6f31c69debafc16712751@192.168.10.10:26656,0410b4c2854451c3570413fa85ee50a074b9d807@192.168.10.12:26656,8b3fdd73de6cd9a0b05863a9946101f6a77e4ce4@192.168.10.11:26656"
upnp = false
max-connections = 200
max-incoming-connection-attempts = 100
pex = true
private-peer-ids = ""
allow-duplicate-ip = false
handshake-timeout = "20s"
dial-timeout = "3s"
flush-throttle-timeout = "10ms"
max-packet-msg-payload-size = 102400
send-rate = 204800000

[mempool]
broadcast = true
size = 5000
cache-size = 50000
keep-invalid-txs-in-cache = false
max-tx-bytes = -2
max-batch-bytes = 0
ttl-duration = "0s"

[statesync]
enable = false
rpc-servers = ""
trust-height = 0
trust-hash = ""
trust-period = "168h0m0s"
discovery-time = "15s"
chunk-request-timeout = "15s"
fetchers = "4"

[consensus]
wal-file = "data/cs.wal/wal"
unsafe-propose-timeout-override = "3s"
unsafe-propose-timeout-delta-override = "500ms"
unsafe-vote-timeout-override = "50ms"
unsafe-vote-timeout-delta-override = "500ms"
unsafe-commit-timeout-override = "50ms"
double-sign-check-height = 0
unsafe-bypass-commit-timeout-override = false
create-empty-blocks = true
create-empty-blocks-interval = "0s"
peer-gossip-sleep-duration = "50ms"
peer-query-maj23-sleep-duration = "2s"
gossip-tx-key-only = true

[tx-index]
indexer = [ "kv",]
psql-conn = ""

[instrumentation]
prometheus-listen-addr = ":26660"
max-open-connections = 3
namespace = "tendermint"

@sdjasj sdjasj added bug Something isn't working linear Created by Linear-GitHub Sync labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linear Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

2 participants