delegation-framework icon indicating copy to clipboard operation
delegation-framework copied to clipboard

Rehash delegationHash inside logic or enforcer to prevent collisions

Open hanzel98 opened this issue 8 months ago • 0 comments

What?

  • Implemented a rehashing of the delegationHash inside the enforcers in the LogicalOrWrapper enforcer.

Why?

  • Previously the LogicalOr enforcer allowed to have duplicate enforcers inside that shared the delegationHash as a key to control the state changes. This generated a collision in the state when using these enforcers inside the LogicalOr.

How?

  • The idea is to prevent state collisions when the delegation hash is the only key, so this PR hashes the delegationHash of the LogicalOr delegation together with the selected caveat group index. Inside the logicalOr there are groups and the user selects which group to use by choosing its index. This index makes each group produce a new delegationHash that is passed to the enforcers. Now it is possible to combine enforcers of the same type without those mapping collisions.

hanzel98 avatar May 20 '25 18:05 hanzel98