I thought it would only ignore mempool. If blocksonly=1 ignores chainstate, then I expect a significant increase in speed and even 4 GB RAM should be enough.
I don't understand what you mean with "ignores
chainstate".
chainstate is built during IBD, it's an important task during IBD to build the current UTXO set.
blocksonly=1 lets the node only fetch and relay block data, no transactions. The node doesn't ask to get new transactions and doesn't relay any, because it doesn't have any unconfirmed transactions. When new transactions traffic is ignored the node can't reasonably maintain an own mempool. So, yes it has to ignore entertaining an own mempool, it should only update
chainstate aka the UTXO set while it processes blocks sequentially until reaching chaintip.
Being trustless your node can't blindly believe transactions served to it are valid per se and the transmitting connected other node complies to all rules as if that's a given. On the other hand now that I think about it, how can a node in the process of IBD even try to validate a new transaction's inputs when its UTXO set isn't yet fully built. Now I'm a bit confused...
During IBD, your UTXO set always contains all inputs that existed when the block you're currently verifying was found. So the fact that you don't have a full UTXO set yet is irrelevant at that moment.
What I meant is the following (we assume
blocksonly=0 for a moment):
IBD is at block 800,000, chainstate updated to this point. Every transaction contained in up to block 800,000 can and has been verified (we ignore
assumevalid stuff for a moment). Any UTXO created up to block 800,000 is known to be a valid. But the node can't yet know if any of the UTXOs so far has been spent in a block later.
I struggle to understand why a node in the process of IBD would care about new unconfirmed transactions when it can't verify if the inputs of the new transaction are valid UTXO when our example node has no clue yet what happened in blocks 800,001 until current chaintip.
When a new transaction relayed by some connected node has an input which transaction outpoint is contained in a block less than 800,000 our mighty node knows it's at least valid for this outpoint, but it can't yet know if this transaction outpoint hasn't been spent in some blocks which it hasn't yet seen.
Hm, maybe we're already drifting a bit into off-topic land? I hope not, but I don't want to hijack the thread with my struggles.
I'll need a high-bandwidth high-CPU system with little RAM for this test.
Isn't there a way to tell a Linux kernel to use only a defined amount of RAM? I've foggy memory about this. Another way would be to setup a VM with desired resource restrictions on an otherwise too "large" host.