Skip to content

Commit 924c859

Browse files
authored
chore: update Lambda names (#2603)
Signed-off-by: emiliyank <e.kadiyski@gmail.com>
1 parent cd88f64 commit 924c859

15 files changed

Lines changed: 101 additions & 74 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
with:
181181
installMirrorNode: true
182182
mirrorNodeVersion: v0.145.2
183-
hieroVersion: v0.69.0
183+
hieroVersion: v0.70.0-rc.2
184184

185185
- name: Build SDK
186186
run: ./gradlew assemble
@@ -310,7 +310,7 @@ jobs:
310310
with:
311311
installMirrorNode: true
312312
mirrorNodeVersion: v0.145.2
313-
hieroVersion: v0.69.0
313+
hieroVersion: v0.70.0-rc.2
314314

315315
- name: Build SDK
316316
run: ./gradlew assemble

sdk/src/main/java/com/hedera/hashgraph/sdk/HookStoreTransaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException {
129129

130130
@Override
131131
MethodDescriptor<com.hedera.hashgraph.sdk.proto.Transaction, TransactionResponse> getMethodDescriptor() {
132-
return SmartContractServiceGrpc.getLambdaSStoreMethod();
132+
return SmartContractServiceGrpc.getHookStoreMethod();
133133
}
134134

135135
@Override

sdk/src/main/java/com/hedera/hashgraph/sdk/RequestType.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,17 @@ public enum RequestType {
508508

509509
/**
510510
* Update one or more storage slots in an lambda EVM hook.
511+
*
512+
* @deprecated Use {@link #HOOK_STORE} instead.
511513
*/
514+
@Deprecated
512515
LAMBDA_S_STORE(HederaFunctionality.LambdaSStore),
513516

517+
/**
518+
* Update one or more storage slots in an EVM hook.
519+
*/
520+
HOOK_STORE(HederaFunctionality.HookStore),
521+
514522
/**
515523
* (Internal-only) Dispatch a hook action.
516524
*/
@@ -616,6 +624,7 @@ static RequestType valueOf(HederaFunctionality code) {
616624
case CrsPublication -> CRS_PUBLICATION;
617625
case AtomicBatch -> ATOMIC_BATCH;
618626
case LambdaSStore -> LAMBDA_S_STORE;
627+
case HookStore -> HOOK_STORE;
619628
case HookDispatch -> HOOK_DISPATCH;
620629
default -> throw new IllegalStateException("(BUG) unhandled HederaFunctionality");
621630
};
@@ -716,6 +725,7 @@ public String toString() {
716725
case CRS_PUBLICATION -> "CRS_PUBLICATION";
717726
case ATOMIC_BATCH -> "ATOMIC_BATCH";
718727
case LAMBDA_S_STORE -> "LAMBDA_S_STORE";
728+
case HOOK_STORE -> "HOOK_STORE";
719729
case HOOK_DISPATCH -> "HOOK_DISPATCH";
720730
};
721731
}

sdk/src/main/java/com/hedera/hashgraph/sdk/Status.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,26 +1948,26 @@ public enum Status {
19481948
HOOK_NOT_FOUND(ResponseCodeEnum.HOOK_NOT_FOUND),
19491949

19501950
/**
1951-
* A lambda mapping slot, storage key, or storage value exceeded 32 bytes.
1951+
* An EVM hook mapping slot, storage key, or storage value exceeded 32 bytes.
19521952
*/
1953-
LAMBDA_STORAGE_UPDATE_BYTES_TOO_LONG(ResponseCodeEnum.LAMBDA_STORAGE_UPDATE_BYTES_TOO_LONG),
1953+
EVM_HOOK_STORAGE_UPDATE_BYTES_TOO_LONG(ResponseCodeEnum.EVM_HOOK_STORAGE_UPDATE_BYTES_TOO_LONG),
19541954

19551955
/**
1956-
* A lambda mapping slot, storage key, or storage value failed to use the
1956+
* An EVM hook's mapping slot, storage key, or storage value failed to use the
19571957
* minimal representation (i.e., no leading zeros).
19581958
*/
1959-
LAMBDA_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION(
1960-
ResponseCodeEnum.LAMBDA_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION),
1959+
EVM_HOOK_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION(
1960+
ResponseCodeEnum.EVM_HOOK_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION),
19611961

19621962
/**
19631963
* A hook id was invalid.
19641964
*/
19651965
INVALID_HOOK_ID(ResponseCodeEnum.INVALID_HOOK_ID),
19661966

19671967
/**
1968-
* A lambda storage update had no contents.
1968+
* An EVM hook storage update had no contents.
19691969
*/
1970-
EMPTY_LAMBDA_STORAGE_UPDATE(ResponseCodeEnum.EMPTY_LAMBDA_STORAGE_UPDATE),
1970+
EMPTY_EVM_HOOK_STORAGE_UPDATE(ResponseCodeEnum.EMPTY_EVM_HOOK_STORAGE_UPDATE),
19711971

19721972
/**
19731973
* A user repeated the same hook id in a creation details list.
@@ -1980,29 +1980,29 @@ public enum Status {
19801980
HOOKS_NOT_ENABLED(ResponseCodeEnum.HOOKS_NOT_ENABLED),
19811981

19821982
/**
1983-
* The target hook is not a lambda.
1983+
* The target hook is not an EVM hook.
19841984
*/
1985-
HOOK_IS_NOT_A_LAMBDA(ResponseCodeEnum.HOOK_IS_NOT_A_LAMBDA),
1985+
HOOK_IS_NOT_AN_EVM_HOOK(ResponseCodeEnum.HOOK_IS_NOT_AN_EVM_HOOK),
19861986

19871987
/**
19881988
* A hook was deleted.
19891989
*/
19901990
HOOK_DELETED(ResponseCodeEnum.HOOK_DELETED),
19911991

19921992
/**
1993-
* The LambdaSStore tried to update too many storage slots in a single transaction.
1993+
* The HookStore tried to update too many storage slots in a single transaction.
19941994
*/
19951995
TOO_MANY_LAMBDA_STORAGE_UPDATES(ResponseCodeEnum.TOO_MANY_LAMBDA_STORAGE_UPDATES),
19961996

19971997
/**
1998-
* A lambda mapping slot, storage key, or storage value failed to use the
1998+
* An EVM hook mapping slot, storage key, or storage value failed to use the
19991999
* minimal representation (i.e., no leading zeros).
20002000
*/
20012001
HOOK_CREATION_BYTES_MUST_USE_MINIMAL_REPRESENTATION(
20022002
ResponseCodeEnum.HOOK_CREATION_BYTES_MUST_USE_MINIMAL_REPRESENTATION),
20032003

20042004
/**
2005-
* A lambda mapping slot, storage key, or storage value exceeded 32 bytes.
2005+
* A EVM hook mapping slot, storage key, or storage value exceeded 32 bytes.
20062006
*/
20072007
HOOK_CREATION_BYTES_TOO_LONG(ResponseCodeEnum.HOOK_CREATION_BYTES_TOO_LONG),
20082008

@@ -2434,14 +2434,14 @@ static Status valueOf(ResponseCodeEnum code) {
24342434
case BAD_HOOK_REQUEST -> BAD_HOOK_REQUEST;
24352435
case REJECTED_BY_ACCOUNT_ALLOWANCE_HOOK -> REJECTED_BY_ACCOUNT_ALLOWANCE_HOOK;
24362436
case HOOK_NOT_FOUND -> HOOK_NOT_FOUND;
2437-
case LAMBDA_STORAGE_UPDATE_BYTES_TOO_LONG -> LAMBDA_STORAGE_UPDATE_BYTES_TOO_LONG;
2438-
case LAMBDA_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION ->
2439-
LAMBDA_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION;
2437+
case EVM_HOOK_STORAGE_UPDATE_BYTES_TOO_LONG -> EVM_HOOK_STORAGE_UPDATE_BYTES_TOO_LONG;
2438+
case EVM_HOOK_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION ->
2439+
EVM_HOOK_STORAGE_UPDATE_BYTES_MUST_USE_MINIMAL_REPRESENTATION;
24402440
case INVALID_HOOK_ID -> INVALID_HOOK_ID;
2441-
case EMPTY_LAMBDA_STORAGE_UPDATE -> EMPTY_LAMBDA_STORAGE_UPDATE;
2441+
case EMPTY_EVM_HOOK_STORAGE_UPDATE -> EMPTY_EVM_HOOK_STORAGE_UPDATE;
24422442
case HOOK_ID_REPEATED_IN_CREATION_DETAILS -> HOOK_ID_REPEATED_IN_CREATION_DETAILS;
24432443
case HOOKS_NOT_ENABLED -> HOOKS_NOT_ENABLED;
2444-
case HOOK_IS_NOT_A_LAMBDA -> HOOK_IS_NOT_A_LAMBDA;
2444+
case HOOK_IS_NOT_AN_EVM_HOOK -> HOOK_IS_NOT_AN_EVM_HOOK;
24452445
case HOOK_DELETED -> HOOK_DELETED;
24462446
case TOO_MANY_LAMBDA_STORAGE_UPDATES -> TOO_MANY_LAMBDA_STORAGE_UPDATES;
24472447
case HOOK_CREATION_BYTES_MUST_USE_MINIMAL_REPRESENTATION ->

sdk/src/main/proto/account.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ message Account {
478478
int64 first_hook_id = 37;
479479

480480
/**
481-
* The number of storage slots in use by this account's lambdas.
481+
* The number of storage slots in use by this account's EVM hooks.
482482
*/
483-
uint64 number_lambda_storage_slots = 38;
483+
uint64 number_evm_hook_storage_slots = 38;
484484
}
485485

486486
/**

sdk/src/main/proto/basic_types.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,13 +1836,19 @@ enum HederaFunctionality {
18361836

18371837
/**
18381838
* Update one or more storage slots in an lambda EVM hook.
1839+
* (DEPRECATED) Remove once no production throttle assets reference it.
18391840
*/
18401841
LambdaSStore = 109;
18411842

18421843
/**
18431844
* (Internal-only) Dispatch a hook action.
18441845
*/
18451846
HookDispatch = 110;
1847+
1848+
/**
1849+
* Update one or more storage slots in an EVM hook.
1850+
*/
1851+
HookStore = 111;
18461852
}
18471853

18481854
/**

sdk/src/main/proto/entity_counts.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ message EntityCounts {
7676
*/
7777
uint64 num_hooks = 14;
7878
/**
79-
* The number of lambda hook storage slots in the network.
79+
* The number of EVM hook storage slots in the network.
8080
*/
81-
uint64 num_lambda_storage_slots = 15;
81+
uint64 num_evm_hook_storage_slots = 15;
8282
}

sdk/src/main/proto/evm_hook_state.proto

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ message EvmHookState {
3131
proto.HookId hook_id = 1;
3232

3333
/**
34-
* The type of the EVM hook.
34+
* The type of the hook.
3535
*/
36-
EvmHookType type = 2;
36+
HookType type = 2;
3737

3838
/**
3939
* The type of the extension point the hook implements.
@@ -47,15 +47,15 @@ message EvmHookState {
4747

4848
/**
4949
* If set, a key that that can be used to remove or replace the hook; or (if
50-
* applicable, as with a lambda EVM hook) perform transactions that customize
50+
* applicable, as with an EVM hook) perform transactions that customize
5151
* the hook.
5252
*/
5353
proto.Key admin_key = 5;
5454

5555
/**
56-
* For a lambda, its first storage key. Must be the minimal
57-
* bytes representation (no leading zeros). A lambda with
58-
* no storage slots and a lambda whose last-written storage
56+
* For an EVM hook, its first storage key. Must be the minimal
57+
* bytes representation (no leading zeros). An EVM hook with
58+
* no storage slots and an EVM hook whose last-written storage
5959
* slot was at the zero key can be differentiated by checking
6060
* the `num_storage_slots` field.
6161
*/
@@ -74,30 +74,29 @@ message EvmHookState {
7474
google.protobuf.Int64Value next_hook_id = 8;
7575

7676
/**
77-
* The number of storage slots a lambda is using.
77+
* The number of storage slots an EVM hook is using.
7878
*/
7979
uint32 num_storage_slots = 9;
8080
}
8181

8282
/**
83-
* The type of an EVM hook.
83+
* The type of a hook.
8484
*/
85-
enum EvmHookType {
85+
enum HookType {
8686
/**
87-
* A lambda EVM hook.
87+
* A general-purpose EVM hook.
8888
*/
89-
LAMBDA = 0;
89+
EVM_HOOK = 0;
9090
}
9191

9292
/**
93-
* The key of a lambda's storage slot.
94-
*
95-
* For each lambda, its EVM storage is a mapping of 256-bit keys (or "words")
93+
* The key of an EVM hook's storage slot.
94+
* For each EVM hook, its storage is a mapping of 256-bit keys (or "words")
9695
* to 256-bit values.
9796
*/
98-
message LambdaSlotKey {
97+
message EvmHookSlotKey {
9998
/**
100-
* The id of the lambda EVM hook that owns this slot.
99+
* The id of the EVM hook that owns this slot.
101100
*/
102101
proto.HookId hook_id = 1;
103102

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import "basic_types.proto";
1111
import "hook_types.proto";
1212

1313
/**
14-
* Adds or removes key/value pairs in the storage of an EVM hook. The EVM hook's owning key must sign the transaction.
14+
* Adds or removes key/value pairs in the storage of an EVM hook.
15+
* Either the hook owner's key, or its admin key, must sign the transaction.
1516
*/
1617
message HookStoreTransactionBody {
1718
/**

sdk/src/main/proto/hook_types.proto

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ message HookCreationDetails {
5959
* The hook implementation.
6060
*/
6161
oneof hook {
62-
/**
63-
* A hook programmed in EVM bytecode that may access state or interact with
64-
* external contracts.
65-
*/
62+
/**
63+
* A general-purpose hook programmed in EVM bytecode that may access state
64+
* or interact with external contracts.
65+
*/
6666
EvmHook evm_hook = 3;
6767
}
6868

@@ -75,7 +75,7 @@ message HookCreationDetails {
7575
}
7676

7777
/**
78-
* Definition of an EVM hook.
78+
* Definition of a general-purpose EVM hook.
7979
*/
8080
message EvmHook {
8181
/**
@@ -84,7 +84,7 @@ message EvmHook {
8484
EvmHookSpec spec = 1;
8585

8686
/**
87-
* Initial storage updates for the EVM hook, if any.
87+
* Initial storage updates for the hook, if any.
8888
*/
8989
repeated EvmHookStorageUpdate storage_updates = 2;
9090
}
@@ -108,6 +108,8 @@ message EvmHookSpec {
108108
* Specifies a key/value pair in the storage of an EVM hook, either by the explicit storage
109109
* slot contents; or by a combination of a Solidity mapping's slot key and the key into
110110
* that mapping.
111+
* <p>
112+
* Either the hook owner's key, or its admin key, must sign the transaction.
111113
*/
112114
message EvmHookStorageUpdate {
113115
oneof update {
@@ -150,7 +152,7 @@ message EvmHookMappingEntries {
150152
/**
151153
* An entry in a Solidity mapping. Very helpful for protocols that apply
152154
* `HookStore` to manage the entries of a hook contract's mapping instead
153-
* its raw storage slots.
155+
* of its raw storage slots.
154156
* <p>
155157
* This is especially attractive when the mapping value itself fits in a single
156158
* word; for more complicated value storage layouts it becomes necessary to

0 commit comments

Comments
 (0)