virtualeconomy / v-systems

V Systems Reference Full Node
Other
115 stars 45 forks source link

Node crashing #317

Closed peerchemist closed 2 years ago

peerchemist commented 2 years ago

This is a node that has been put online the week of 0.4 fork, running perfectly until a couple of hours ago.

Node has started crashing with this error:

2022-06-26 11:14:50 INFO  [main] vsys.Application$ - Starting...
2022-06-26 11:14:51 INFO  [main] kamon.Kamon$Instance - Initializing Kamon...
2022-06-26 11:14:52 INFO  [lt-dispatcher-2] a.event.slf4j.Slf4jLogger - Slf4jLogger started
2022-06-26 11:14:52 INFO  [main] vsys.Application$ - VSYS Core v0.4.2 Blockchain Id: M
2022-06-26 11:14:52 INFO  [main] v.b.s.BlockchainUpdaterImpl - Constructing BlockchainUpdaterImpl, total blocks: 28081917, persisted: 28078317, topMemDiff: 0, bottomMemDiff: 0
2022-06-26 11:14:52 INFO  [main] v.b.s.BlockchainUpdaterImpl - State rebuild started, total blocks: 28081917, persisted: 28078317, topMemDiff: 0, bottomMemDiff: 0
2022-06-26 11:14:58 INFO  [main] v.b.s.BlockchainUpdaterImpl - State rebuild finished, total blocks: 28081917, persisted: 28078317, topMemDiff: 0, bottomMemDiff: 3600
2022-06-26 11:14:58 ERROR [main] v.actor.RootActorSystem$ - Error while initializing actor system vsys
java.lang.IllegalArgumentException: Unknown version 96387958 [1.4.196/0]
    at org.h2.mvstore.DataUtils.newIllegalArgumentException(DataUtils.java:728)
    at org.h2.mvstore.DataUtils.checkArgument(DataUtils.java:715)
    at org.h2.mvstore.MVStore.rollbackTo(MVStore.java:2282)
    at org.h2.mvstore.MVStore.verifyLastChunks(MVStore.java:758)
    at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:678)
    at org.h2.mvstore.MVStore.<init>(MVStore.java:358)
    at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2930)
    at vsys.utils.package$.createMVStore(package.scala:58)
    at vsys.network.PeerDatabaseImpl.<init>(PeerDatabaseImpl.scala:18)
    at vsys.Application.run(Application.scala:72)
    at vsys.Application$.$anonfun$main$1(Application.scala:254)
    at vsys.Application$.$anonfun$main$1$adapted(Application.scala:244)
    at vsys.actor.RootActorSystem$.start(RootActorSystem.scala:25)
    at vsys.Application$.main(Application.scala:244)
    at vsys.Application.main(Application.scala)

Conf:

