Skip to content

Commit

Permalink
v0.7.2 (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
MauroToscano authored Sep 23, 2024
2 parents ff72fae + 4b2fabe commit 9c71987
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OS := $(shell uname -s)
CONFIG_FILE?=config-files/config.yaml
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml

OPERATOR_VERSION=v0.7.1
OPERATOR_VERSION=v0.7.2

ifeq ($(OS),Linux)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
Expand Down
12 changes: 4 additions & 8 deletions batcher/aligned-sdk/src/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,17 @@ impl Eip712 for NoncedVerificationData {

let mut hasher = Keccak256::new();

// As per the EIP, first we generate the type hash
// hashStruct(s : 𝕊) = keccak256(typeHash ‖ encodeData(s))

// We first generate the type hash
hasher.update(NONCED_VERIFICATION_DATA_TYPE);
let type_hash = hasher.finalize_reset();

// Then hash is resetted, so we start hashing the second term of the encodedData(s)
// Then we hash it with the rest of the data in the struct
hasher.update(type_hash);
hasher.update(verification_data_hash);
hasher.update(nonce_bytes);
hasher.update(max_fee_bytes);
let encoded_data_hash = hasher.finalize_reset();

// Now we do the actual final
// keccak256(typeHash ‖ encodeData(s))
hasher.update(type_hash);
hasher.update(encoded_data_hash);
let hash_struct = hasher.finalize_reset();

Ok(hash_struct.into())
Expand Down

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions contracts/src/core/BatcherPaymentService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ contract BatcherPaymentService is
noncedVerificationDataTypeHash = _noncedVerificationDataTypeHash;
}

// Defined in types.rs
// keccak256("NoncedVerificationData(bytes32 verification_data_hash,uint256 nonce,uint256 max_fee)")
function initializeNoncedVerificationDataTypeHash(
bytes32 _noncedVerificationDataTypeHash
) public reinitializer(2) onlyOwner {
Expand Down Expand Up @@ -280,15 +282,12 @@ contract BatcherPaymentService is
revert InvalidMaxFee(signatureData.maxFee, feePerProof);
}

bytes32 encodedDataHash = keccak256(
abi.encode(
leaf,
signatureData.nonce,
signatureData.maxFee
)
);

bytes32 structHash = keccak256(abi.encode(noncedVerificationDataTypeHash, encodedDataHash));
bytes32 structHash = keccak256(abi.encode(
noncedVerificationDataTypeHash,
leaf,
signatureData.nonce,
signatureData.maxFee
));

bytes32 hash = _hashTypedDataV4(structHash);

Expand Down
4 changes: 2 additions & 2 deletions docs/operator_guides/0_running_an_operator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Register as an Aligned operator in testnet

> **CURRENT VERSION:**
> Aligned Operator [v0.7.1](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.7.1)
> Aligned Operator [v0.7.2](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.7.2)
> **IMPORTANT:**
> You must be [whitelisted](https://docs.google.com/forms/d/e/1FAIpQLSdH9sgfTz4v33lAvwj6BvYJGAeIshQia3FXz36PFfF-WQAWEQ/viewform) to become an Aligned operator.
Expand All @@ -26,7 +26,7 @@ Minimum hardware requirements:
To start with, clone the Aligned repository and move inside it

```bash
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.7.1
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.7.2
cd aligned_layer
```

Expand Down

0 comments on commit 9c71987

Please sign in to comment.