diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..c2b17bf1a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.vy linguist-language=Python diff --git a/Makefile b/Makefile index 2b165ad7d..51bff90d0 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ install_deposit_contract_test: $(PY_SPEC_ALL_TARGETS) compile_deposit_contract: cd $(DEPOSIT_CONTRACT_DIR); . venv/bin/activate; \ - python tool/compile_deposit_contract.py contracts/validator_registration.v.py; + python tool/compile_deposit_contract.py contracts/validator_registration.vy; test_deposit_contract: cd $(DEPOSIT_CONTRACT_DIR); . venv/bin/activate; \ diff --git a/deposit_contract/contracts/validator_registration.v.py b/deposit_contract/contracts/validator_registration.vy similarity index 100% rename from deposit_contract/contracts/validator_registration.v.py rename to deposit_contract/contracts/validator_registration.vy diff --git a/deposit_contract/tests/contracts/utils.py b/deposit_contract/tests/contracts/utils.py index de7c54489..12eac5832 100644 --- a/deposit_contract/tests/contracts/utils.py +++ b/deposit_contract/tests/contracts/utils.py @@ -5,7 +5,7 @@ DIR = os.path.dirname(__file__) def get_deposit_contract_code(): - file_path = os.path.join(DIR, './../../contracts/validator_registration.v.py') + file_path = os.path.join(DIR, './../../contracts/validator_registration.vy') deposit_contract_code = open(file_path).read() return deposit_contract_code diff --git a/specs/core/0_deposit-contract.md b/specs/core/0_deposit-contract.md index c9f366330..11be41b86 100644 --- a/specs/core/0_deposit-contract.md +++ b/specs/core/0_deposit-contract.md @@ -61,6 +61,6 @@ Every Ethereum 1.0 deposit emits a `DepositEvent` log for consumption by the bea ## Vyper code -The deposit contract source code, written in Vyper, is available [here](../../deposit_contract/contracts/validator_registration.v.py). +The deposit contract source code, written in Vyper, is available [here](../../deposit_contract/contracts/validator_registration.vy). *Note*: To save on gas, the deposit contract uses a progressive Merkle root calculation algorithm that requires only O(log(n)) storage. See [here](https://github.com/ethereum/research/blob/master/beacon_chain_impl/progressive_merkle_tree.py) for a Python implementation, and [here](https://github.com/runtimeverification/verified-smart-contracts/blob/master/deposit/formal-incremental-merkle-tree-algorithm.pdf) for a formal correctness proof.