Sending funds on same block of received funds. Confirm sending not received? My question in quite conceptual:

For creating a raw transaction, I just need the txid from the older transaction and the address to send it. Put the funds, the change, what's left is the fee. Sign it and broadcast it.

Let's say Alice sends to Bob's disposable address some funds. Bob has a "master address". Whatever funds he gets on the disposables addressess he sends to his master one. Bob runs a full node and get the transaction before it gets confirmed on the blockchain.

When Bob receives the broadcasted Alice transaction, Bob gets the raw transaction sent to his disposable address, get the txid, put the funds, put the address of his "master" address, change, fee, sign it and broadcast a new transaction, getting the funds sent from Alice to his master address.

So, now, Alice sends to BobDisp (Bob's disposable address) that sends to Bob. All those transactions have 0 confirmations and are both valid.

For the point of the argument. Alice sent the transaction with 0 (ZERO) fee. Bob signed his transaction with a 'standard' fee (let's say 0.0003 BTC), which has a high priority.

When miners get the transactions to mine, do they know that both have to be on the same block? Or what happens if the block is mined with only 'BobD -> Bob' transaction (without the Alice -> BobD)? Is the block invalid? 

The miners won't rescan the whole blockchain to know that the 'BobD -> Bob' uses the funds of a new transaction, right? The Alice transaction could be 50000 blocks old or, in this case, a new one. 

PS: not sure if it is clear. thanks
They don't have to be on the same block, but as they do depend on each other the BobD->Bob transaction can only be mined if Alice->BobD is already in the same or an earlier block. If not, the entire block would be invalid and noone would accept it.

Note that smart miners would add up the fees for both transactions and on the basis of that decide whether to include it in a block or not. So Alice->BobD might have 0 fee and therefore not be interesting for miners, but if BobD->Bob pays enough fee to compensate for it, a miner might include both transactions in the same block. This is known as Child Pays For Parent or CPFP. I don't think it's very common yet for miners to have this implemented at the moment. Are there any pools or large miners running &quot;child pays for parent&quot; patch?