# Vsys node settings
vsys {
  # Node base directory
  directory = "/data"
  data-directory = ${vsys.directory}"/data"

  # Application logging level. Could be TRACE | DEBUG | INFO | WARN | ERROR. Default value is INFO.
  logging-level = INFO

  # P2P Network settings
  network {
    # Peers and blacklist storage file
    file = ${vsys.directory}"/data/peers.dat"

    # String with IP address and port to send as external address during handshake. Could be set automatically if UPnP
    # is enabled.
    #
    # If `declared-address` is set, which is the common scenario for nodes running in the cloud, the node will just
    # listen to incoming connections on `bind-address:port` and broadcast its `declared-address` to its peers. UPnP
    # is supposed to be disabled in this scenario.
    #
    # If declared address is not set and UPnP is not enabled, the node will not listen to incoming connections at all.
    #
    # If declared address is not set and UPnP is enabled, the node will attempt to connect to an IGD, retrieve its
    # external IP address and configure the gateway to allow traffic through. If the node succeeds, the IGD's external
    # IP address becomes the node's declared address.
    #
    # In some cases, you may both set `decalred-address` and enable UPnP (e.g. when IGD can't reliably determine its
    # external IP address). In such cases the node will attempt to configure an IGD to pass traffic from external port
    # to `bind-address:port`. Please note, however, that this setup is not recommended.
    # declared-address = "1.2.3.4:9921"

    # Network address
    bind-address = "0.0.0.0"

    # Port number
    port = 9921

    # Node name to send during handshake. Comment this string out to set random node name.
    # node-name = "default-node-name"

    # Node nonce to send during handshake. Should be different if few nodes runs on the same external IP address. Comment this out to set random nonce.
    # nonce = 0

    # List of IP addresses of well known nodes.
    known-peers = [
        "gemmer.vcoin.systems:9921",
        "vnode.vcoin.systems:9921",
        "gemmer.vos.systems:9921",
        "vnode.vos.systems:9921",

        "gemmer.vcoin.systems:9923",
        "vnode.vcoin.systems:9923",
        "gemmer.vos.systems:9923",
        "vnode.vos.systems:9923",
    ]

    # How long the information about peer stays in database after the last communication with it
    peers-data-residence-time = 1d

    # How long peer stays in blacklist after getting in it
    black-list-residence-time = 1m

    # How many network inbound network connections can be made
    max-inbound-connections = 30

    # Number of outbound network connections
    max-outbound-connections = 30

    # Number of connections from single host
    max-single-host-connections = 3

    # Timeout on network communication with other peers
    connection-timeout = 30s

    # Network buffer size
    outbound-buffer-size = 16M

    # Size of circular buffer to store unverified (not properly handshaked) peers
    max-unverified-peers = 100

    # How often connected peers list should be broadcasted
    peers-broadcast-interval = 2m

    # When accepting connection from remote peer, this node will wait for handshake for no longer than this value. If
    # remote peer fails to send handshake within this interval, it gets blacklisted. Likewise, when connecting to a
    # remote peer, this node will wait for handshake response for no longer than this value. If remote peer does not
    # respond in a timely manner, it gets blacklisted.
    handshake-timeout = 20s

    suspension-residence-time = 1m

    upnp {
      # Enable UPnP tunnel creation only if you router/gateway supports it. Useful if your node is runnin in home
      # network. Completely useless if you node is in cloud.
      enable = no

      # UPnP timeouts
      gateway-timeout = 7s
      discover-timeout = 3s
    }
  }

  # Blockchain settings
  blockchain {

    # Min buffer size. Fast rollback is possible up to this value.
    minimum-in-memory-diff-blocks = 3600

    # Blockchain type. Could be TESTNET | MAINNET | CUSTOM. Default value is MAINNET.
    type = MAINNET

    # 'custom' section present only if CUSTOM blockchain type is set. It's impossible to overwrite predefined 'testnet' and 'mainnet' configurations.
    #    custom {
    #      # Address feature character. Used to prevent mixing up addresses from different networks.
    #      address-scheme-character = "C"
    #
    #      # Timestamps/heights of activation/deactivation of different functions.
    #      functionality {
    #        allow-temporary-negative-until = 0
    #        allow-invalid-payment-transactions-by-timestamp = 0
    #        require-sorted-transactions-after = 0
    #        generation-balance-depth-from-50-to-1000-after-height = 0
    #        minimal-generating-balance-after = 0
    #        allow-transactions-from-future-until = 0
    #        require-payment-unique-id-after = 0
    #        allow-leased-balance-transfer-until: 0
    #      }
    #
    #      # List of genesis transactions
    #      genesis {
    #        # Timestamp of genesis block and transactions in it
    #        timestamp = 1460678400000
    #
    #        # Genesis block signature
    #        signature = "BASE58BLOCKSIGNATURE"
    #
    #        # Initial balance in smallest units
    #        initial-balance = 100000000000000
    #
    #        # Initial base target
    #        initial-base-target =153722867
    #
    #        # Average delay between blocks
    #        average-block-delay = 60s
    #
    #        # List of genesis transactions
    #        transactions = [
    #          {recipient = "BASE58ADDRESS1", amount = 50000000000000},
    #          {recipient = "BASE58ADDRESS2", amount = 50000000000000}
    #        ]
    #      }
    #    }

    # State settings
    # !IMPORTANT if you change the settings below in state, rebuilding of state is required, which means you need to clean the data and resync the block at current version
    state {
      # turn on/off the state of transactions grouped by address and transaction type
      tx-type-account-tx-ids = off
    }
  }

  # Transaction fees for different types of transactions
  fees {
    payment {
      VSYS = 10000000
    }
    lease {
      VSYS = 10000000
    }
    lease-cancel {
      VSYS = 10000000
    }
    contend-slots {
      VSYS = 5000000000000
    }
    release-slots {
      VSYS = 10000000
    }
    register-contract {
      VSYS = 10000000000
    }
    execute-contract-function {
      VSYS = 30000000
    }
    db-put {
      VSYS = 100000000
    }
  }

  # New blocks generator settings
  miner {
    # Enable/disable block generation
    enable = no

    # Required number of connections (both incoming and outgoing) to attempt block generation. Setting this value to 0
    # enables "off-line generation".
    quorum = 1

    # Enable block generation only in the last block is not older the given period of time
    interval-after-last-block-then-generation-is-allowed = 1d

    # send the reward to other address
    reward-address = ""
  }

  # Node's REST API settings
  rest-api {
    # Enable/disable REST API
    enable = yes

    # Network address to bind to
    bind-address = "0.0.0.0"

    # Port to listen to REST API requests
    port = 9922

    # Hash of API key string
    api-key-hash = ""

    # Enable/disable CORS support
    cors = yes

    # Enable/disable custom http api routes
    custom-api {
      # Routes with "/transactions"
      transactions {
        address-transaction-count = off
        address-transaction-list = off
      }

      # Routes with "/addresses"'
      addresses {
      }

      # Routes with "/node"
      node {
      }

      # Routes with "/blocks"
      blocks {
      }

      # Routes with "/utils"
      utils {
      }

      # Routes with "/contracts"
      contracts {
      }
    }
  }

  # Nodes synchronization settings
  synchronization {

    # How many blocks could be rolled back if fork is detected. If fork is longer than this rollback is impossible.
    max-rollback = 100

    # I don't know
    max-chain-length = 101

    # Load only entire chain from peer then requested
    load-entire-chain = yes

    # Timeout to receive all requested blocks
    synchronization-timeout = 30s

    # Stick to one peer while receiving requested blocks
    pin-to-initial-peer = yes

    # How many times try to perform synchronization before sending peer to blacklist
    retries-before-blacklisting = 2

    # How many times to retry operations
    operation-retires = 3

    # Broadcast score every...
    score-broadcast-interval = 30s

    # Time to live for broadcasted score
    score-ttl = 90s
  }

  # Unverified transactions pool settings
  utx {
    # Pool size
    max-size = 10000
    # Evict transaction from UTX pool after it gets older than specified
    max-transaction-age = 90m
  }
}

