Skip to content

Commit

Permalink
Compatibility with Nairobi protocol (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Jun 13, 2023
1 parent 4c9068d commit fb1036a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [3.10.0](https://github.com/baking-bad/pytezos/compare/3.9.0...3.10.0) (2023-06-13)

### Added

* Compatibility with Nairobi protocol

## [3.9.0](https://github.com/baking-bad/pytezos/compare/3.8.0...3.9.0) (2023-03-29)

### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/pytezos/context/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'kathmandunet': ['https://rpc.tzkt.io/kathmandunet'],
'limanet': ['https://rpc.tzkt.io/limanet'],
'mumbainet': ['https://rpc.tzkt.io/mumbainet'],
'nairobinet': ['https://rpc.tzkt.io/nairobinet'],
}
keys = {
'alice': alice_key,
Expand Down
2 changes: 1 addition & 1 deletion src/pytezos/operation/fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def default_gas_limit(
if constants is None:
constants = DEFAULT_CONSTANTS
values: Dict[str, int] = {
'reveal': 1000,
'reveal': {'tz1': 176, 'tz2': 162, 'tz3': 1101, 'tz4': 1681}[content['source'][:3]],
'delegation': 1000,
'origination': int(constants['hard_gas_limit_per_operation']),
'transaction': (
Expand Down
2 changes: 1 addition & 1 deletion src/pytezos/sandbox/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pytezos.sandbox.parameters import LATEST
from pytezos.sandbox.parameters import sandbox_addresses

DOCKER_IMAGE = 'bakingbad/sandboxed-node:v16.0-2'
DOCKER_IMAGE = 'bakingbad/sandboxed-node:v17.0-1'
MAX_ATTEMPTS = 100
ATTEMPT_DELAY = 0.1
TEZOS_NODE_PORT = 8732
Expand Down
12 changes: 8 additions & 4 deletions src/pytezos/sandbox/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
KATHMANDU = 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg'
LIMA = 'PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW'
MUMBAI = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1'
LATEST = MUMBAI
NAIROBI = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf'
LATEST = NAIROBI

protocol_version = {
EDO: 8,
Expand All @@ -24,6 +25,7 @@
KATHMANDU: 14,
LIMA: 15,
MUMBAI: 16,
NAIROBI: 17,
}

sandbox_commitment = {
Expand Down Expand Up @@ -93,6 +95,7 @@


def get_protocol_parameters(protocol_hash: str) -> Dict[str, Any]:
# https://gitlab.com/tezos/tezos/-/blob/master/src/proto_017_PtNairob/lib_parameters/default_parameters.ml
return {
**sandbox_params.copy(),
'cache_sampler_state_cycles': 8.0,
Expand Down Expand Up @@ -149,12 +152,13 @@ def get_protocol_parameters(protocol_hash: str) -> Dict[str, Any]:
'vdf_difficulty': '50000',
'dal_parametric': {
'feature_enable': False,
'number_of_slots': 16.0,
'number_of_slots': 256.0,
'attestation_lag': 1.0,
'availability_threshold': 50.0,
'redundancy_factor': 16.0,
'attestation_threshold': 50.0,
'blocks_per_epoch': 4.0,
'page_size': 4096.0,
'slot_size': 1048576.0,
'redundancy_factor': 16.0,
'number_of_shards': 256.0,
},
'minimal_stake': '6000',
Expand Down

0 comments on commit fb1036a

Please sign in to comment.