ive noticed all the other pickup trucks at the scrap yard have walls on them

is it legal to have stuff stacked higher than the walls of your truck without these rack/walls?
even if everything is tied down secured?
what if not everything is tied down but rather locked in?