# Performance metrics
kamon {
  # Which modules are enabled. Set to "yes", if you want to enable
  modules {
    # Custom metrics (see Kamon.metrics.* in code)
    kamon-statsd.auto-start = no

    # Memory, CPU, Disk and Network usage information
    kamon-system-metrics.auto-start = no
  }

  # See the reference: https://github.com/kamon-io/kamon-statsd/blob/master/src/main/resources/reference.conf
  statsd {
    # Where we send metrics
    hostname = localhost
    port = 8125

    # Information about the node
    simple-metric-key-generator {
      application = "vsys-node"
      hostname-override = ${?vsys.network.node-name}
    }
  }

  # See the reference: https://github.com/kamon-io/kamon-system-metrics/blob/master/src/main/resources/reference.conf
  system-metrics {}
}

# WARNING: No user-configurable settings below this line.
akka {
  loglevel = "INFO"
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
  log-dead-letters-during-shutdown = false

  actor {
    guardian-supervisor-strategy = "vsys.actor.RootActorSystem$EscalatingStrategy"
    serialization-bindings {
      "java.io.Serializable" = none
    }
  }

  http.server {
    max-connections = 128
    request-timeout = 20s
    parsing {
      max-method-length = 64
      max-content-length = 1m
    }
  }

  io.tcp {
    direct-buffer-size = 1536 KiB
    trace-logging = off
  }
}
peerchemist commented 2 years ago

It seems to have been caused by a corrupted peers.dat file.

Deleting peers.dat and waiting for node to find new peers has resolved the problem,