Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaced keysets #32

Merged
merged 30 commits into from
Dec 1, 2023
Merged

Namespaced keysets #32

merged 30 commits into from
Dec 1, 2023

Conversation

0xd34df00d
Copy link
Contributor

@0xd34df00d 0xd34df00d commented Nov 30, 2023


@@ -102,7 +102,7 @@ evalModuleGovernance interp tl = do
lookupModule (Lisp._mInfo m) pdb mname >>= \case
Just targetModule -> do
term <- case _mGovernance targetModule of
KeyGov (KeySetName ksn) -> do
KeyGov (KeySetName ksn _mNs) -> do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the namespace should be ignored here, but worth double-checking.

@@ -141,7 +141,8 @@ ReplSpecial :: { SpanInfo -> ReplSpecialForm SpanInfo }
| load STR { ReplLoad (getStr $2) False }

Governance :: { Governance ParsedName }
: StringRaw { KeyGov (KeySetName $1)}
: StringRaw { KeyGov (KeySetName $1 Nothing) }
| StringRaw '.' StringRaw { KeyGov (KeySetName (getStr $2) (Just (NamespaceName $1))) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcardon does this production make sense, and should un-namespaced keysets (the first production, that is) allowed in this context?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we also need to check all of these changes against pact-corpus. I'm not sure how we executed the test in the past. Maybe @jmcardon can comment here?

Copy link
Member

@rsoeldner rsoeldner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me Georg!

pact-core/Pact/Core/Guards.hs Show resolved Hide resolved
pact-core/Pact/Core/IR/Eval/RawBuiltin.hs Show resolved Hide resolved
pact-core/Pact/Core/IR/Eval/RawBuiltin.hs Outdated Show resolved Hide resolved
pact-core/Pact/Core/IR/Eval/RawBuiltin.hs Outdated Show resolved Hide resolved
cond <- enforceKeyset oldKs
if cond then writeKs
else returnCEK cont handler (VError "enforce keyset failure" info)
Nothing | laxNs -> writeKs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment here would be beneficial

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that, but on a second reading I'd rather rename the binding from laxNs (that's indeed not the best name) to, say, ignoreNamespaces, as IMO comments about behavior of such implementation details (like, what the branch is doing) is typically a sign the names could be better chosen. How do you reckon doing that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I'm in favor of ignoreNamespaces 👍

pact-core/Pact/Core/IR/Eval/RawBuiltin.hs Show resolved Hide resolved
@@ -141,7 +141,8 @@ ReplSpecial :: { SpanInfo -> ReplSpecialForm SpanInfo }
| load STR { ReplLoad (getStr $2) False }

Governance :: { Governance ParsedName }
: StringRaw { KeyGov (KeySetName $1)}
: StringRaw { KeyGov (KeySetName $1 Nothing) }
| StringRaw '.' StringRaw { KeyGov (KeySetName (getStr $2) (Just (NamespaceName $1))) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we also need to check all of these changes against pact-corpus. I'm not sure how we executed the test in the past. Maybe @jmcardon can comment here?

@0xd34df00d 0xd34df00d merged commit a9b66b9 into master Dec 1, 2023
3 checks passed
@0xd34df00d 0xd34df00d deleted the gr/ns-ks branch December 1, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants