Gasprice rework: use `MIN_GASPRICE` as the initial gasprice and change `MIN_GASPRICE` to 8 gwei

This commit is contained in:
Hsiao-Wei Wang 2020-03-25 14:59:41 +08:00
parent 073f78efa1
commit 071f6b5126
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
4 changed files with 6 additions and 12 deletions

View File

@ -162,9 +162,6 @@ DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
# --------------------------------------------------------------- # ---------------------------------------------------------------
PHASE_1_FORK_VERSION: 0x01000000 PHASE_1_FORK_VERSION: 0x01000000
INITIAL_ACTIVE_SHARDS: 64 INITIAL_ACTIVE_SHARDS: 64
# Placeholder
INITIAL_GASPRICE: 10
# Phase 1: General # Phase 1: General
# --------------------------------------------------------------- # ---------------------------------------------------------------
@ -190,8 +187,8 @@ SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12 MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei # 2**14 (= 16,384) Gwei
MAX_GASPRICE: 16384 MAX_GASPRICE: 16384
# 2**5 (= 32) Gwei # 2**3 (= 8) Gwei
MIN_GASPRICE: 32 MIN_GASPRICE: 8
# 2**3 (= 8) # 2**3 (= 8)
GASPRICE_ADJUSTMENT_COEFFICIENT: 8 GASPRICE_ADJUSTMENT_COEFFICIENT: 8

View File

@ -164,8 +164,6 @@ DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
PHASE_1_FORK_VERSION: 0x01000001 PHASE_1_FORK_VERSION: 0x01000001
# [customized] reduced for testing # [customized] reduced for testing
INITIAL_ACTIVE_SHARDS: 4 INITIAL_ACTIVE_SHARDS: 4
# Placeholder
INITIAL_GASPRICE: 10
# Phase 1: General # Phase 1: General
@ -192,8 +190,8 @@ SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12 MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei # 2**14 (= 16,384) Gwei
MAX_GASPRICE: 16384 MAX_GASPRICE: 16384
# 2**5 (= 32) Gwei # 2**3 (= 8) Gwei
MIN_GASPRICE: 32 MIN_GASPRICE: 8
# 2**3 (= 8) # 2**3 (= 8)
GASPRICE_ADJUSTMENT_COEFFICIENT: 8 GASPRICE_ADJUSTMENT_COEFFICIENT: 8

View File

@ -101,7 +101,7 @@ Configuration is not namespaced. Instead it is strictly an extension;
| `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | | | `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | |
| `MAX_SHARD_BLOCKS_PER_ATTESTATION` | `len(SHARD_BLOCK_OFFSETS)` | | | `MAX_SHARD_BLOCKS_PER_ATTESTATION` | `len(SHARD_BLOCK_OFFSETS)` | |
| `MAX_GASPRICE` | `Gwei(2**14)` (= 16,384) | Gwei | | | `MAX_GASPRICE` | `Gwei(2**14)` (= 16,384) | Gwei | |
| `MIN_GASPRICE` | `Gwei(2**5)` (= 32) | Gwei | | | `MIN_GASPRICE` | `Gwei(2**3)` (= 8) | Gwei | |
| `GASPRICE_ADJUSTMENT_COEFFICIENT` | `2**3` (= 8) | | | `GASPRICE_ADJUSTMENT_COEFFICIENT` | `2**3` (= 8) | |
| `DOMAIN_SHARD_PROPOSAL` | `DomainType('0x80000000')` | | | `DOMAIN_SHARD_PROPOSAL` | `DomainType('0x80000000')` | |
| `DOMAIN_SHARD_COMMITTEE` | `DomainType('0x81000000')` | | | `DOMAIN_SHARD_COMMITTEE` | `DomainType('0x81000000')` | |

View File

@ -36,7 +36,6 @@ Warning: this configuration is not definitive.
| - | - | | - | - |
| `PHASE_1_FORK_VERSION` | `Version('0x01000000')` | | `PHASE_1_FORK_VERSION` | `Version('0x01000000')` |
| `INITIAL_ACTIVE_SHARDS` | `2**6` (= 64) | | `INITIAL_ACTIVE_SHARDS` | `2**6` (= 64) |
| `INITIAL_GASPRICE` | `Gwei(10)` |
## Fork to Phase 1 ## Fork to Phase 1
@ -102,7 +101,7 @@ def upgrade_to_phase1(pre: phase0.BeaconState) -> BeaconState:
shard_states=List[ShardState, MAX_SHARDS]( shard_states=List[ShardState, MAX_SHARDS](
ShardState( ShardState(
slot=pre.slot, slot=pre.slot,
gasprice=INITIAL_GASPRICE, gasprice=MIN_GASPRICE,
data=Root(), data=Root(),
latest_block_root=Root(), latest_block_root=Root(),
) for i in range(INITIAL_ACTIVE_SHARDS) ) for i in range(INITIAL_ACTIVE_SHARDS)