Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 05009-populate-evm-address
- Loading branch information
Showing
69 changed files
with
1,580 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
release: | ||
branching: | ||
execution: | ||
time: "17:00:00" | ||
time: "22:00:00" | ||
schedule: | ||
- on: "2023-01-27" | ||
name: release/0.35 | ||
- on: "2023-02-21" | ||
name: release/0.36 | ||
initial-tag: | ||
create: true | ||
name: v0.35.0-alpha.2 | ||
name: v0.36.0-alpha.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
autoRenew.targetTypes=CONTRACT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
ledger.id=0x00 | ||
hedera.recordStream.recordFileVersion=6 | ||
hedera.recordStream.signatureFileVersion=6 | ||
autoRenew.targetTypes=CONTRACT | ||
contracts.sidecars= | ||
hedera.recordStream.enableTraceabilityMigration=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
autoRenew.targetTypes=CONTRACT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
autoRenew.targetTypes=CONTRACT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
autoRenew.targetTypes=CONTRACT | ||
|
26 changes: 26 additions & 0 deletions
26
hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/meta/QueryContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.node.app.spi.meta; | ||
|
||
import com.google.protobuf.ByteString; | ||
|
||
/** | ||
* Provides context for query processing. | ||
*/ | ||
public interface QueryContext { | ||
ByteString getLedgerId(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
hedera-node/hedera-app/src/main/java/com/hedera/node/app/HederaApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
* Copyright (C) 2021-2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.node.app; | ||
|
||
import com.hedera.node.app.annotations.MaxSignedTxnSize; | ||
import com.hedera.node.app.components.QueryComponent; | ||
import com.hedera.node.app.service.mono.ServicesApp; | ||
import com.hedera.node.app.service.mono.config.ConfigModule; | ||
import com.hedera.node.app.service.mono.context.ContextModule; | ||
import com.hedera.node.app.service.mono.context.annotations.BootstrapProps; | ||
import com.hedera.node.app.service.mono.context.annotations.StaticAccountMemo; | ||
import com.hedera.node.app.service.mono.context.properties.*; | ||
import com.hedera.node.app.service.mono.contracts.ContractsModule; | ||
import com.hedera.node.app.service.mono.fees.FeesModule; | ||
import com.hedera.node.app.service.mono.files.FilesModule; | ||
import com.hedera.node.app.service.mono.grpc.GrpcModule; | ||
import com.hedera.node.app.service.mono.keys.KeysModule; | ||
import com.hedera.node.app.service.mono.ledger.LedgerModule; | ||
import com.hedera.node.app.service.mono.queries.QueriesModule; | ||
import com.hedera.node.app.service.mono.records.RecordsModule; | ||
import com.hedera.node.app.service.mono.sigs.SigsModule; | ||
import com.hedera.node.app.service.mono.state.StateModule; | ||
import com.hedera.node.app.service.mono.state.expiry.ExpiryModule; | ||
import com.hedera.node.app.service.mono.state.tasks.TaskModule; | ||
import com.hedera.node.app.service.mono.stats.StatsModule; | ||
import com.hedera.node.app.service.mono.store.StoresModule; | ||
import com.hedera.node.app.service.mono.throttling.ThrottlingModule; | ||
import com.hedera.node.app.service.mono.txns.TransactionsModule; | ||
import com.hedera.node.app.service.mono.txns.submission.SubmissionModule; | ||
import com.hedera.node.app.services.ServiceModule; | ||
import com.hedera.node.app.workflows.query.QueryModule; | ||
import com.swirlds.common.crypto.Cryptography; | ||
import com.swirlds.common.crypto.Hash; | ||
import com.swirlds.common.system.Platform; | ||
import dagger.BindsInstance; | ||
import dagger.Component; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import javax.inject.Provider; | ||
import javax.inject.Singleton; | ||
|
||
/** The infrastructure used to implement the platform contract for a Hedera Services node. | ||
* This is needed for adding dagger subcomponents. | ||
* Currently, it extends {@link com.hedera.node.app.service.mono.ServicesApp}. But, | ||
* in the future this class will be cleaned up to not have multiple module dependencies */ | ||
@Singleton | ||
@Component( | ||
modules = { | ||
TaskModule.class, | ||
FeesModule.class, | ||
KeysModule.class, | ||
SigsModule.class, | ||
GrpcModule.class, | ||
ConfigModule.class, | ||
StatsModule.class, | ||
StateModule.class, | ||
FilesModule.class, | ||
LedgerModule.class, | ||
StoresModule.class, | ||
ContextModule.class, | ||
RecordsModule.class, | ||
QueriesModule.class, | ||
ContractsModule.class, | ||
PropertiesModule.class, | ||
ThrottlingModule.class, | ||
SubmissionModule.class, | ||
TransactionsModule.class, | ||
ExpiryModule.class, | ||
ServiceModule.class, | ||
QueryModule.class | ||
}) | ||
public interface HederaApp extends ServicesApp { | ||
/* Needed by ServicesState */ | ||
|
||
Provider<QueryComponent.Factory> queryComponentFactory(); | ||
|
||
@Component.Builder | ||
interface Builder { | ||
@BindsInstance | ||
Builder crypto(Cryptography engine); | ||
|
||
@BindsInstance | ||
Builder initialHash(Hash initialHash); | ||
|
||
@BindsInstance | ||
Builder platform(@NonNull Platform platform); | ||
|
||
@BindsInstance | ||
Builder consoleCreator(StateModule.ConsoleCreator consoleCreator); | ||
|
||
@BindsInstance | ||
Builder selfId(long selfId); | ||
|
||
@BindsInstance | ||
Builder staticAccountMemo(@StaticAccountMemo String accountMemo); | ||
|
||
@BindsInstance | ||
Builder bootstrapProps(@BootstrapProps PropertySource bootstrapProps); | ||
|
||
@BindsInstance | ||
Builder maxSignedTxnSize(@MaxSignedTxnSize final int maxSignedTxnSize); | ||
|
||
HederaApp build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
hedera-node/hedera-app/src/main/java/com/hedera/node/app/fees/FeeAccumulator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.node.app.fees; | ||
|
||
import com.hedera.node.app.hapi.utils.fee.FeeObject; | ||
import com.hederahashgraph.api.proto.java.HederaFunctionality; | ||
import com.hederahashgraph.api.proto.java.Query; | ||
import com.hederahashgraph.api.proto.java.Timestamp; | ||
|
||
/** | ||
* Interface for fee calculation. Currently, it is only used to compute payments for Queries. It | ||
* will be enhanced to be used for transactions as well in the future. | ||
*/ | ||
public interface FeeAccumulator { | ||
FeeObject computePayment(final HederaFunctionality functionality, final Query query, Timestamp now); | ||
} |
57 changes: 57 additions & 0 deletions
57
hedera-node/hedera-app/src/main/java/com/hedera/node/app/fees/MonoFeeAccumulator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.node.app.fees; | ||
|
||
import com.hedera.node.app.hapi.utils.fee.FeeObject; | ||
import com.hedera.node.app.service.mono.context.primitives.StateView; | ||
import com.hedera.node.app.service.mono.fees.calculation.UsageBasedFeeCalculator; | ||
import com.hedera.node.app.service.mono.fees.calculation.UsagePricesProvider; | ||
import com.hedera.node.app.workflows.query.QueryWorkflow; | ||
import com.hederahashgraph.api.proto.java.HederaFunctionality; | ||
import com.hederahashgraph.api.proto.java.Query; | ||
import com.hederahashgraph.api.proto.java.Timestamp; | ||
import java.util.HashMap; | ||
import java.util.function.Supplier; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
/** | ||
* Adapter for {@link UsageBasedFeeCalculator} to be used in {@link QueryWorkflow}. This class is | ||
* currently calling mono-service code and will be replaced with a new implementation as per design. | ||
*/ | ||
@Singleton | ||
public class MonoFeeAccumulator implements FeeAccumulator { | ||
private final UsageBasedFeeCalculator feeCalculator; | ||
private final UsagePricesProvider resourceCosts; | ||
private final Supplier<StateView> stateView; | ||
|
||
@Inject | ||
public MonoFeeAccumulator( | ||
final UsageBasedFeeCalculator feeCalculator, | ||
final UsagePricesProvider resourceCosts, | ||
final Supplier<StateView> stateView) { | ||
this.feeCalculator = feeCalculator; | ||
this.resourceCosts = resourceCosts; | ||
this.stateView = stateView; | ||
} | ||
|
||
@Override | ||
public FeeObject computePayment(HederaFunctionality functionality, Query query, Timestamp now) { | ||
final var usagePrices = resourceCosts.defaultPricesGiven(functionality, now); | ||
return feeCalculator.computePayment(query, usagePrices, stateView.get(), now, new HashMap<>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.