Replies: 2 comments 2 replies
-
In the long term, I think we'll need to change Core Marlowe so that is supports relative events and time arithmetic. The approach "3. Attached generative expression" would probably be most compatible with that future change. I'm unsure about using units like days, months, and years since these might be problematic due the the quirks of calendars, leap seconds, etc. |
Beta Was this translation helpful? Give feedback.
-
There might be another alternative for |
Beta Was this translation helpful? Give feedback.
-
This discussion studies the best way to extend Extended Marlowe so that it supports constraints for templates. That is, ways of specifying which ways of filling templates are valid, and which are not. E.g: timeouts in the outer
When
s should be before those in innerWhen
s.Potential solutions for
TimeParam
When we say
attached
we mean that this approach can be done as an "attachment" to the contract, without modifying theContract
type or any of the dependencies.embedded
means it requires changing theContract
type.1. Attached partial ordering version
timeout1 ≤ timeout2
1.2. Variant, also support constants:
c ≤ timeout2
2. Attached partial ordering plus margins
timeout1 + c ≤ timeout2
c
would be a positive constant time difference in milliseconds, variants:2.1. Support multipliers like “days”
2.2. Support advanced primitives like “next weekend”
1.3. and 2.3. Supporting cycles in the ordering (and negative values in c in the second approach) would allow effectively to express equality:
timeout1 ≤ timeout2
&&timeout2 ≤ timeout1
⇒timeout1 = timeout1
3. Attached generative version
derivedParameter := TimeExpression
TimeExpression
could be defined something like this:4. Embedded generative version
Timeout
withTimeExpression
5. Attached generic declarative version
6. Attached boolean expressions (potentially on top of equations)
Potential solutions for
ConstantParam
When we say
attached
we mean that this approach can be done as an "attachment" to the contract, without modifying theContract
type or any of the dependencies.embedded
means it requires changing theContract
type.1. Attached optional min and max:
[(String, Maybe Integer, Maybe Integer)]
,String
would be the name of theConstantParam
2. Attached
Choice
-like mechanism:[(String, [(Maybe Integer, Maybe Integer)])]
,String
would be the name of theConstantParam
3. Attached enum plus
Choice
-like mechanism4. Attached boolean expressions
5. Add embedded offline computation operators to extended Marlowe (in addition to previous constraint mechanisms)
These would be analogous to
Value
andObservation
but they would only use values that can be determined before execution (like constants and constant parameters), and they would be simplified before deployment, thus reducing contract size.Beta Was this translation helpful? Give feedback.
All reactions