From f64733183bd24ac6d30286a5587e5bebf5ab5553 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Thu, 17 Jan 2019 15:25:28 +0100 Subject: [PATCH 1/7] Init version bytes prefix account versioning --- EIPS/eip-code-prefix.md | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 EIPS/eip-code-prefix.md diff --git a/EIPS/eip-code-prefix.md b/EIPS/eip-code-prefix.md new file mode 100644 index 00000000000000..9ed6119809609f --- /dev/null +++ b/EIPS/eip-code-prefix.md @@ -0,0 +1,43 @@ +--- +eip: +title: Use Version Byte Prefix for Contract Account Versioning +author: Wei Tang (@sorpaas) +discussions-to: +status: Draft +type: Standards Track +category: Core +created: 2019-01-17 +--- + +## Simple Summary + +Provide an alternative proposal compared with EIP-1702 / ECIP-1040, +with the following advantages: + +* We don't need to modify existing account state format. +* We don't need to modify how precompiled contracts are invoked. +* Compatible with the standard WebAssembly binary format. + +## Specification + +After `FORK_BLOCK`, before an account or contract creation transaction +code is executed, check that whether: + +* The first byte is `\0` (`0x00`). +* The code length is greater or equal to 4. + +If so, we define the second to fourth bytes as version bits. Instead +of executing on the default EVM, pass the *whole* code array to a VM +defined by the version bits. + +* If version bytes are `\0\0\1`, then invoke "EVM1", where the first 4 + bytes are stripped, and the rest of the code bytes are executed in + an EVM with "EVM1" config. +* If version bytes are `asm`, then invoke WebAssembly virtual + machine. This is compatible with the standard WebAssembly binary + format because it always starts with `\0asm`. + +## Copyright + +Copyright and related rights waived via +[CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 2a258781845885df8101d449da05e77370e4e6e5 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Thu, 17 Jan 2019 15:27:57 +0100 Subject: [PATCH 2/7] Update and rename eip-code-prefix.md to eip-1707.md --- EIPS/{eip-code-prefix.md => eip-1707.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename EIPS/{eip-code-prefix.md => eip-1707.md} (98%) diff --git a/EIPS/eip-code-prefix.md b/EIPS/eip-1707.md similarity index 98% rename from EIPS/eip-code-prefix.md rename to EIPS/eip-1707.md index 9ed6119809609f..e2142bd38edbb4 100644 --- a/EIPS/eip-code-prefix.md +++ b/EIPS/eip-1707.md @@ -1,5 +1,5 @@ --- -eip: +eip: 1707 title: Use Version Byte Prefix for Contract Account Versioning author: Wei Tang (@sorpaas) discussions-to: From 3166f1422a3efc6ed91e1695491f58d97767d389 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Thu, 17 Jan 2019 15:30:53 +0100 Subject: [PATCH 3/7] Update eip-1707.md --- EIPS/eip-1707.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EIPS/eip-1707.md b/EIPS/eip-1707.md index e2142bd38edbb4..86f3c0bf916956 100644 --- a/EIPS/eip-1707.md +++ b/EIPS/eip-1707.md @@ -36,6 +36,10 @@ defined by the version bits. * If version bytes are `asm`, then invoke WebAssembly virtual machine. This is compatible with the standard WebAssembly binary format because it always starts with `\0asm`. + +If the above does not match, execute it on the default EVM. Note that +if the first byte is `\0`, the client can short circuit and stop +immediately. ## Copyright From 5b37a91415d4f4d71ca3c95d44b07993e4a6ec88 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Thu, 17 Jan 2019 15:35:37 +0100 Subject: [PATCH 4/7] Update eip-1707.md --- EIPS/eip-1707.md | 1 - 1 file changed, 1 deletion(-) diff --git a/EIPS/eip-1707.md b/EIPS/eip-1707.md index 86f3c0bf916956..1c0555c4c53bee 100644 --- a/EIPS/eip-1707.md +++ b/EIPS/eip-1707.md @@ -2,7 +2,6 @@ eip: 1707 title: Use Version Byte Prefix for Contract Account Versioning author: Wei Tang (@sorpaas) -discussions-to: status: Draft type: Standards Track category: Core From b41dc29f49ee8737c73eccfa21309cbd533c4683 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Thu, 17 Jan 2019 15:38:15 +0100 Subject: [PATCH 5/7] Update eip-1707.md --- EIPS/eip-1707.md | 1 + 1 file changed, 1 insertion(+) diff --git a/EIPS/eip-1707.md b/EIPS/eip-1707.md index 1c0555c4c53bee..989cd0bac14e4c 100644 --- a/EIPS/eip-1707.md +++ b/EIPS/eip-1707.md @@ -2,6 +2,7 @@ eip: 1707 title: Use Version Byte Prefix for Contract Account Versioning author: Wei Tang (@sorpaas) +discussions-to: https://github.com/sorpaas/EIPs/issues/3 status: Draft type: Standards Track category: Core From 465555933bf8e1b583b7182def7018ec331c959d Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Fri, 28 Jun 2019 11:39:14 +0200 Subject: [PATCH 6/7] Mark 1707 as abandoned --- EIPS/eip-1707.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-1707.md b/EIPS/eip-1707.md index 989cd0bac14e4c..043422b4312961 100644 --- a/EIPS/eip-1707.md +++ b/EIPS/eip-1707.md @@ -3,7 +3,7 @@ eip: 1707 title: Use Version Byte Prefix for Contract Account Versioning author: Wei Tang (@sorpaas) discussions-to: https://github.com/sorpaas/EIPs/issues/3 -status: Draft +status: Abandoned type: Standards Track category: Core created: 2019-01-17 From 6235a1d7a758b23b7efd8328799287457bed18ca Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Fri, 28 Jun 2019 11:40:48 +0200 Subject: [PATCH 7/7] Add superseded-by to 1702 --- EIPS/eip-1707.md | 1 + 1 file changed, 1 insertion(+) diff --git a/EIPS/eip-1707.md b/EIPS/eip-1707.md index 043422b4312961..63b12fc9ba50f6 100644 --- a/EIPS/eip-1707.md +++ b/EIPS/eip-1707.md @@ -6,6 +6,7 @@ discussions-to: https://github.com/sorpaas/EIPs/issues/3 status: Abandoned type: Standards Track category: Core +superseded-by: 1702 created: 2019-01-17 ---