From a24fc414abbc10e6ee59f878b280d9ecc725e10c Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Tue, 9 Apr 2024 14:28:44 +0300 Subject: [PATCH 01/21] EIP-50 initial draft --- eip-0050.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 eip-0050.md diff --git a/eip-0050.md b/eip-0050.md new file mode 100644 index 00000000..6587705f --- /dev/null +++ b/eip-0050.md @@ -0,0 +1,77 @@ +Sigma 6.0 +========= + +Motivation +---------- + +Currently Sigma's + + +Activation +---------- + +Features Set +------------ + +* *.validatePoW* method of *Header* type to validate Autolykos2 proof of work done on header + +issue: [https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958](https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958) + +* implement conversion from Long-encoded nBits representation to BigInt (long.fromNBits method) and to nBits from BitInt (bigInt.toNBits method) + +issue: [https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675](https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675) + + +* implement Boolean to Byte conversion (boolean.toByte method) + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/931 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 + +* implement BigIntModQ type (unsigned bigints mod Q, where Q is the order of secp256k1 group) + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 + +* Lazy default evaluation for Option.getOrElse + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 + +* finish executeFromVar implementation + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/443 + +* support MethodCall encoding of Numeric methods + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/667 + + +How to add a new method +----------------------- + +Here are instructions on how to add a (as 6.0 is heavily about adding new methods). + +* Find appropriate type (e.g. *SBigInt*) to add a desirable method (e.g. *nbits*) + +* Add method description there and add description handle to *getMethods()* in a class \*Methods corresponding to the type (*SBigIntMethods* in our example), add *method_eval* to be used via reflection in the compiler + +* Add method implementation to corresponding type in *SigmaDsl.scala* + +* Add method evaluation to *ErgoTreeEvaluator* interface and its instantiation *CErgoTreeEvaluator* + +* Add new method to reflection-related descriptions in *ReflectionData* (needed for compiler mostly?) + +* Add pattern matching to the compiler to get support for the new method in ErgoScript, e.g. +``` +case Select(obj, SBigIntMethods.ToNBits.name, _) if obj.tpe == SBigInt && VersionContext.current.isV6SoftForkActivated => +``` + +* Add new method to *SigmaDslUnit.scala* / *SigmaDslImpl.scala* (needed for compiler only) + +* Add compilation test in *TestingInterpreterSpecification* + + + + +How to add a new type +--------------------- + +[TODO: complete] From f7361baa1fe5537a9e77336f6f45d126133ecaf1 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Fri, 12 Apr 2024 14:30:00 +0300 Subject: [PATCH 02/21] implementation and tests for new method --- eip-0050.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eip-0050.md b/eip-0050.md index 6587705f..da6817cd 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -10,6 +10,8 @@ Currently Sigma's Activation ---------- +Rule 1011 should be replaced with another one, likely the same but with other id. + Features Set ------------ @@ -49,6 +51,10 @@ How to add a new method Here are instructions on how to add a (as 6.0 is heavily about adding new methods). +Implementation: + +* Checkout new branch based on "v6.0.0" branch + * Find appropriate type (e.g. *SBigInt*) to add a desirable method (e.g. *nbits*) * Add method description there and add description handle to *getMethods()* in a class \*Methods corresponding to the type (*SBigIntMethods* in our example), add *method_eval* to be used via reflection in the compiler @@ -66,8 +72,13 @@ case Select(obj, SBigIntMethods.ToNBits.name, _) if obj.tpe == SBigInt && Versio * Add new method to *SigmaDslUnit.scala* / *SigmaDslImpl.scala* (needed for compiler only) + +Tests: + + * Add compilation test in *TestingInterpreterSpecification* +* Add roundtrip test in *MethodCallSerializer* From ecb6ff3eac189785eee0e746d77b7bea23061063 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Tue, 16 Apr 2024 00:06:39 +0300 Subject: [PATCH 03/21] more issues added --- eip-0050.md | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index da6817cd..a5e2bd70 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -1,27 +1,27 @@ Sigma 6.0 ========= -Motivation ----------- - -Currently Sigma's +This EIP contains proposed changes for Ergo contractual layer, called Sigma. These changes are based on found issues +in the current version of Sigma, as well as feedback got from users, i.e. Ergo ecosystem developers. Activation ---------- -Rule 1011 should be replaced with another one, likely the same but with other id. +Rule 1011 should be replaced with another one, likely with the same rule but under different id. Features Set ------------ * *.validatePoW* method of *Header* type to validate Autolykos2 proof of work done on header -issue: [https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958](https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958) +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 * implement conversion from Long-encoded nBits representation to BigInt (long.fromNBits method) and to nBits from BitInt (bigInt.toNBits method) -issue: [https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675](https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675) +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675 + +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits encoding) * implement Boolean to Byte conversion (boolean.toByte method) @@ -33,19 +33,40 @@ PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 -* Lazy default evaluation for Option.getOrElse - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 * finish executeFromVar implementation -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/443 +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/443 , https://github.com/ScorexFoundation/sigmastate-interpreter/issues/612 * support MethodCall encoding of Numeric methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/667 +* Add Numeric.toBytes, .toBits + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/486 + +* Fix for downcasting BigInt to Long fails + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 + + +* Lazy default evaluation for Option.getOrElse + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 + +* Implement Some and None as global methods + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 + +* Serialize Option[T] in DataSerializer + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 + + + + How to add a new method ----------------------- @@ -80,6 +101,8 @@ Tests: * Add roundtrip test in *MethodCallSerializer* +* Add evaluation test (see "nbits evaluation" test) + How to add a new type From 698c2700b4319dca563d17e473ca82cb79efaeb0 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Wed, 17 Apr 2024 19:25:43 +0300 Subject: [PATCH 04/21] fixing class names --- eip-0050.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index a5e2bd70..f2b6f3e8 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -82,11 +82,12 @@ Implementation: * Add method implementation to corresponding type in *SigmaDsl.scala* + * Add method evaluation to *ErgoTreeEvaluator* interface and its instantiation *CErgoTreeEvaluator* * Add new method to reflection-related descriptions in *ReflectionData* (needed for compiler mostly?) -* Add pattern matching to the compiler to get support for the new method in ErgoScript, e.g. +* Add pattern matching in GraphBuilding.scala to the compiler to get support for the new method in ErgoScript, e.g. ``` case Select(obj, SBigIntMethods.ToNBits.name, _) if obj.tpe == SBigInt && VersionContext.current.isV6SoftForkActivated => ``` @@ -99,7 +100,7 @@ Tests: * Add compilation test in *TestingInterpreterSpecification* -* Add roundtrip test in *MethodCallSerializer* +* Add roundtrip test in *MethodCallSerializerSpecification* * Add evaluation test (see "nbits evaluation" test) From 9be47ad8164228dceb24d105c7476e167ce4a683 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Wed, 1 May 2024 14:46:05 +0300 Subject: [PATCH 05/21] update with new issues and PRs --- eip-0050.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index f2b6f3e8..3d08458f 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -17,6 +17,9 @@ Features Set issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 +PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/965 (Autolykos verification for a custom message) +PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Header verification) + * implement conversion from Long-encoded nBits representation to BigInt (long.fromNBits method) and to nBits from BitInt (bigInt.toNBits method) issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675 @@ -56,7 +59,7 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 -* Implement Some and None as global methods +* Implement Some and None constructors as global methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 @@ -65,6 +68,11 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 +* Add support for Header (de)serialization + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 + + How to add a new method @@ -106,6 +114,7 @@ Tests: + How to add a new type --------------------- From 278bee5cb4fccae65a474fe6691cc520454e7ece Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Wed, 1 May 2024 14:50:55 +0300 Subject: [PATCH 06/21] minor text polishing --- eip-0050.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 3d08458f..f65e625b 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -24,7 +24,7 @@ PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Head issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675 -PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits encoding) +PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits encoding) * implement Boolean to Byte conversion (boolean.toByte method) @@ -78,7 +78,7 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 How to add a new method ----------------------- -Here are instructions on how to add a (as 6.0 is heavily about adding new methods). +Here are instructions on how to add a new method to existing types (as 6.0 is heavily about adding new methods). Implementation: From 7cbc850173d1ef9326dd9824fd4cb65a20e13a52 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 6 May 2024 13:51:36 +0300 Subject: [PATCH 07/21] updating header related issues and PRs --- eip-0050.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index f65e625b..ad01c2cd 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -68,10 +68,27 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 -* Add support for Header (de)serialization +* Add support for Header values (de)serialization in DataSerializer: issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/972 + + +* Add Header.bytes method to obtain Ergo header bytes + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/974 + +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/975 + +* Add Global.deserializeHeader method to get Ergo header from bytes + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/964 + + +* Add Global.deserializeBox method to get Ergo box from bytes + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/963 From 8685ed9e516d154d7c30a77d2a6d889eee3efd82 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Tue, 14 May 2024 13:52:54 +0300 Subject: [PATCH 08/21] (de)serialization PRs updated --- eip-0050.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index ad01c2cd..2f4c77dc 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -75,21 +75,18 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/972 -* Add Header.bytes method to obtain Ergo header bytes +* GetVar(inputIndex, varId) variant for reading context variable from another input -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/974 +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 -PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/975 +* Implement binary serialization and deserialization for every type -* Add Global.deserializeHeader method to get Ergo header from bytes - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/964 - - -* Add Global.deserializeBox method to get Ergo box from bytes - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/963 +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 +PR #1 (Header.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/975 +PR #2 (AvlTree.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/982 +PR #3 (Global.deserialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 + How to add a new method From df7ad7513ecd881bb6f9d2debc68a9d14f5e247f Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Wed, 22 May 2024 14:27:25 +0300 Subject: [PATCH 09/21] updating issues --- eip-0050.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index 2f4c77dc..7e2afab5 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -85,8 +85,17 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 PR #1 (Header.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/975 PR #2 (AvlTree.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/982 -PR #3 (Global.deserialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 +PR #3 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 + +PR #4 () + +* Fix SubstContants: serialize ErgoTree size +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 + +* GetVar(inputIndex, varId) variant for reading context variable from another input + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 How to add a new method From 7a1caa88c01d6d1da0886da43eec2bf72663a211 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 10 Jun 2024 14:55:11 +0300 Subject: [PATCH 10/21] LangSpec.md, updating serialization PRs --- eip-0050.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 7e2afab5..b81dab63 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -83,11 +83,11 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 -PR #1 (Header.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/975 -PR #2 (AvlTree.bytes): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/982 -PR #3 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 -PR #4 () +PR #1 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 +PR #2 (Global.serialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/989 + +PR #3 (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 * Fix SubstContants: serialize ErgoTree size @@ -136,6 +136,11 @@ Tests: * Add evaluation test (see "nbits evaluation" test) +Documentation: + +* update `LangSpec.md` + + How to add a new type From cdd347c0dde8b8fb90df7e4fc3bd6b8e91c95992 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 10 Jun 2024 18:31:26 +0300 Subject: [PATCH 11/21] updating statuses --- eip-0050.md | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index b81dab63..43c3fd28 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -18,7 +18,13 @@ Features Set issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/965 (Autolykos verification for a custom message) -PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Header verification) + +status: costing missing, unpolished + +PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Header.checkPow) + +status: finished, under review + * implement conversion from Long-encoded nBits representation to BigInt (long.fromNBits method) and to nBits from BitInt (bigInt.toNBits method) @@ -26,30 +32,47 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675 PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits encoding) +status: costing missing, unpolished + +PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits decoding) + +status: costing missing, unpolished + * implement Boolean to Byte conversion (boolean.toByte method) issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/931 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 +status: unfinished + * implement BigIntModQ type (unsigned bigints mod Q, where Q is the order of secp256k1 group) issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/997 -* finish executeFromVar implementation +status: unfinished -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/443 , https://github.com/ScorexFoundation/sigmastate-interpreter/issues/612 * support MethodCall encoding of Numeric methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/667 +PR: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 + +status: finished, under review + * Add Numeric.toBytes, .toBits issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/486 +PR #1: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 + +status: finished, under review + + * Fix for downcasting BigInt to Long fails issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 @@ -59,14 +82,20 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 + * Implement Some and None constructors as global methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 + * Serialize Option[T] in DataSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/990 + +status: finished, merged + * Add support for Header values (de)serialization in DataSerializer: @@ -74,6 +103,8 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/972 +status: finished, under review + * GetVar(inputIndex, varId) variant for reading context variable from another input @@ -85,17 +116,23 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 PR #1 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 + +status: costing missing, unpolished + PR #2 (Global.serialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/989 +status: finished, under review + PR #3 (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 +status: finished, under review + * Fix SubstContants: serialize ErgoTree size issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/995 -* GetVar(inputIndex, varId) variant for reading context variable from another input - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 +status: finished, under review How to add a new method From 63a22ae0d4ebd12a9630d07fadece747547bbf49 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 10 Jun 2024 21:52:54 +0300 Subject: [PATCH 12/21] finalizing 6.0 scope --- eip-0050.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 43c3fd28..39ff01f5 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -46,7 +46,7 @@ PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 status: unfinished -* implement BigIntModQ type (unsigned bigints mod Q, where Q is the order of secp256k1 group) +* implement BigIntMod type for cryptographic applications issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 @@ -64,15 +64,20 @@ PR: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-in status: finished, under review -* Add Numeric.toBytes, .toBits +* Add Numeric.toBytes issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/486 -PR #1: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 +PR: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 status: finished, under review +* Add Numeric.toBits + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/992 + + * Fix for downcasting BigInt to Long fails issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 @@ -134,6 +139,66 @@ PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/995 status: finished, under review +* New collection methods for 6.0 + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1004 + +* New numeric methods for 6.0 + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1006 + +* Implementation of Box.getReg + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/416 + +* Serialize SFunc in TypeSerializer + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/847 + +* Downcasting BigInt to Long fails + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 + +* Revise checkSoftForkCondition + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 + +* Revise liftToConstant method + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/905 + + + +Possible issues to investigate +--------------------------- + +* Add check using isValidIndex in Coll[T] impls + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/567 + + +* ErgoTree Exponentiate (for GroupElement) op evaluation differs from BcDlogGroup.exponentiate + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/731 + + +* Revise semantics of propBytes + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/903 + + +* Improve collections equality + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/909 + + +* Fix semantics of AvlTree.insert + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/908 + + + + How to add a new method ----------------------- From 32e74a831e19c77546024e56936d589541e865fe Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Tue, 18 Jun 2024 22:58:50 +0300 Subject: [PATCH 13/21] update w. fromBigEndianBytes --- eip-0050.md | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 39ff01f5..9fa39b39 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -10,9 +10,11 @@ Activation Rule 1011 should be replaced with another one, likely with the same rule but under different id. + Features Set ------------ + * *.validatePoW* method of *Header* type to validate Autolykos2 proof of work done on header issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 @@ -39,13 +41,6 @@ PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbit status: costing missing, unpolished -* implement Boolean to Byte conversion (boolean.toByte method) - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/931 -PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 - -status: unfinished - * implement BigIntMod type for cryptographic applications issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 @@ -82,11 +77,17 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/992 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1007 + +status: finished, under review + * Lazy default evaluation for Option.getOrElse issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 +status: finished, under review + * Implement Some and None constructors as global methods @@ -115,6 +116,7 @@ status: finished, under review issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 + * Implement binary serialization and deserialization for every type issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 @@ -132,6 +134,10 @@ PR #3 (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate- status: finished, under review +PR #4 (Global.fromBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1013 + +status: costing missing, unpolished + * Fix SubstContants: serialize ErgoTree size issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 @@ -143,6 +149,8 @@ status: finished, under review issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1004 +status: costing missing, unpolished, get_eval issue + * New numeric methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1006 @@ -155,23 +163,33 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/416 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/847 -* Downcasting BigInt to Long fails -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 +* Revise liftToConstant method -* Revise checkSoftForkCondition +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/905 -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 -* Revise liftToConstant method +* Improve collections equality -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/905 +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/909 +status: fixed but no tests + +* Revise checkSoftForkCondition + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 Possible issues to investigate --------------------------- +* implement Boolean to Byte conversion (boolean.toByte method) - include ??? + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/931 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/932 + +status: unfinished + * Add check using isValidIndex in Coll[T] impls issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/567 @@ -187,11 +205,6 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/731 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/903 -* Improve collections equality - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/909 - - * Fix semantics of AvlTree.insert issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/908 From 69225354cbcaef2db52d7d62b2387a91b5b6d995 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Sat, 29 Jun 2024 23:00:06 +0300 Subject: [PATCH 14/21] getvar issues update --- eip-0050.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eip-0050.md b/eip-0050.md index 9fa39b39..7d31c64c 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -116,6 +116,14 @@ status: finished, under review issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 +status: costing missing, unpolished + +* Fix Context.getVar + +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/978 + +status: costing missing, unpolished + * Implement binary serialization and deserialization for every type @@ -159,6 +167,8 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1006 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/416 +status: costing missing, unpolished + * Serialize SFunc in TypeSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/847 From 1059a13c95c19bdcfc8048f6671d50261d2619d4 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Wed, 20 Nov 2024 23:25:44 +0300 Subject: [PATCH 15/21] update towards impl --- eip-0050.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index 7d31c64c..1bc376c6 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -10,6 +10,8 @@ Activation Rule 1011 should be replaced with another one, likely with the same rule but under different id. +Rule 1008 should be replaced with another one, likely with the same rule but under different id. + Features Set ------------ @@ -21,7 +23,7 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/965 (Autolykos verification for a custom message) -status: costing missing, unpolished +status: finished, under review PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Header.checkPow) @@ -72,6 +74,8 @@ status: finished, under review issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/992 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1017 + * Fix for downcasting BigInt to Long fails @@ -146,6 +150,7 @@ PR #4 (Global.fromBigEndianBytes) https://github.com/ScorexFoundation/sigmastate status: costing missing, unpolished + * Fix SubstContants: serialize ErgoTree size issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 @@ -153,26 +158,36 @@ PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/995 status: finished, under review + * New collection methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1004 status: costing missing, unpolished, get_eval issue + * New numeric methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1006 +status: costing missing, unpolished + + * Implementation of Box.getReg issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/416 status: costing missing, unpolished + * Serialize SFunc in TypeSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/847 +PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1020 + +status: finished + * Revise liftToConstant method @@ -185,6 +200,7 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/909 status: fixed but no tests + * Revise checkSoftForkCondition issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 From 1670e762757603faaa9528b3aa48cb84cb6c261b Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 16:58:06 +0300 Subject: [PATCH 16/21] motivation / main changes started --- README.md | 3 ++- eip-0050.md | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c4f2ce10..31f80a40 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Ergo Improvement Proposals (EIPs) specify and/or describe standards for the Ergo Please check out existing EIPs, such as [EIP-1](eip-0001.md), to understand the general expectation of how EIPs are supposed to be formatted. | Number | Title | -| ----------------------- | ----------------------------------------------------- | +|-------------------------|-------------------------------------------------------| | [EIP-0001](eip-0001.md) | Application-Friendly Wallet API | | [EIP-0002](eip-0002.md) | Ergo grant program | | [EIP-0003](eip-0003.md) | Deterministic Wallet Standard | @@ -25,3 +25,4 @@ Please check out existing EIPs, such as [EIP-1](eip-0001.md), to understand the | [EIP-0039](eip-0039.md) | Monotonic box creation height rule | | [EIP-0043](eip-0043.md) | Reduced Transaction | | [EIP-0044](eip-0044.md) | Arbitrary Data Signing Standard | +| [EIP-0050](eip-0050.md) | Ergo protocol 6.0 Soft-Fork | \ No newline at end of file diff --git a/eip-0050.md b/eip-0050.md index 1bc376c6..b4c70ec1 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -4,20 +4,44 @@ Sigma 6.0 This EIP contains proposed changes for Ergo contractual layer, called Sigma. These changes are based on found issues in the current version of Sigma, as well as feedback got from users, i.e. Ergo ecosystem developers. +Motivation +---------- + +To the moment, ErgoTree features are still the same as of mainnet launch (July, 2019), with only JIT costing replacing +AOT introduced in 5.0 soft-fork, along with minimal changes. + +Within five years after mainnet launch, developers found many ways to improve expressiveness of scripts and make +efficiently things which can be implemented in highly non-trivial way now. Some issues were found as well (happily, nothing critical). +And finally, there are some features planned during Ergo testnets even (2018-19) but not landed in the mainnet. + +To address developers' feedback, and also fix known issues, Ergo protocol core developers are proposing a soft-fork ( +with existing nodes validating scripts with old features and skipping scripts with new features) in this document. + +Main Changes +------------- + +The biggest proposed changes are: +* new UnsignedBigInt type, unsigned 256-bits integers tailored for cryptographic applications, with modular arithmetics +* support for conversion from nbits-encoded number to big integer and back, to provide support to check difficulty for + Ergo (and Bitcoin) headers efficiently. Examples for Activation ---------- +To have old clients supporting 6.0 changes after soft-fork activation, some script deserialization validation rules +should be replaced with identical ones but having different ids. + Rule 1011 should be replaced with another one, likely with the same rule but under different id. -Rule 1008 should be replaced with another one, likely with the same rule but under different id. +Rule 1007 should be replaced with another one, likely with the same rule but under different id. +Rule 1008 should be replaced with another one, likely with the same rule but under different id. -Features Set ------------- +Corresponding Issues and Pull Requests +-------------------------------------- -* *.validatePoW* method of *Header* type to validate Autolykos2 proof of work done on header +* *.checkPoW* method of *Header* type to validate Autolykos2 proof of work done on header issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 @@ -281,10 +305,3 @@ Documentation: * update `LangSpec.md` - - - -How to add a new type ---------------------- - -[TODO: complete] From 0bcbffdbc2cbebe9b5a7babab87a1be832afadd0 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 18:37:33 +0300 Subject: [PATCH 17/21] main changes --- eip-0050.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index b4c70ec1..c87ef9de 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -21,9 +21,37 @@ Main Changes ------------- The biggest proposed changes are: + * new UnsignedBigInt type, unsigned 256-bits integers tailored for cryptographic applications, with modular arithmetics + +* support for serialization and deserialization in the scripts for all the existing types (including composite, + such as collection of optional block headers, `Coll[Option[Header]]` in ErgoScript) + +* support for serialization and deserialization of instances of Option and Header types. It allows to store them in +register or context extension variables. Also, constructors for Option instances (`Global.some[T]()` and `Global.none[T]` +methods for any type `T`). + * support for conversion from nbits-encoded number to big integer and back, to provide support to check difficulty for - Ergo (and Bitcoin) headers efficiently. Examples for + Ergo (and Bitcoin) headers efficiently. Examples for checking PoW for Ergo and Bitcoin headers can be found in 6.0 +tests. + +* new methods to check proof of work for Ergo header (header.checkPow), and also to check PoW for custom variant of +Autolykos2 algorithm for arbitrary message + +* possibility to read context variable from another input (useful to obtain state transition for a companion input) + +* methods support for `Byte`, `Short`, `Int`, `Long` types, more methods for all the numeric types (`.toBytes`, `.toBits`, + `.shiftLeft`, `.shiftRight`, `bitwiseOr`, `bitwiseAnd`, `bitwiseXor` etc) + +* more collection methods (`.get` to optionally get element if a collection contains it, `reverse`, `distrinct`, +`startsWith`, `endsWith`) + +And also: + +* possibility to propose voting for parameters not known to protocol client. It allows for introducing new voteable +parameters via soft or even velvet-forks + +* new voteable parameter, number of sub-blocks per block (for further sub-blocks implementation) Activation ---------- From cdb3c0f9950109b6aad024bb33002ac5e7ea6e40 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 18:40:33 +0300 Subject: [PATCH 18/21] reordering sections --- eip-0050.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index c87ef9de..1bb7b154 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -29,7 +29,8 @@ The biggest proposed changes are: * support for serialization and deserialization of instances of Option and Header types. It allows to store them in register or context extension variables. Also, constructors for Option instances (`Global.some[T]()` and `Global.none[T]` -methods for any type `T`). +methods for any type `T`). Also, support for serialization and deserialization of SFunc type, which is providing +support for higher-order functions * support for conversion from nbits-encoded number to big integer and back, to provide support to check difficulty for Ergo (and Bitcoin) headers efficiently. Examples for checking PoW for Ergo and Bitcoin headers can be found in 6.0 @@ -53,17 +54,8 @@ parameters via soft or even velvet-forks * new voteable parameter, number of sub-blocks per block (for further sub-blocks implementation) -Activation ----------- - -To have old clients supporting 6.0 changes after soft-fork activation, some script deserialization validation rules -should be replaced with identical ones but having different ids. - -Rule 1011 should be replaced with another one, likely with the same rule but under different id. - -Rule 1007 should be replaced with another one, likely with the same rule but under different id. - -Rule 1008 should be replaced with another one, likely with the same rule but under different id. +To check how those features are implemented, and to get more features and fixes done, see pointers to concrete issues +and pull requests in the *Corresponding Issues and Pull Requests* section below. Corresponding Issues and Pull Requests @@ -258,6 +250,19 @@ status: fixed but no tests issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 +Activation +---------- + +To have old clients supporting 6.0 changes after soft-fork activation, some script deserialization validation rules +should be replaced with identical ones but having different ids. + +Rule 1011 should be replaced with another one, likely with the same rule but under different id. + +Rule 1007 should be replaced with another one, likely with the same rule but under different id. + +Rule 1008 should be replaced with another one, likely with the same rule but under different id. + + Possible issues to investigate --------------------------- From f01f902ae2195fd439cb64fcbf1481f9f4c77c0d Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 21:47:19 +0300 Subject: [PATCH 19/21] statuses removed, header, appendices --- eip-0050.md | 102 +++++++++++----------------------------------------- 1 file changed, 20 insertions(+), 82 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 1bb7b154..57b63fe3 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -1,8 +1,13 @@ Sigma 6.0 ========= -This EIP contains proposed changes for Ergo contractual layer, called Sigma. These changes are based on found issues -in the current version of Sigma, as well as feedback got from users, i.e. Ergo ecosystem developers. +* Author: kushti +* Status: Proposed +* Created: 25-Nov-2024 +* Implemented: Ergo Protocol Reference Client 6.0.0 +* Last edited: 25-Nov-2024 +* License: CC0 +* Forking: soft-fork (at least all the miners have to update) Motivation ---------- @@ -64,132 +69,85 @@ Corresponding Issues and Pull Requests * *.checkPoW* method of *Header* type to validate Autolykos2 proof of work done on header issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/958 - PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/965 (Autolykos verification for a custom message) - -status: finished, under review - PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/968 (Header.checkPow) -status: finished, under review - * implement conversion from Long-encoded nBits representation to BigInt (long.fromNBits method) and to nBits from BitInt (bigInt.toNBits method) issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/675 - PR #1: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits encoding) - -status: costing missing, unpolished - PR #2: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/962 (nbits decoding) -status: costing missing, unpolished - -* implement BigIntMod type for cryptographic applications +* UnsignedBigInt type for cryptographic applications issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/554 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/997 -status: unfinished - * support MethodCall encoding of Numeric methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/667 - PR: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 -status: finished, under review - - * Add Numeric.toBytes issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/486 - PR: (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 -status: finished, under review - * Add Numeric.toBits issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/992 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1017 * Fix for downcasting BigInt to Long fails issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1007 -status: finished, under review - * Lazy default evaluation for Option.getOrElse issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 -status: finished, under review * Implement Some and None constructors as global methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1026 * Serialize Option[T] in DataSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/990 -status: finished, merged - * Add support for Header values (de)serialization in DataSerializer: issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/969 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/972 -status: finished, under review - * GetVar(inputIndex, varId) variant for reading context variable from another input +issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/978 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 -status: costing missing, unpolished -* Fix Context.getVar - -issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/978 - -status: costing missing, unpolished * Implement binary serialization and deserialization for every type issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 - - PR #1 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 - -status: costing missing, unpolished - PR #2 (Global.serialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/989 - -status: finished, under review - PR #3 (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 -status: finished, under review - PR #4 (Global.fromBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1013 status: costing missing, unpolished @@ -200,15 +158,11 @@ status: costing missing, unpolished issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/995 -status: finished, under review - * New collection methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1004 -status: costing missing, unpolished, get_eval issue - * New numeric methods for 6.0 @@ -220,51 +174,38 @@ status: costing missing, unpolished * Implementation of Box.getReg issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/416 - -status: costing missing, unpolished - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1015 * Serialize SFunc in TypeSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/847 - PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1020 -status: finished - - * Revise liftToConstant method issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/905 - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1021 * Improve collections equality issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/909 - -status: fixed but no tests +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1011 * Revise checkSoftForkCondition issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/904 - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1029 Activation ---------- To have old clients supporting 6.0 changes after soft-fork activation, some script deserialization validation rules -should be replaced with identical ones but having different ids. +should be replaced with identical ones but having different ids, namely, rules # 1007, 1008, 1011 ( +done in https://github.com/ergoplatform/sigmastate-interpreter/pull/1029 ). -Rule 1011 should be replaced with another one, likely with the same rule but under different id. - -Rule 1007 should be replaced with another one, likely with the same rule but under different id. - -Rule 1008 should be replaced with another one, likely with the same rule but under different id. - - -Possible issues to investigate ---------------------------- +Appendix 1. More possible issues to investigate and features to implement +------------------------------------------------------------------------- * implement Boolean to Byte conversion (boolean.toByte method) - include ??? @@ -293,11 +234,8 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/903 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/908 - - - -How to add a new method ------------------------ +Appendix 2. How to add a new method +----------------------------------- Here are instructions on how to add a new method to existing types (as 6.0 is heavily about adding new methods). From 396824a15ccebeb1309b9c9a5f080a1ce09882a4 Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 21:57:23 +0300 Subject: [PATCH 20/21] polishing issues / PRs --- eip-0050.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/eip-0050.md b/eip-0050.md index 57b63fe3..ada3e261 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -109,18 +109,16 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/877 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1007 -* Lazy default evaluation for Option.getOrElse +* Lazy default evaluation for Option.getOrElse and Coll.getOrElse issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/906 - - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1008 * Implement Some and None constructors as global methods issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/462 PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1026 - * Serialize Option[T] in DataSerializer issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/659 @@ -137,9 +135,7 @@ PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/972 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/978 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/983 - - - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1016 * Implement binary serialization and deserialization for every type @@ -147,29 +143,23 @@ issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/945 PR #1 (Global.deserializeTo): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/979 PR #2 (Global.serialize): https://github.com/ScorexFoundation/sigmastate-interpreter/pull/989 PR #3 (Numeric.toBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/984 - PR #4 (Global.fromBigEndianBytes) https://github.com/ScorexFoundation/sigmastate-interpreter/pull/1013 -status: costing missing, unpolished - * Fix SubstContants: serialize ErgoTree size issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/994 PR: https://github.com/ScorexFoundation/sigmastate-interpreter/pull/995 - * New collection methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1004 - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1010 * New numeric methods for 6.0 issue: https://github.com/ScorexFoundation/sigmastate-interpreter/issues/1006 - -status: costing missing, unpolished - +PR: https://github.com/ergoplatform/sigmastate-interpreter/pull/1017 * Implementation of Box.getReg From 027e8cb92881b25a5842d6e0a0278093c39334dd Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 25 Nov 2024 22:08:44 +0300 Subject: [PATCH 21/21] new param and voting relaxation text in motivation --- eip-0050.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eip-0050.md b/eip-0050.md index ada3e261..a3fa2988 100644 --- a/eip-0050.md +++ b/eip-0050.md @@ -19,9 +19,14 @@ Within five years after mainnet launch, developers found many ways to improve ex efficiently things which can be implemented in highly non-trivial way now. Some issues were found as well (happily, nothing critical). And finally, there are some features planned during Ergo testnets even (2018-19) but not landed in the mainnet. -To address developers' feedback, and also fix known issues, Ergo protocol core developers are proposing a soft-fork ( +To address developers' feedback, and also fix known issues, we are proposing a soft-fork ( with existing nodes validating scripts with old features and skipping scripts with new features) in this document. +Also, we propose to relax voteable parameters validation to support introducing new parameters to vote via soft-forks or +even velvet forks. Also, we propose to add new blockchain parameter to vote since 6.0, namely, number of sub-blocks +per blocks, to enhance upcoming sub-blocks implementation. This change is done in soft-fork way also, by disabling soft-forkable rule #215 via +miners voting. + Main Changes -------------