Dynamic block with dynamic attributes
When you are in the block editor select the attribute that you want to lock and open the properties dialog box. At the bottom in the misc. area you should see a "Lock position" question. The answer should be YES. That will lock the attribute and retain whatever settings you assign to it, aside from any other attributes.
I hope that answers your question.