Set execution params to presets and add builder checks.

This commit is contained in:
Hsiao-Wei Wang 2021-11-01 12:11:15 +08:00
parent 77fe450f21
commit 3ba3915396
No known key found for this signature in database
GPG Key ID: 1111A8A81778319E
2 changed files with 7 additions and 5 deletions

View File

@ -634,6 +634,10 @@ def objects_to_spec(preset_name: str,
ssz_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, builder.hardcoded_ssz_dep_constants()[x]), builder.hardcoded_ssz_dep_constants()))
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), builder.hardcoded_ssz_dep_constants()))
custom_type_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, builder.hardcoded_custom_type_dep_constants()[x]), builder.hardcoded_custom_type_dep_constants()))
custom_type_dep_constants_verification = '\n'.join(map(
lambda x: 'assert %s == %s' % (x, f'{spec_object.preset_vars[x].type_name}({spec_object.preset_vars[x].value})'),
builder.hardcoded_custom_type_dep_constants(),
))
spec = (
builder.imports(preset_name)
+ builder.preparations()
@ -654,6 +658,7 @@ def objects_to_spec(preset_name: str,
# Since some constants are hardcoded in setup.py, the following assertions verify that the hardcoded constants are
# as same as the spec definition.
+ ('\n\n\n' + ssz_dep_constants_verification if ssz_dep_constants_verification != '' else '')
+ ('\n\n\n' + custom_type_dep_constants_verification if custom_type_dep_constants_verification != '' else '')
+ '\n'
)
return spec

View File

@ -10,9 +10,8 @@
- [Introduction](#introduction)
- [Custom types](#custom-types)
- [Constants](#constants)
- [Execution](#execution)
- [Preset](#preset)
- [Execution](#execution)
- [Updated penalty values](#updated-penalty-values)
- [Configuration](#configuration)
- [Transition settings](#transition-settings)
@ -64,7 +63,7 @@ Additionally, this upgrade introduces the following minor changes:
| `Transaction` | `ByteList[MAX_BYTES_PER_TRANSACTION]` | either a [typed transaction envelope](https://eips.ethereum.org/EIPS/eip-2718#opaque-byte-array-rather-than-an-rlp-array) or a legacy transaction|
| `ExecutionAddress` | `Bytes20` | Address of account on the execution layer |
## Constants
## Preset
### Execution
@ -77,8 +76,6 @@ Additionally, this upgrade introduces the following minor changes:
| `MIN_GAS_LIMIT` | `uint64(5000)` (= 5,000) |
| `MAX_EXTRA_DATA_BYTES` | `2**5` (= 32) |
## Preset
### Updated penalty values
The Merge updates a few configuration values to move penalty parameters to their final, maximum security values.