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

WIP [base-node] Exit if unable to validate RandomX headers due to memory issues #3103

Closed
wants to merge 3 commits into from

Conversation

delta1
Copy link
Contributor

@delta1 delta1 commented Jul 18, 2021

Description

  • attempting to fallback to default flags for randomx dataset and vm creation
  • return errors on randomx creation failures
  • don't ban sync peers on randomx creation error since it's a local issue
  • base node state machine shuts down
  • improved logging for randomx creation and errors
  • WIP get whole base node to shut down

Motivation and Context

When attempting to run the base node and sync headers with less than 2080MiB of RAM, creation of the RandomX dataset fails and it's not possible to validate the block headers. Node is then stuck in a sync loop.

How Has This Been Tested?

Running base node in a VM with 1GB RAM

Sample Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"
  config.vm.synced_folder ".", "/home/vagrant/base_node", :mount_options => ["dmode=777", "fmode=777"]

  config.vm.provider "virtualbox" do |vb|
    vb.cpus = 2
    vb.memory = "1024"
  end
end

Checklist:

  • I'm merging against the development branch.
  • I have squashed my commits into a single commit.

@StriderDM
Copy link
Contributor

Fixed here:
#3301

@aviator-app aviator-app bot closed this in #3301 Sep 6, 2021
aviator-app bot pushed a commit that referenced this pull request Sep 6, 2021
Description
Removed dataset from RandomXVMInstance, light mode only requires a cache, this fixes a bug where light mode will consume more than 256MB of memory per RandomXVMInstance.

Made RandomXDataset optional for RandomXVMInstance.

resolves #3104 
closes #3103 

Motivation and Context
Overall memory overhead reduction

How Has This Been Tested?
Manually in a constrained vagrant instance

<img width="1048" alt="Screen Shot 2021-09-04 at 12 45 40 AM" src="https://user-images.githubusercontent.com/51991544/132176934-6a5a3753-4960-472c-8544-edebd6eec40d.png">
Cifko pushed a commit to Cifko/tari that referenced this pull request Sep 10, 2021
Description
Removed dataset from RandomXVMInstance, light mode only requires a cache, this fixes a bug where light mode will consume more than 256MB of memory per RandomXVMInstance.

Made RandomXDataset optional for RandomXVMInstance.

resolves tari-project#3104 
closes tari-project#3103 

Motivation and Context
Overall memory overhead reduction

How Has This Been Tested?
Manually in a constrained vagrant instance

<img width="1048" alt="Screen Shot 2021-09-04 at 12 45 40 AM" src="https://user-images.githubusercontent.com/51991544/132176934-6a5a3753-4960-472c-8544-edebd6eec40d.png">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants