Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 0be605e

Browse files
committed
Merge pull request #1 from ethereum/develop
Latest develop
2 parents 5e546ca + 7d4cc3f commit 0be605e

File tree

9 files changed

+30
-26
lines changed

9 files changed

+30
-26
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
language: python
22
python: 2.7
3-
sudo: false # use new infrastructure
3+
sudo: false
44
env:
5-
- TOX_ENV=py27
6-
5+
- TOX_ENV=py27
76
install:
8-
- pip install -r requirements.txt
9-
- pip install -r dev_requirements.txt
10-
7+
- pip install -r requirements.txt
8+
- pip install -r dev_requirements.txt
119
script:
12-
- coverage run --source ethereum -m py.test --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py
10+
- coverage run --source ethereum -m py.test --ignore ethereum/tests/test_vm.py --ignore
11+
ethereum/tests/test_state.py
1312
- coverage run --append --source ethereum -m py.test ethereum/tests/test_vm.py
1413
- coverage run --append --source ethereum -m py.test ethereum/tests/test_state.py
15-
1614
after_success:
1715
- coveralls
18-
16+
notifications:
17+
slack:
18+
secure: W/UAhQ/GgYwMWrl3aiVAVOWr4WGdWrxUOX/rTB3ZgwDwGqDYLzQO5UqbsQlo1JXPZ6JOWfIPMURhHu7DSfue9dBW6xQ+NL+bFHe9lSXG4nqFK3IjezYyTBzNRJRDbGUvSSqgj6D5cwhJ8BjfUIRPbJz3CxL64KmsNXezEaMY60w=
1919
deploy:
2020
provider: pypi
2121
user: ethereum_pypi_automated
2222
password:
23-
secure: "FvkEn1xULi9mGxAL9sKlTuxJZvk0Uyd2GaDPAHN5ZAfaJUNwzA6+m7PRAMPd44Uy/LOw0+Ah9X1rxAxZc+7yx+FJjwH1Nl8MjtqYTWp+Ue6TFUNdJXNHjekC5ce4rbULudrqlmwmaWzi5iRC7qhpxuTg1y3iBw3Fsd8E82qbDac="
23+
secure: FvkEn1xULi9mGxAL9sKlTuxJZvk0Uyd2GaDPAHN5ZAfaJUNwzA6+m7PRAMPd44Uy/LOw0+Ah9X1rxAxZc+7yx+FJjwH1Nl8MjtqYTWp+Ue6TFUNdJXNHjekC5ce4rbULudrqlmwmaWzi5iRC7qhpxuTg1y3iBw3Fsd8E82qbDac=
2424
on:
2525
tags: true
2626
repo: ethereum/pyethereum

ethereum/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
EXPDIFF_FREE_PERIODS=2,
4444
# Blank account initial nonce
4545
ACCOUNT_INITIAL_NONCE=0,
46-
# Homestead fork (500k on livenet?)
47-
HOMESTEAD_FORK_BLKNUM=1000000,
46+
# Homestead fork
47+
HOMESTEAD_FORK_BLKNUM=1150000,
4848
HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF=10,
4949
)
5050
assert default_config['NEPHEW_REWARD'] == \

ethereum/processblock.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from ethereum.exceptions import *
1111
from ethereum.utils import safe_ord, normalize_address, mk_contract_address
1212
from ethereum import transactions
13+
import ethereum.config as config
1314

1415
sys.setrecursionlimit(100000)
1516

@@ -80,6 +81,8 @@ def rp(what, actual, target):
8081
# (1) The transaction signature is valid;
8182
if not tx.sender: # sender is set and validated on Transaction initialization
8283
raise UnsignedTransaction(tx)
84+
if block.number >= config.default_config["HOMESTEAD_FORK_BLKNUM"]:
85+
tx.check_low_s()
8386

8487
# (2) the transaction nonce is valid (equivalent to the
8588
# sender account's current nonce);

ethereum/slogging.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
known_loggers = set()
1717

1818
log_listeners = []
19-
print_logs=True
2019

2120

2221
# add level trace into logging
@@ -39,17 +38,12 @@ class LogRecorder(object):
3938
def __init__(self):
4039
self._records = []
4140
log_listeners.append(self._add_log_record)
42-
global print_logs
43-
self.prev_print_logs = print_logs
44-
print_logs = False
4541

4642
def pop_records(self):
4743
# can only be called once
4844
r = self._records[:]
4945
self._records = None
5046
log_listeners.remove(self._add_log_record)
51-
global print_logs
52-
print_logs = self.prev_print_logs
5347
return r
5448

5549
def _add_log_record(self, msg):
@@ -132,17 +126,13 @@ def bind(self, **kwargs):
132126
return BoundLogger(self, kwargs)
133127

134128
def _log(self, level, msg, args, **kwargs):
135-
for listener in log_listeners:
136-
kwargs['event'] = msg
137-
listener(kwargs)
138129
exc_info = kwargs.pop('exc_info', None)
139130
extra = kwargs.pop('extra', {})
140131
highlight = kwargs.pop('highlight', False)
141132
extra['kwargs'] = kwargs
142133
extra['original_msg'] = msg
143134
msg = self.format_message(msg, kwargs, highlight)
144-
if print_logs:
145-
super(SLogger, self)._log(level, msg, args, exc_info, extra)
135+
super(SLogger, self)._log(level, msg, args, exc_info, extra)
146136

147137
def DEV(self, msg, *args, **kwargs):
148138
"""Shortcut to output highlighted log text"""

ethereum/tests/test_transactions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from rlp.utils import decode_hex, encode_hex, str_to_bytes
55
import ethereum.testutils as testutils
66
from ethereum.testutils import fixture_to_bytes
7+
import ethereum.config as config
78
import sys
89
import json
910
import os
@@ -24,6 +25,9 @@ def run_test(filename, testname, testdata):
2425
rlpdata = decode_hex(testdata["rlp"][2:])
2526
o = {}
2627
tx = rlp.decode(rlpdata, transactions.Transaction)
28+
blknum = int(testdata["blocknumber"])
29+
if blknum >= config.default_config["HOMESTEAD_FORK_BLKNUM"]:
30+
tx.check_low_s()
2731
o["sender"] = tx.sender
2832
o["transaction"] = {
2933
"data": b'0x' * (len(tx.data) > 0) + encode_hex(tx.data),

ethereum/transactions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ def __repr__(self):
170170
def __structlog__(self):
171171
return encode_hex(self.hash)
172172

173+
# This method should be called for block numbers >= HOMESTEAD_FORK_BLKNUM only.
174+
# The >= operator is replaced by > because the integer division N/2 always produces the value
175+
# which is by 0.5 less than the real N/2
176+
def check_low_s(self):
177+
if self.s > N/2 or self.s == 0:
178+
raise InvalidTransaction("Invalid signature S value!")
179+
173180

174181
UnsignedTransaction = Transaction.exclude(['v', 'r', 's'])
175182

fixtures

Submodule fixtures updated 31 files

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.8
2+
current_version = 1.1.0
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_tests(self):
4343

4444
# *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.
4545
# see: https://github.com/ethereum/pyethapp/wiki/Development:-Versions-and-Releases
46-
version = '1.0.8'
46+
version = '1.1.0'
4747

4848
setup(name="ethereum",
4949
packages=find_packages("."),

0 commit comments

Comments
 (0)