Do the miners control the network or the nodes?
Every solo miner and every mining pool IS ALSO A NODE.
Miners that perticipate in a pool can choose which pool they want to mine in and can refuse to mine in a pool that supports changes that they don't agree with.
I always thought the nodes controlled the network. The nodes decide which transactions enter the pool,
The pool?
What pool is that?
Every node (including solo miners and mining pools) has ITS OWN POOL. A node only decides which transactions it accepts into its own pool, it have no control over the pool that any other node is running. A node CAN refuse to relay a transaction to the nodes it is connected to, but that won't prevent those nodes from hearing about the transaction from another node that isn't refusing to relay it.
and in fact I thought that the nodes decide whether blocks are valid as well,
Again, solo miners and pools ARE nodes, so they get to decide for themselves which blocks they think are valid and which blocks they want to include in their own blockchains. Every node maintains ITS OWN blockchain and if it decides a block is valid it includes the block in its own blockchain. A node CAN refuse to relay a block to the nodes it is connected to if it feels that block is invalid, but that won't prevent those nodes from hearing about the block from another node that isn't refusing to relay it.
so even if the miners do something crazy isn't it the nodes that are the ultimate deciders?
If an overwhelming majority of all nodes (users, wallets, exchanges, block explorers, miners, merchants, etc) ALL refuse to accept something, then it can be blocked (since there won't be enough remaining nodes or hashpower to effectively relay the information, and there won't be any economic activity aware of the information). If a significant minority refuse to participate with the rest of the nodes, then a split can occur.
I thought that the miners are relatively irrelevant compared to the nodes because even if a miner has 1000x the hashing power of everybody else, if the nodes blackball the blocks from that miner then the miner will be ignored, so all their hashing power is useless.
If a miner (or pool) refuses to put anything in their block that identifies them, then it is impossible for nodes to know who mined the block. If that miner with 1000x the hash power of the rest of the world is creating blocks that follow the same rules and everyone else, how would they know which blocks to "blackball"?
Even if you compute a block first, if the nodes reject your block then you control nothing, at least that is what I thought. No?
If ALL of the nodes reject your block? Sure, you've got nothing. The devil's in the details, and you haven't explained anything about the sort of attack you're trying to understand. Explaining where the issues are is not going to be possible without a better understanding of what your concern is.