Skip to content

add support for geth 1.15.0 - 1.15.5 #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ workflows:
geth_version: [
"1_14_0", "1_14_2", "1_14_3", "1_14_4", "1_14_5", "1_14_6",
"1_14_7", "1_14_8", "1_14_9", "1_14_10", "1_14_11", "1_14_12",
"1_14_13"
"1_14_13", "1_15_0", "1_15_1", "1_15_2", "1_15_3", "1_15_4",
"1_15_5"
]
name: "py3<< matrix.python_minor_version >>-install-geth-v<< matrix.geth_version >>"
- windows-wheel:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ the current list of supported versions.
Installation can be done via the command line:

```bash
$ python -m geth.install v1.14.13
$ python -m geth.install v1.15.5
```

Or from python using the `install_geth` function.

```python
>>> from geth import install_geth
>>> install_geth('v1.14.13')
>>> install_geth('v1.15.5')
```

The installed binary can be found in the `$HOME/.py-geth` directory, under your
home directory. The `v1.14.13` binary would be located at
`$HOME/.py-geth/geth-v1.14.13/bin/geth`.
home directory. The `v1.15.5` binary would be located at
`$HOME/.py-geth/geth-v1.15.5/bin/geth`.

## About `DevGethProcess`

Expand Down
15 changes: 14 additions & 1 deletion geth/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 0,
"cancunTime": 0
"cancunTime": 0,
"blobSchedule": {
"cancun": {
"target": 3,
"max": 6,
"baseFeeUpdateFraction": 3338477
},
"prague": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
}
}

},
"nonce": "0x0",
"timestamp": "0x0",
Expand Down
24 changes: 24 additions & 0 deletions geth/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
V1_14_11 = "v1.14.11"
V1_14_12 = "v1.14.12"
V1_14_13 = "v1.14.13"
V1_15_0 = "v1.15.0"
V1_15_1 = "v1.15.1"
V1_15_2 = "v1.15.2"
V1_15_3 = "v1.15.3"
V1_15_4 = "v1.15.4"
V1_15_5 = "v1.15.5"


LINUX = "linux"
Expand Down Expand Up @@ -343,6 +349,12 @@ def install_from_source_code_release(identifier: str) -> None:
install_v1_14_11 = functools.partial(install_from_source_code_release, V1_14_11)
install_v1_14_12 = functools.partial(install_from_source_code_release, V1_14_12)
install_v1_14_13 = functools.partial(install_from_source_code_release, V1_14_13)
install_v1_15_0 = functools.partial(install_from_source_code_release, V1_15_0)
install_v1_15_1 = functools.partial(install_from_source_code_release, V1_15_1)
install_v1_15_2 = functools.partial(install_from_source_code_release, V1_15_2)
install_v1_15_3 = functools.partial(install_from_source_code_release, V1_15_3)
install_v1_15_4 = functools.partial(install_from_source_code_release, V1_15_4)
install_v1_15_5 = functools.partial(install_from_source_code_release, V1_15_5)

INSTALL_FUNCTIONS = {
LINUX: {
Expand All @@ -359,6 +371,12 @@ def install_from_source_code_release(identifier: str) -> None:
V1_14_11: install_v1_14_11,
V1_14_12: install_v1_14_12,
V1_14_13: install_v1_14_13,
V1_15_0: install_v1_15_0,
V1_15_1: install_v1_15_1,
V1_15_2: install_v1_15_2,
V1_15_3: install_v1_15_3,
V1_15_4: install_v1_15_4,
V1_15_5: install_v1_15_5,
},
OSX: {
V1_14_0: install_v1_14_0,
Expand All @@ -374,6 +392,12 @@ def install_from_source_code_release(identifier: str) -> None:
V1_14_11: install_v1_14_11,
V1_14_12: install_v1_14_12,
V1_14_13: install_v1_14_13,
V1_15_0: install_v1_15_0,
V1_15_1: install_v1_15_1,
V1_15_2: install_v1_15_2,
V1_15_3: install_v1_15_3,
V1_15_4: install_v1_15_4,
V1_15_5: install_v1_15_5,
},
}

Expand Down
20 changes: 18 additions & 2 deletions geth/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
BaseModel,
ConfigDict,
ValidationError,
model_validator,
)

from geth.exceptions import (
Expand Down Expand Up @@ -94,8 +95,23 @@ class GenesisDataConfig(BaseModel):
# post-merge, timestamp is used for network transitions
shanghaiTime: int = 0
cancunTime: int = 0

model_config = ConfigDict(extra="forbid")
pragueTime: int = 0
# blobs
blobSchedule: dict[str, Any] = {}

@model_validator(mode="after")
def check_blob_schedule_required(
self,
) -> GenesisDataConfig:
if self.cancunTime > 0 and self.blobSchedule.get("cancun") is None:
raise PyGethValueError(
"blobSchedule 'cancun' value is required when cancunTime is set"
)
if self.pragueTime > 0 and self.blobSchedule.get("prague") is None:
raise PyGethValueError(
"blobSchedule 'prague' value is required when pragueTime is set"
)
return self


class GenesisData(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions newsfragments/251.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds support for geth ``v1.15.0`` through ``v1.15.5``, add new fields ``blobSchedule`` and ``pragueTime`` to genesis data config.
13 changes: 13 additions & 0 deletions tests/core/utility/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ def test_validate_genesis_data_good(genesis_data):
"config": None,
},
"kangaroo",
{
"difficulty": "0x00012131",
"nonce": "abc",
"timestamp": "1234",
"config": {
"cancunTime": 5,
"blobSchedule": {},
},
},
],
)
def test_validate_genesis_data_bad(genesis_data):
Expand Down Expand Up @@ -127,6 +136,8 @@ def test_validate_genesis_data_bad(genesis_data):
"terminalTotalDifficultyPassed": True,
"shanghaiTime": 0,
"cancunTime": 0,
"pragueTime": 0,
"blobSchedule": {},
},
"difficulty": "0x00012131",
"excessBlobGas": "0x0",
Expand Down Expand Up @@ -179,6 +190,8 @@ def test_validate_genesis_data_bad(genesis_data):
"terminalTotalDifficultyPassed": True,
"shanghaiTime": 0,
"cancunTime": 0,
"pragueTime": 0,
"blobSchedule": {},
},
"difficulty": "0x00012131",
"excessBlobGas": "0x0",
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ envlist=
py{38,39,310,311,312,313}-lint
py{38,39,310,311,312,313}-install-geth-{\
v1_14_0, v1_14_2, v1_14_3, v1_14_4, v1_14_5, v1_14_6, v1_14_7, \
v1_14_8, v1_14_9, v1_14_10, v1_14_11, v1_14_12, v1_14_13 \
v1_14_8, v1_14_9, v1_14_10, v1_14_11, v1_14_12, v1_14_13, v1_15_0, \
v1_15_1, v1_15_2, v1_15_3, v1_15_4, v1_15_5 \
}
py{38,39,310,311,312,313}-wheel
windows-wheel
Expand Down