From fca35187f8e3f66fc7a2f697e3aa2fd05bff853a Mon Sep 17 00:00:00 2001 From: Christian Lohr Date: Fri, 16 Aug 2024 18:31:05 +0200 Subject: [PATCH] feat: Pigeon Feed (#1262) # Background Things brings back the changes for Paloma `v2.0.0`. # Testing completed - [ ] test coverage exists or has been added/updated - [ ] tested in a private testnet # Breaking changes - [ ] I have checked my code for breaking changes - [ ] If there are breaking changes, there is a supporting migration. --------- Co-authored-by: Luis Carvalho Co-authored-by: Luis Carvalho --- README.md | 4 +- app/app.go | 4 +- internal/x-chain/mocks/Bridge.go | 5 +- internal/x-chain/mocks/FundCollecter.go | 6 +- .../paloma/consensus/consensus_queue.proto | 16 +- .../palomachain/paloma/consensus/query.proto | 30 +- proto/palomachain/paloma/consensus/tx.proto | 19 + proto/palomachain/paloma/evm/chain_info.proto | 2 + proto/palomachain/paloma/evm/genesis.proto | 1 + .../paloma/evm/set_fee_mgr_proposal.proto | 11 + proto/palomachain/paloma/evm/turnstone.proto | 13 +- proto/palomachain/paloma/skyway/batch.proto | 6 +- proto/palomachain/paloma/skyway/genesis.proto | 1 + proto/palomachain/paloma/skyway/msgs.proto | 30 +- proto/palomachain/paloma/skyway/query.proto | 17 + tests/integration/evm/keeper/genesis_test.go | 38 + .../evm/keeper/keeper_integration_test.go | 37 +- .../evm/keeper/test_helpers_test.go | 8 +- .../evm/keeper/testdata/sample-abi.json | 4 + .../paloma/keeper/test_helpers_test.go | 7 +- .../scheduler/keeper/keeper_test.go | 7 +- .../integration/valset/keeper/keeper_test.go | 7 +- testutil/keeper/concensus.go | 1 + util/eventbus/bus.go | 14 +- util/libcons/consensus.go | 79 +- util/liblog/liblog.go | 6 + x/consensus/keeper/cleanup.go | 4 +- x/consensus/keeper/cleanup_test.go | 2 - x/consensus/keeper/concensus_keeper.go | 148 ++- x/consensus/keeper/concensus_keeper_test.go | 76 +- x/consensus/keeper/consensus/batch.go | 15 +- x/consensus/keeper/consensus/batch_test.go | 20 +- x/consensus/keeper/consensus/consensus.go | 156 ++- .../keeper/consensus/consensus_test.go | 13 +- x/consensus/keeper/consensus/mocks/Queuer.go | 120 +- x/consensus/keeper/consensus/types.go | 10 +- x/consensus/keeper/estimate.go | 176 +++ x/consensus/keeper/estimate_test.go | 186 +++ .../keeper/filters/has_gas_estimate.go | 13 + .../keeper/filters/has_gas_estimate_test.go | 53 + .../keeper/grpc_query_messages_in_queue.go | 12 +- x/consensus/keeper/keeper.go | 17 +- x/consensus/keeper/keeper_setup_test.go | 1 + x/consensus/keeper/msg_server.go | 33 + .../keeper/msg_server_set_error_data.go | 5 + .../msg_server_set_public_access_data.go | 5 + .../query_queued_messages_for_attesting.go | 3 +- ...uery_queued_messages_for_gas_estimation.go | 39 + .../query_queued_messages_for_relaying.go | 3 +- .../query_queued_messages_for_signing.go | 27 +- x/consensus/module.go | 11 +- x/consensus/types/codec.go | 4 + x/consensus/types/consensus.go | 61 +- x/consensus/types/consensus_queue.pb.go | 501 +++++-- x/consensus/types/expected_keepers.go | 2 +- x/consensus/types/fees.go | 19 + x/consensus/types/mocks/AttestTask.go | 5 +- x/consensus/types/mocks/Attestator.go | 5 +- x/consensus/types/mocks/EvmKeeper.go | 24 +- x/consensus/types/mocks/QueryServer.go | 42 +- .../types/mocks/QueuedSignedMessageI.go | 117 +- x/consensus/types/mocks/ValsetKeeper.go | 2 +- x/consensus/types/query.pb.go | 1181 ++++++++++++++--- x/consensus/types/query.pb.gw.go | 83 ++ x/consensus/types/simple_message.go | 5 + x/consensus/types/tx.pb.go | 653 ++++++++- x/evm/client/cli/tx_deploy_smart_contract.go | 2 +- x/evm/client/cli/tx_proposal.go | 91 +- x/evm/genesis.go | 5 + x/evm/gov_handler.go | 2 + x/evm/keeper/attest.go | 14 +- x/evm/keeper/attest_submit_logic_call.go | 2 +- x/evm/keeper/attest_test.go | 129 +- x/evm/keeper/attest_update_valset.go | 2 +- x/evm/keeper/attest_upload_smart_contract.go | 214 +-- .../attest_upload_smart_contract_test.go | 5 + x/evm/keeper/errors.go | 1 + x/evm/keeper/keeper.go | 85 +- x/evm/keeper/keeper_test.go | 114 +- ...r_remove_smart_contract_deployment_test.go | 5 +- x/evm/keeper/smart_contract_deployment.go | 31 +- x/evm/keeper/testdata/sample-abi.json | 425 +++++- x/evm/keeper/testdata/sample-bytecode.out | 2 +- x/evm/keeper/testdata/slc-tx-data.hex | 2 +- x/evm/keeper/testdata/usc-abi.json | 546 ++++++++ x/evm/keeper/testdata/usc-bytecode.out | 1 + .../{sample-tx-raw.hex => usc-tx-raw.hex} | 0 x/evm/keeper/testdata/valset-tx-data.hex | 2 +- x/evm/types/chain_info.pb.go | 191 ++- x/evm/types/codec.go | 2 + x/evm/types/eth_txable.go | 24 + x/evm/types/genesis.pb.go | 142 +- x/evm/types/gov_proposals.go | 14 + x/evm/types/mocks/MsgSender.go | 12 +- x/evm/types/msg_sender.go | 2 +- x/evm/types/set_fee_mgr_proposal.pb.go | 486 +++++++ x/evm/types/turnstone.pb.go | 451 ++++++- x/evm/types/turnstone_abi.go | 132 +- x/metrix/types/mocks/SlashingKeeper.go | 79 ++ x/metrix/types/mocks/StakingKeeper.go | 107 ++ x/scheduler/types/expected_keepers.go | 2 +- x/scheduler/types/mocks/AccountKeeper.go | 5 +- x/scheduler/types/mocks/BankKeeper.go | 51 + x/scheduler/types/mocks/EvmKeeper.go | 21 +- x/scheduler/types/mocks/Keeper.go | 5 +- x/scheduler/types/mocks/ValsetKeeper.go | 61 + x/skyway/abci.go | 88 +- x/skyway/abci_test.go | 162 ++- x/skyway/keeper/attestation.go | 37 +- x/skyway/keeper/batch.go | 94 +- x/skyway/keeper/genesis.go | 29 +- x/skyway/keeper/grpc_query.go | 41 + x/skyway/keeper/grpc_query_test.go | 27 + x/skyway/keeper/invariants.go | 15 +- x/skyway/keeper/keeper.go | 34 + x/skyway/keeper/keeper_estimates.go | 133 ++ x/skyway/keeper/msg_server.go | 83 +- x/skyway/keeper/test_common.go | 1 + x/skyway/module.go | 23 +- x/skyway/types/batch.go | 111 +- x/skyway/types/batch.pb.go | 232 +++- x/skyway/types/batch_test.go | 12 +- x/skyway/types/codec.go | 5 +- x/skyway/types/expected_keepers.go | 2 +- x/skyway/types/genesis.go | 1 + x/skyway/types/genesis.pb.go | 184 ++- x/skyway/types/key.go | 31 +- x/skyway/types/key_test.go | 12 +- x/skyway/types/legacy_msgs.go | 2 + x/skyway/types/msgs.go | 54 +- x/skyway/types/msgs.pb.go | 739 +++++++++-- x/skyway/types/query.pb.go | 887 +++++++++++-- x/skyway/types/query.pb.gw.go | 101 +- .../client/cli/query_get_relayer_fee.go | 3 + x/treasury/keeper/keeper.go | 54 + x/valset/types/mocks/QueryServer.go | 2 +- x/valset/types/mocks/SlashingKeeper.go | 5 +- x/valset/types/mocks/StakingKeeper.go | 5 +- x/valset/types/mocks/ValidatorI.go | 5 +- 139 files changed, 9490 insertions(+), 1416 deletions(-) create mode 100644 proto/palomachain/paloma/evm/set_fee_mgr_proposal.proto create mode 100644 x/consensus/keeper/estimate.go create mode 100644 x/consensus/keeper/estimate_test.go create mode 100644 x/consensus/keeper/filters/has_gas_estimate.go create mode 100644 x/consensus/keeper/filters/has_gas_estimate_test.go create mode 100644 x/consensus/keeper/query_queued_messages_for_gas_estimation.go create mode 100644 x/consensus/types/fees.go create mode 100644 x/evm/keeper/testdata/usc-abi.json create mode 100644 x/evm/keeper/testdata/usc-bytecode.out rename x/evm/keeper/testdata/{sample-tx-raw.hex => usc-tx-raw.hex} (100%) create mode 100644 x/evm/types/set_fee_mgr_proposal.pb.go create mode 100644 x/metrix/types/mocks/SlashingKeeper.go create mode 100644 x/metrix/types/mocks/StakingKeeper.go create mode 100644 x/scheduler/types/mocks/BankKeeper.go create mode 100644 x/scheduler/types/mocks/ValsetKeeper.go create mode 100644 x/skyway/keeper/keeper_estimates.go diff --git a/README.md b/README.md index 9b268a50..7927d9a3 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ rm -r ~/.paloma/data/wasm/cache ### To get the latest prebuilt `palomad` binary ```shell -wget -O - https://github.com/palomachain/paloma/releases/download/v1.15.7/paloma_Linux_x86_64.tar.gz | \ +wget -O - https://github.com/palomachain/paloma/releases/download/v2.0.0/paloma_Linux_x86_64.tar.gz | \ sudo tar -C /usr/local/bin -xvzf - palomad sudo chmod +x /usr/local/bin/palomad ``` @@ -108,7 +108,7 @@ sudo chmod +x /usr/local/bin/palomad ```shell git clone https://github.com/palomachain/paloma.git cd paloma -git checkout v1.15.7 +git checkout v2.0.0 make build sudo mv ./build/palomad /usr/local/bin/palomad ``` diff --git a/app/app.go b/app/app.go index c65aabe6..ae85609d 100644 --- a/app/app.go +++ b/app/app.go @@ -120,6 +120,7 @@ import ( palomamempool "github.com/palomachain/paloma/app/mempool" chainparams "github.com/palomachain/paloma/app/params" xchain "github.com/palomachain/paloma/internal/x-chain" + "github.com/palomachain/paloma/util/libcons" consensusmodule "github.com/palomachain/paloma/x/consensus" consensusmodulekeeper "github.com/palomachain/paloma/x/consensus/keeper" consensusmoduletypes "github.com/palomachain/paloma/x/consensus/types" @@ -574,6 +575,7 @@ func New( app.GetSubspace(consensusmoduletypes.ModuleName), app.ValsetKeeper, consensusRegistry, + &app.TreasuryKeeper, ) app.EvmKeeper = *evmmodulekeeper.NewKeeper( @@ -786,7 +788,7 @@ func New( valsetModule := valsetmodule.NewAppModule(appCodec, app.ValsetKeeper, app.AccountKeeper, app.BankKeeper) schedulerModule := schedulermodule.NewAppModule(appCodec, app.SchedulerKeeper, app.AccountKeeper, app.BankKeeper) palomaModule := palomamodule.NewAppModule(appCodec, app.PalomaKeeper, app.AccountKeeper, app.BankKeeper) - skywayModule := skywaymodule.NewAppModule(appCodec, app.SkywayKeeper, app.BankKeeper, app.GetSubspace(skywaymoduletypes.ModuleName)) + skywayModule := skywaymodule.NewAppModule(appCodec, app.SkywayKeeper, app.BankKeeper, app.GetSubspace(skywaymoduletypes.ModuleName), libcons.New(app.ValsetKeeper.GetCurrentSnapshot, appCodec)) treasuryModule := treasurymodule.NewAppModule(appCodec, app.TreasuryKeeper, app.AccountKeeper, app.BankKeeper) metrixModule := metrix.NewAppModule(appCodec, app.MetrixKeeper) diff --git a/internal/x-chain/mocks/Bridge.go b/internal/x-chain/mocks/Bridge.go index bde79219..5cf613b2 100644 --- a/internal/x-chain/mocks/Bridge.go +++ b/internal/x-chain/mocks/Bridge.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -103,7 +103,8 @@ func (_m *Bridge) XChainType() string { func NewBridge(t interface { mock.TestingT Cleanup(func()) -}) *Bridge { +}, +) *Bridge { mock := &Bridge{} mock.Mock.Test(t) diff --git a/internal/x-chain/mocks/FundCollecter.go b/internal/x-chain/mocks/FundCollecter.go index ff75bb10..7941a98c 100644 --- a/internal/x-chain/mocks/FundCollecter.go +++ b/internal/x-chain/mocks/FundCollecter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.3. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -16,6 +16,10 @@ type FundCollecter struct { func (_m *FundCollecter) CollectJobFundEvents(ctx types.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for CollectJobFundEvents") + } + var r0 error if rf, ok := ret.Get(0).(func(types.Context) error); ok { r0 = rf(ctx) diff --git a/proto/palomachain/paloma/consensus/consensus_queue.proto b/proto/palomachain/paloma/consensus/consensus_queue.proto index 49c04e5b..39eb5447 100644 --- a/proto/palomachain/paloma/consensus/consensus_queue.proto +++ b/proto/palomachain/paloma/consensus/consensus_queue.proto @@ -11,6 +11,9 @@ option go_package = "github.com/palomachain/paloma/x/consensus/types"; // message for storing the queued signed message in the internal queue message QueuedSignedMessage { + reserved 5; + reserved "bytesToSign"; + option (gogoproto.goproto_stringer) = false; uint64 id = 1; @@ -18,7 +21,6 @@ message QueuedSignedMessage { google.protobuf.Timestamp addedAt = 3 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; google.protobuf.Any msg = 4; - bytes bytesToSign = 5; repeated SignData signData = 6; repeated Evidence evidence = 7; PublicAccessData publicAccessData = 8; @@ -33,6 +35,12 @@ message QueuedSignedMessage { (amino.dont_omitempty) = true, (gogoproto.nullable) = true ]; + + repeated GasEstimate gasEstimates = 12; + // flagMask is a bitmask of flags that the message has. + // 1 = require gas estimate + uint32 flagMask = 13; + uint64 gasEstimate = 14; } message BatchOfConsensusMessages { google.protobuf.Any msg = 1; } @@ -60,6 +68,12 @@ message Evidence { google.protobuf.Any proof = 2; } +message GasEstimate { + bytes valAddress = 1 [ (gogoproto.casttype) = + "github.com/cosmos/cosmos-sdk/types.ValAddress" ]; + uint64 value = 2; +} + message PublicAccessData { bytes valAddress = 1 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress" ]; diff --git a/proto/palomachain/paloma/consensus/query.proto b/proto/palomachain/paloma/consensus/query.proto index 398b8c43..cc1494ab 100644 --- a/proto/palomachain/paloma/consensus/query.proto +++ b/proto/palomachain/paloma/consensus/query.proto @@ -29,6 +29,13 @@ service Query { "/palomachain/paloma/consensus/queued_messages_for_relaying"; } + // Queries a list of QueuedMessagesForGasEstimation items. + rpc QueuedMessagesForGasEstimation(QueryQueuedMessagesForGasEstimationRequest) + returns (QueryQueuedMessagesForGasEstimationResponse) { + option (google.api.http).get = + "/palomachain/paloma/consensus/queued_messages_for_gas_estimation"; + } + // Queries a list of QueuedMessagesForAttesting items. rpc QueuedMessagesForAttesting(QueryQueuedMessagesForAttestingRequest) returns (QueryQueuedMessagesForAttestingResponse) { @@ -45,7 +52,7 @@ service Query { // Queries one message by ID. rpc MessageByID(QueryMessageByIDRequest) - returns (MessageWithSignatures) { + returns (MessageQueryResult) { option (google.api.http).get = "/palomachain/paloma/consensus/{queueTypeName}/message/{id}"; } @@ -95,6 +102,9 @@ message ValidatorSignature { } message MessageWithSignatures { + reserved 8; + reserved "evidence"; + bytes nonce = 1; uint64 id = 2; google.protobuf.Any msg = 3; @@ -102,8 +112,14 @@ message MessageWithSignatures { bytes bytesToSign = 5; bytes publicAccessData = 6; bytes errorData = 7; - repeated Evidence evidence = 8; uint64 valsetID = 9; + uint64 gasEstimate = 10; +} + +message MessageQueryResult { + MessageWithSignatures message = 1; + repeated Evidence evidence = 2; + repeated GasEstimate gasEstimates = 3; } message QueryMessageByIDRequest { @@ -145,3 +161,13 @@ message QueryQueuedMessagesForAttestingResponse { message QueryGetAllQueueNamesRequest {} message QueryGetAllQueueNamesResponse { repeated string queues = 1; } + +message QueryQueuedMessagesForGasEstimationRequest { + string queueTypeName = 1; + bytes valAddress = 2 [ (gogoproto.casttype) = + "github.com/cosmos/cosmos-sdk/types.ValAddress" ]; +} + +message QueryQueuedMessagesForGasEstimationResponse { + repeated MessageWithSignatures messagesToEstimate = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/palomachain/paloma/consensus/tx.proto b/proto/palomachain/paloma/consensus/tx.proto index fe6fd2f5..fac59f93 100644 --- a/proto/palomachain/paloma/consensus/tx.proto +++ b/proto/palomachain/paloma/consensus/tx.proto @@ -4,6 +4,8 @@ import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; import "google/protobuf/any.proto"; import "palomachain/paloma/valset/common.proto"; +import "google/protobuf/empty.proto"; + package palomachain.paloma.consensus; option go_package = "github.com/palomachain/paloma/x/consensus/types"; @@ -12,6 +14,8 @@ option go_package = "github.com/palomachain/paloma/x/consensus/types"; service Msg { rpc AddMessagesSignatures(MsgAddMessagesSignatures) returns (MsgAddMessagesSignaturesResponse); + rpc AddMessageEstimates(MsgAddMessageGasEstimates) + returns (google.protobuf.Empty); rpc AddEvidence(MsgAddEvidence) returns (MsgAddEvidenceResponse); rpc SetPublicAccessData(MsgSetPublicAccessData) returns (MsgSetPublicAccessDataResponse); @@ -75,3 +79,18 @@ message MsgSetErrorData { } message MsgSetErrorDataResponse {} + +message MsgAddMessageGasEstimates { + message GasEstimate { + uint64 msg_id = 1; + string queueTypeName = 2; + uint64 value = 3; + string estimatedByAddress = 5; + } + option (cosmos.msg.v1.signer) = "metadata"; + palomachain.paloma.valset.MsgMetadata metadata = 1 + [ (gogoproto.nullable) = false ]; + + repeated GasEstimate estimates = 2; +} + diff --git a/proto/palomachain/paloma/evm/chain_info.proto b/proto/palomachain/paloma/evm/chain_info.proto index f3e81643..e054eaae 100644 --- a/proto/palomachain/paloma/evm/chain_info.proto +++ b/proto/palomachain/paloma/evm/chain_info.proto @@ -37,6 +37,8 @@ message ChainInfo { string minOnChainBalance = 12; RelayWeights relayWeights = 13; + + string feeManagerAddr = 14; } message SmartContract { diff --git a/proto/palomachain/paloma/evm/genesis.proto b/proto/palomachain/paloma/evm/genesis.proto index e2c43a90..cb351441 100644 --- a/proto/palomachain/paloma/evm/genesis.proto +++ b/proto/palomachain/paloma/evm/genesis.proto @@ -23,6 +23,7 @@ message GenesisChainInfo { string blockHashAtHeight = 4; string minOnChainBalance = 5; RelayWeights relayWeights = 6; + string feeManagerAddr = 7; } message GenesisSmartContract { diff --git a/proto/palomachain/paloma/evm/set_fee_mgr_proposal.proto b/proto/palomachain/paloma/evm/set_fee_mgr_proposal.proto new file mode 100644 index 00000000..00bec34a --- /dev/null +++ b/proto/palomachain/paloma/evm/set_fee_mgr_proposal.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package palomachain.paloma.evm; + +option go_package = "github.com/palomachain/paloma/x/evm/types"; + +message SetFeeManagerAddressProposal { + string title = 1; + string summary = 2; + string chainReferenceID = 3; + string feeManagerAddress = 4; +} diff --git a/proto/palomachain/paloma/evm/turnstone.proto b/proto/palomachain/paloma/evm/turnstone.proto index 535fc762..27373bf7 100644 --- a/proto/palomachain/paloma/evm/turnstone.proto +++ b/proto/palomachain/paloma/evm/turnstone.proto @@ -16,6 +16,11 @@ message Valset { message SubmitLogicCall { message ExecutionRequirements { bool enforceMEVRelay = 1; } + message Fees { + uint64 relayerFee = 1; + uint64 communityFee = 2; + uint64 securityFee = 3; + } string hexContractAddress = 1; bytes abi = 2; bytes payload = 3; @@ -25,9 +30,13 @@ message SubmitLogicCall { ExecutionRequirements executionRequirements = 7 [ (gogoproto.nullable) = false ]; uint32 retries = 8; + Fees fees = 10 + [ (gogoproto.nullable) = true ]; } -message UpdateValset { Valset valset = 1; } +message UpdateValset { + Valset valset = 1; +} message UploadSmartContract { bytes bytecode = 1; @@ -63,6 +72,8 @@ message Message { (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; + + string assigneeRemoteAddress = 10; } message TxExecutedProof { bytes serializedTX = 1; } diff --git a/proto/palomachain/paloma/skyway/batch.proto b/proto/palomachain/paloma/skyway/batch.proto index c63e0b7d..a1fdd188 100644 --- a/proto/palomachain/paloma/skyway/batch.proto +++ b/proto/palomachain/paloma/skyway/batch.proto @@ -6,7 +6,7 @@ import "palomachain/paloma/skyway/attestation.proto"; option go_package = "github.com/palomachain/paloma/x/skyway/types"; -// OutgoingTxBatch represents a batch of transactions going from skyway to ETH +// OutgoingTxBatch represents a batch of transactions going from Paloma to remote chain message OutgoingTxBatch { uint64 batch_nonce = 1; uint64 batch_timeout = 2; @@ -16,9 +16,11 @@ message OutgoingTxBatch { string chain_reference_id = 6; bytes bytes_to_sign = 7; string assignee = 8; + uint64 gas_estimate = 9; + bytes assignee_remote_address = 10; } -// OutgoingTransferTx represents an individual send from skyway to ETH +// OutgoingTransferTx represents an individual send from Paloma to remote chain message OutgoingTransferTx { uint64 id = 1; string sender = 2; diff --git a/proto/palomachain/paloma/skyway/genesis.proto b/proto/palomachain/paloma/skyway/genesis.proto index 5044f34e..21cf7fb5 100644 --- a/proto/palomachain/paloma/skyway/genesis.proto +++ b/proto/palomachain/paloma/skyway/genesis.proto @@ -24,6 +24,7 @@ message GenesisState { repeated SkywayNonces skyway_nonces = 2 [ (gogoproto.nullable) = false ]; repeated OutgoingTxBatch batches = 3 [ (gogoproto.nullable) = false ]; repeated MsgConfirmBatch batch_confirms = 4 [ (gogoproto.nullable) = false ]; + repeated MsgEstimateBatchGas batch_gas_estimates = 5 [ (gogoproto.nullable) = false ]; repeated Attestation attestations = 7 [ (gogoproto.nullable) = false ]; repeated ERC20ToDenom erc20_to_denoms = 9 [ (gogoproto.nullable) = false ]; repeated OutgoingTransferTx unbatched_transfers = 10 diff --git a/proto/palomachain/paloma/skyway/msgs.proto b/proto/palomachain/paloma/skyway/msgs.proto index ae0a5259..d6952493 100644 --- a/proto/palomachain/paloma/skyway/msgs.proto +++ b/proto/palomachain/paloma/skyway/msgs.proto @@ -18,6 +18,8 @@ option go_package = "github.com/palomachain/paloma/x/skyway/types"; service Msg { rpc SendToRemote(MsgSendToRemote) returns (MsgSendToRemoteResponse) {} rpc ConfirmBatch(MsgConfirmBatch) returns (MsgConfirmBatchResponse) {} + rpc EstimateBatchGas(MsgEstimateBatchGas) + returns (google.protobuf.Empty) {} rpc SendToPalomaClaim(MsgSendToPalomaClaim) returns (MsgSendToPalomaClaimResponse) {} rpc BatchSendToRemoteClaim(MsgBatchSendToRemoteClaim) @@ -51,8 +53,7 @@ message MsgSendToRemote { [ (gogoproto.nullable) = false ]; } -message MsgSendToRemoteResponse { -} +message MsgSendToRemoteResponse {} // MsgConfirmBatch // When validators observe a MsgRequestBatch they form a batch by ordering @@ -97,6 +98,7 @@ message MsgSendToPalomaClaim { palomachain.paloma.valset.MsgMetadata metadata = 9 [ (gogoproto.nullable) = false ]; uint64 skyway_nonce = 10; + string compass_id = 11; } message MsgSendToPalomaClaimResponse { @@ -115,10 +117,10 @@ message MsgBatchSendToRemoteClaim { palomachain.paloma.valset.MsgMetadata metadata = 7 [ (gogoproto.nullable) = false ]; uint64 skyway_nonce = 8; + string compass_id = 9; } -message MsgBatchSendToRemoteClaimResponse { -} +message MsgBatchSendToRemoteClaimResponse {} // This call allows the sender (and only the sender) // to cancel a given MsgSendToRemote and recieve a refund @@ -132,8 +134,7 @@ message MsgCancelSendToRemote { [ (gogoproto.nullable) = false ]; } -message MsgCancelSendToRemoteResponse { -} +message MsgCancelSendToRemoteResponse {} // This call allows anyone to submit evidence that a // validator has signed a batch that never @@ -142,7 +143,7 @@ message MsgCancelSendToRemoteResponse { message MsgSubmitBadSignatureEvidence { option (cosmos.msg.v1.signer) = "metadata"; google.protobuf.Any subject = 1 - [ (cosmos_proto.accepts_interface) = "RemoteereumSigned" ]; + [ (cosmos_proto.accepts_interface) = "RemoteSigned" ]; string signature = 2; string sender = 3 [ deprecated = true ]; string chain_reference_id = 4; @@ -241,4 +242,19 @@ message MsgLightNodeSaleClaim { (gogoproto.nullable) = false ]; string smart_contract_address = 9; + string compass_id = 10; +} + +// MsgEstimateBatchGas is a message to estimate the gas for a batch +// Pigeons will send this message to transmit their gas estimation +// for a given batch. +message MsgEstimateBatchGas { + option (cosmos.msg.v1.signer) = "metadata"; + palomachain.paloma.valset.MsgMetadata metadata = 1 + [ (gogoproto.nullable) = false ]; + + uint64 nonce = 2; + string token_contract = 3; + string eth_signer = 4; + uint64 estimate = 5; } diff --git a/proto/palomachain/paloma/skyway/query.proto b/proto/palomachain/paloma/skyway/query.proto index 07f96ab8..4b521705 100644 --- a/proto/palomachain/paloma/skyway/query.proto +++ b/proto/palomachain/paloma/skyway/query.proto @@ -62,6 +62,12 @@ service Query { option (google.api.http).get = "/palomachain/paloma/skyway/light_node_sale_contracts"; } + + rpc LastPendingBatchForGasEstimation(QueryLastPendingBatchForGasEstimationRequest) + returns (QueryLastPendingBatchForGasEstimationResponse) { + option (google.api.http).get = + "/palomachain/paloma/skyway/pending_batch_for_gas_estimation"; + } } message QueryParamsRequest {} @@ -184,3 +190,14 @@ message QueryBridgeTransferLimitsResponse { message QueryLightNodeSaleContractsResponse { repeated LightNodeSaleContract light_node_sale_contracts = 1; } + +message QueryLastPendingBatchForGasEstimationRequest { + // Address of the asking to estimate + bytes address = 1 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress" ]; + // Chain reference id of the remote chain to query for + string chain_reference_id = 2; +} + +message QueryLastPendingBatchForGasEstimationResponse { + repeated OutgoingTxBatch batch = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/tests/integration/evm/keeper/genesis_test.go b/tests/integration/evm/keeper/genesis_test.go index 8f151e6c..e3ab3712 100644 --- a/tests/integration/evm/keeper/genesis_test.go +++ b/tests/integration/evm/keeper/genesis_test.go @@ -71,6 +71,8 @@ var _ = g.Describe("genesis", func() { []byte("abc"), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, ci.ChainReferenceID, cDummyFeeMgrAddress) + require.NoError(t, err) } } got := evm.ExportGenesis(ctx, *k) @@ -92,6 +94,7 @@ var _ = g.Describe("genesis", func() { BlockHeight: 123, BlockHashAtHeight: "0x1234", MinOnChainBalance: "555", + FeeManagerAddr: cDummyFeeMgrAddress, RelayWeights: &types.RelayWeights{ Fee: "1.0", Uptime: "1.0", @@ -106,6 +109,7 @@ var _ = g.Describe("genesis", func() { BlockHeight: 124, BlockHashAtHeight: "0x5555", MinOnChainBalance: "555", + FeeManagerAddr: cDummyFeeMgrAddress, RelayWeights: &types.RelayWeights{ Fee: "1.0", Uptime: "1.0", @@ -132,6 +136,39 @@ var _ = g.Describe("genesis", func() { BlockHeight: 123, BlockHashAtHeight: "0x1234", MinOnChainBalance: "123invalid", + FeeManagerAddr: cDummyFeeMgrAddress, + RelayWeights: &types.RelayWeights{ + Fee: "1.0", + Uptime: "1.0", + SuccessRate: "1.0", + ExecutionTime: "1.0", + FeatureSet: "1.0", + }, + }, + } + Expect(func() { + evm.InitGenesis(ctx, *k, genesisState) + }).Should(Panic()) + }) + }) + + g.Context("invalid fee manager address", func() { + g.It("panics if the fee manager address is invalid", func() { + genesisState.Chains = []*types.GenesisChainInfo{ + { + ChainReferenceID: "eth-main", + ChainID: 1, + BlockHeight: 123, + BlockHashAtHeight: "0x1234", + MinOnChainBalance: "555", + FeeManagerAddr: "123invalid", + RelayWeights: &types.RelayWeights{ + Fee: "1.0", + Uptime: "1.0", + SuccessRate: "1.0", + ExecutionTime: "1.0", + FeatureSet: "1.0", + }, }, } Expect(func() { @@ -149,6 +186,7 @@ var _ = g.Describe("genesis", func() { BlockHeight: 123, BlockHashAtHeight: "0x1234", MinOnChainBalance: "555", + FeeManagerAddr: cDummyFeeMgrAddress, }, } diff --git a/tests/integration/evm/keeper/keeper_integration_test.go b/tests/integration/evm/keeper/keeper_integration_test.go index 9942b247..72dee982 100644 --- a/tests/integration/evm/keeper/keeper_integration_test.go +++ b/tests/integration/evm/keeper/keeper_integration_test.go @@ -31,6 +31,8 @@ import ( "github.com/stretchr/testify/require" ) +const cDummyFeeMgrAddress = "0xb794f5ea0ba39494ce839613fffba74279579268" + var ( contractAbi = string(whoops.Must(os.ReadFile("testdata/sample-abi.json"))) contractBytecodeStr = string(whoops.Must(os.ReadFile("testdata/sample-bytecode.out"))) @@ -63,6 +65,8 @@ func TestEndToEndForEvmArbitraryCall(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) err = f.evmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, "addr", []byte("abc")) require.NoError(t, err) @@ -149,10 +153,13 @@ func TestEndToEndForEvmArbitraryCall(t *testing.T) { require.NoError(t, err) for _, msg := range msgs { + bytesToSign, err := msg.GetBytesToSign(f.codec) + require.NoError(t, err) + sigbz, err := crypto.Sign( crypto.Keccak256( []byte(keeper.SignaturePrefix), - msg.GetBytesToSign(), + bytesToSign, ), private, ) @@ -197,6 +204,8 @@ func TestFirstSnapshot_OnSnapshotBuilt(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) err = f.evmKeeper.ActivateChainReferenceID( ctx, newChain.ChainReferenceID, @@ -268,6 +277,8 @@ func TestRecentPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { newChain.GetBlockHashAtHeight(), big.NewInt(55), ) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) require.NoError(t, err) err = f.evmKeeper.ActivateChainReferenceID( ctx, @@ -375,6 +386,8 @@ func TestOldPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) err = f.evmKeeper.ActivateChainReferenceID( ctx, newChain.ChainReferenceID, @@ -511,6 +524,8 @@ func TestAddingSupportForNewChain(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) gotChainInfo, err := f.evmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) require.NoError(t, err) @@ -616,6 +631,8 @@ func TestKeeper_ValidatorSupportsAllChains(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) err = a.evmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) require.NoError(t, err) @@ -670,6 +687,8 @@ func TestKeeper_ValidatorSupportsAllChains(t *testing.T) { big.NewInt(55), ) require.NoError(t, err) + err = f.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) err = a.evmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) require.NoError(t, err) @@ -862,6 +881,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, chain1.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) By("adding chain2 works") err = a.evmKeeper.AddSupportForNewChain( @@ -873,6 +894,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, chain2.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) }) Context("adding smart contract", func() { @@ -1020,6 +1043,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + require.NoError(t, err) sc, err := a.evmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) Expect(err).To(BeNil()) @@ -1076,6 +1101,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, "new-chain", cDummyFeeMgrAddress) + require.NoError(t, err) }) It("tries to deploy a smart contract to it", func() { @@ -1106,6 +1133,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, "new-chain", cDummyFeeMgrAddress) + require.NoError(t, err) err = a.evmKeeper.ActivateChainReferenceID(ctx, "new-chain", &types.SmartContract{Id: 123}, "addr", []byte("abc")) Expect(err).To(BeNil()) for _, val := range validators { @@ -1201,6 +1230,8 @@ var _ = Describe("evm", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, newChain.ChainReferenceID, cDummyFeeMgrAddress) + require.NoError(t, err) sc, err := a.evmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) Expect(err).To(BeNil()) err = a.evmKeeper.SetAsCompassContract(ctx, sc) @@ -1238,6 +1269,8 @@ var _ = Describe("change min on chain balance", func() { BeforeEach(func() { err := a.evmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, newChain.ChainReferenceID, cDummyFeeMgrAddress) + require.NoError(t, err) }) BeforeEach(func() { @@ -1289,6 +1322,8 @@ var _ = Describe("change relay weights", func() { BeforeEach(func() { err := a.evmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) Expect(err).To(BeNil()) + err = a.evmKeeper.SetFeeManagerAddress(ctx, newChain.ChainReferenceID, cDummyFeeMgrAddress) + require.NoError(t, err) }) BeforeEach(func() { diff --git a/tests/integration/evm/keeper/test_helpers_test.go b/tests/integration/evm/keeper/test_helpers_test.go index a38c13f0..85b6d639 100644 --- a/tests/integration/evm/keeper/test_helpers_test.go +++ b/tests/integration/evm/keeper/test_helpers_test.go @@ -214,16 +214,18 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), ) consensusRegistry := consensusmodulekeeper.NewRegistry() + tk := treasurykeeper.Keeper{} consensusKeeper := *consensusmodulekeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[consensusmoduletypes.StoreKey]), helper.GetSubspace(consensusmoduletypes.ModuleName, paramsKeeper), valsetKeeper, consensusRegistry, + &tk, ) var evmKeeper *evmmodulekeeper.Keeper = &evmmodulekeeper.Keeper{} - treasurykeeper := *treasurykeeper.NewKeeper( + tk = *treasurykeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[treasurymoduletypes.StoreKey]), helper.GetSubspace(treasurymoduletypes.ModuleName, paramsKeeper), @@ -246,7 +248,7 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { valsetKeeper, authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), &metrixKeeper, - treasurykeeper, + tk, ) capabilityKeeper := capabilitykeeper.NewKeeper( appCodec, @@ -389,6 +391,6 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { evmKeeper: *evmKeeper, stakingKeeper: *stakingKeeper, metrixKeeper: &metrixKeeper, - treasuryKeeper: &treasurykeeper, + treasuryKeeper: &tk, } } diff --git a/tests/integration/evm/keeper/testdata/sample-abi.json b/tests/integration/evm/keeper/testdata/sample-abi.json index 92930a1e..1e4f1a24 100644 --- a/tests/integration/evm/keeper/testdata/sample-abi.json +++ b/tests/integration/evm/keeper/testdata/sample-abi.json @@ -180,6 +180,10 @@ ], "name": "valset", "type": "tuple" + }, + { + "name": "_fee_manager", + "type": "address" } ], "stateMutability": "nonpayable", diff --git a/tests/integration/paloma/keeper/test_helpers_test.go b/tests/integration/paloma/keeper/test_helpers_test.go index 03c79fd5..4481d6de 100644 --- a/tests/integration/paloma/keeper/test_helpers_test.go +++ b/tests/integration/paloma/keeper/test_helpers_test.go @@ -182,15 +182,18 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), ) consensusRegistry := consensusmodulekeeper.NewRegistry() + tk := treasurykeeper.Keeper{} consensusKeeper := *consensusmodulekeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[consensusmoduletypes.StoreKey]), helper.GetSubspace(consensusmoduletypes.ModuleName, paramsKeeper), valsetKeeper, consensusRegistry, + &tk, ) + var evmKeeper *evmmodulekeeper.Keeper = &evmmodulekeeper.Keeper{} - treasurykeeper := *treasurykeeper.NewKeeper( + tk = *treasurykeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[treasurymoduletypes.StoreKey]), helper.GetSubspace(treasurymoduletypes.ModuleName, paramsKeeper), @@ -213,7 +216,7 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { valsetKeeper, authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), metrixKeeper, - treasurykeeper, + tk, ) consensusRegistry.Add( evmKeeper, diff --git a/tests/integration/scheduler/keeper/keeper_test.go b/tests/integration/scheduler/keeper/keeper_test.go index 7b40e996..f8e21aa8 100644 --- a/tests/integration/scheduler/keeper/keeper_test.go +++ b/tests/integration/scheduler/keeper/keeper_test.go @@ -156,15 +156,18 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), ) consensusRegistry := consensusmodulekeeper.NewRegistry() + tk := treasurykeeper.Keeper{} consensusKeeper := *consensusmodulekeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[consensusmoduletypes.StoreKey]), helper.GetSubspace(consensusmoduletypes.ModuleName, paramsKeeper), valsetKeeper, consensusRegistry, + &tk, ) + var evmKeeper *evmmodulekeeper.Keeper = &evmmodulekeeper.Keeper{} - treasurykeeper := *treasurykeeper.NewKeeper( + tk = *treasurykeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[treasurymoduletypes.StoreKey]), helper.GetSubspace(treasurymoduletypes.ModuleName, paramsKeeper), @@ -187,7 +190,7 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { valsetKeeper, authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), metrixKeeper, - treasurykeeper, + tk, ) schedulerKeeper := *keeper.NewKeeper( diff --git a/tests/integration/valset/keeper/keeper_test.go b/tests/integration/valset/keeper/keeper_test.go index c4d20dda..f74d4884 100644 --- a/tests/integration/valset/keeper/keeper_test.go +++ b/tests/integration/valset/keeper/keeper_test.go @@ -145,15 +145,18 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), ) consensusRegistry := consensusmodulekeeper.NewRegistry() + tk := treasurykeeper.Keeper{} consensusKeeper := *consensusmodulekeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[consensusmoduletypes.StoreKey]), helper.GetSubspace(consensusmoduletypes.ModuleName, paramsKeeper), valsetKeeper, consensusRegistry, + &tk, ) + var evmKeeper *evmmodulekeeper.Keeper = &evmmodulekeeper.Keeper{} - treasurykeeper := *treasurykeeper.NewKeeper( + tk = *treasurykeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[treasurymoduletypes.StoreKey]), helper.GetSubspace(treasurymoduletypes.ModuleName, paramsKeeper), @@ -176,7 +179,7 @@ func initFixture(t ginkgo.FullGinkgoTInterface) *fixture { valsetKeeper, authcodec.NewBech32Codec(params2.ValidatorAddressPrefix), metrixKeeper, - treasurykeeper, + tk, ) SlashingKeeper := slashingkeeper.NewKeeper( diff --git a/testutil/keeper/concensus.go b/testutil/keeper/concensus.go index 0b47ca50..69180664 100644 --- a/testutil/keeper/concensus.go +++ b/testutil/keeper/concensus.go @@ -47,6 +47,7 @@ func ConsensusKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { paramsSubspace, mocks.NewValsetKeeper(t), keeper.NewRegistry(), + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, logger) diff --git a/util/eventbus/bus.go b/util/eventbus/bus.go index 24944852..61ce56a8 100644 --- a/util/eventbus/bus.go +++ b/util/eventbus/bus.go @@ -8,7 +8,10 @@ import ( "github.com/palomachain/paloma/util/liblog" ) -var skywayBatchBuilt = newEvent[SkywayBatchBuiltEvent]() +var ( + skywayBatchBuilt = newEvent[SkywayBatchBuiltEvent]() + evmActivatedChain = newEvent[EVMActivatedChainEvent]() +) type ( EventHandler[E any] func(context.Context, E) error @@ -58,3 +61,12 @@ type SkywayBatchBuiltEvent struct { func SkywayBatchBuilt() *Event[SkywayBatchBuiltEvent] { return &skywayBatchBuilt } + +type EVMActivatedChainEvent struct { + ChainReferenceID string + SmartContractUniqueID []byte +} + +func EVMActivatedChain() *Event[EVMActivatedChainEvent] { + return &evmActivatedChain +} diff --git a/util/libcons/consensus.go b/util/libcons/consensus.go index 24dab255..d7b0e327 100644 --- a/util/libcons/consensus.go +++ b/util/libcons/consensus.go @@ -4,14 +4,17 @@ import ( "context" "crypto/sha256" "encoding/hex" + "fmt" sdkmath "cosmossdk.io/math" "github.com/VolumeFi/whoops" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/util/liberr" - consensustypes "github.com/palomachain/paloma/x/consensus/types" - "github.com/palomachain/paloma/x/evm/types" + "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/util/palomath" + evmtypes "github.com/palomachain/paloma/x/evm/types" valsettypes "github.com/palomachain/paloma/x/valset/types" ) @@ -57,6 +60,20 @@ func hashSha256(data []byte) []byte { return h.Sum(nil) } +type Checkable interface { + GetValAddress() sdk.ValAddress +} + +type Evidence interface { + Checkable + GetProof() *codectypes.Any +} + +type GasEstimate interface { + Checkable + GetValue() uint64 +} + type ConsensusChecker struct { p SnapshotProvider cdc codec.BinaryCodec @@ -93,7 +110,7 @@ func (r *Result) addToDistribution(key string, c consensusPower) { r.Distribution[key] = c.runningSum } -func (c ConsensusChecker) VerifyEvidence(ctx sdk.Context, evidences []*consensustypes.Evidence) (*Result, error) { +func (c ConsensusChecker) VerifyEvidence(ctx context.Context, evidences []Evidence) (*Result, error) { result := newResult() snapshot, err := c.p(ctx) if err != nil { @@ -119,14 +136,14 @@ func (c ConsensusChecker) VerifyEvidence(ctx sdk.Context, evidences []*consensus } groups := make(map[string]struct { - evidence types.Hashable + evidence evmtypes.Hashable validators []sdk.ValAddress }) var g whoops.Group for _, evidence := range evidences { rawProof := evidence.GetProof() - var hashable types.Hashable + var hashable evmtypes.Hashable err := c.cdc.UnpackAny(rawProof, &hashable) if err != nil { return nil, err @@ -141,13 +158,10 @@ func (c ConsensusChecker) VerifyEvidence(ctx sdk.Context, evidences []*consensus if val.evidence == nil { val.evidence = hashable } - val.validators = append(val.validators, evidence.ValAddress) + val.validators = append(val.validators, evidence.GetValAddress()) groups[hash] = val } - // TODO: gas management - // TODO: punishing validators who misbehave - // TODO: check for every tx if it seems genuine for hash, group := range groups { var cp consensusPower @@ -178,3 +192,50 @@ func (c ConsensusChecker) VerifyEvidence(ctx sdk.Context, evidences []*consensus return result, ErrConsensusNotAchieved } + +func (c ConsensusChecker) VerifyGasEstimates(ctx context.Context, p liblog.LogProvider, estimates []GasEstimate) (uint64, error) { + logger := liblog.FromKeeper(ctx, p).WithComponent("verify-gas-estimates") + logger.Debug("Verifying gas estimates") + + result := newResult() + snapshot, err := c.p(ctx) + if err != nil { + return 0, err + } + + // check if there is enough power to reach the consensus + var cp consensusPower + cp.setTotal(snapshot.TotalShares) + + for _, v := range estimates { + val, found := snapshot.GetValidator(v.GetValAddress()) + if !found { + continue + } + cp.add(val.ShareCount) + } + + result.totalFromConsensus(cp) + if !cp.consensus() { + return 0, ErrConsensusNotAchieved + } + + estimateValues := make([]uint64, len(estimates)) + for i := range estimates { + estimateValues[i] = estimates[i].GetValue() + } + + // Retrieve the median value of the gas estimates and + // multiply value by 1.2 to allow for some security margin + winner := palomath.Median(estimateValues) + logger.WithFields("gas-estimate", winner).Debug("Built median value of gas estimates.") + + if winner == 0 { + return 0, fmt.Errorf("gas estimate is zero") + } + + winner = (winner * 6) / 5 + + logger.WithFields("gas-estimate", winner).Debug("Adding security margin.") + return winner, nil +} diff --git a/util/liblog/liblog.go b/util/liblog/liblog.go index 69f774d2..00ff7268 100644 --- a/util/liblog/liblog.go +++ b/util/liblog/liblog.go @@ -12,6 +12,7 @@ type Logr interface { WithError(err error) Logr WithComponent(string) Logr WithValidator(string) Logr + WithChain(string) Logr } type LogProvider interface { @@ -61,6 +62,11 @@ func (l *lgwr) WithComponent(c string) Logr { return l } +func (l *lgwr) WithChain(c string) Logr { + l.l = l.l.With("chain-reference-id", c) + return l +} + func (l *lgwr) WithValidator(v string) Logr { l.l = l.l.With("validator", v) return l diff --git a/x/consensus/keeper/cleanup.go b/x/consensus/keeper/cleanup.go index 9a35dd3f..6e10f43d 100644 --- a/x/consensus/keeper/cleanup.go +++ b/x/consensus/keeper/cleanup.go @@ -86,7 +86,7 @@ func (k Keeper) ReassignOrphanedMessages(ctx sdk.Context, blockAge int64) (err e return fmt.Errorf("failed to parse to evm message: %w", err) } req := deriveMessageRequirements(evmmsg, k.cdc) - newVal, err := k.evmKeeper.PickValidatorForMessage(ctx, evmmsg.ChainReferenceID, req) + newVal, newRemoteAddr, err := k.evmKeeper.PickValidatorForMessage(ctx, evmmsg.ChainReferenceID, req) if err != nil { logger.WithError(err).Error("failed to pick new validator for message.") return fmt.Errorf("failed to pick validator for message: %w", err) @@ -94,7 +94,7 @@ func (k Keeper) ReassignOrphanedMessages(ctx sdk.Context, blockAge int64) (err e logger = logger.WithFields("current-validator", currentVal, "new-validator", newVal) logger.Debug("Attepting to reassign message...") - if err := k.reassignMessageValidator(ctx, newVal, msg.GetId(), opt.QueueTypeName); err != nil { + if err := k.reassignMessageValidator(ctx, newVal, newRemoteAddr, msg.GetId(), opt.QueueTypeName); err != nil { logger.WithError(err).Error("failed to reassign new validator to message.") return err } diff --git a/x/consensus/keeper/cleanup_test.go b/x/consensus/keeper/cleanup_test.go index 8886f49e..f8abc03d 100644 --- a/x/consensus/keeper/cleanup_test.go +++ b/x/consensus/keeper/cleanup_test.go @@ -31,7 +31,6 @@ func TestDeleteOldMessages(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -111,7 +110,6 @@ func TestGetMessagesOlderThan(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true diff --git a/x/consensus/keeper/concensus_keeper.go b/x/consensus/keeper/concensus_keeper.go index ba8e5ac9..273311d4 100644 --- a/x/consensus/keeper/concensus_keeper.go +++ b/x/consensus/keeper/concensus_keeper.go @@ -6,9 +6,9 @@ import ( "cosmossdk.io/math" "github.com/VolumeFi/whoops" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/palomachain/paloma/util/libcons" "github.com/palomachain/paloma/util/liblog" "github.com/palomachain/paloma/util/slice" "github.com/palomachain/paloma/x/consensus/keeper/consensus" @@ -116,6 +116,47 @@ func (k Keeper) GetMessagesForSigning(ctx context.Context, queueTypeName string, return msgs, nil } +func (k Keeper) GetMessagesForGasEstimation(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + msgs, err = k.GetMessagesFromQueue(sdkCtx, queueTypeName, 0) + if err != nil { + return nil, err + } + + // Check for existing valset update messages on any target chains + valsetUpdatesOnChain, err := k.GetPendingValsetUpdates(ctx, queueTypeName) + if err != nil { + return nil, err + } + + msgs = slice.Filter(msgs, func(msg types.QueuedSignedMessageI) bool { + // Filter out messages which don't require gas estimation + if !msg.GetRequireGasEstimation() { + return false + } + + // Filter out already estimated messages + if msg.GetGasEstimate() > 0 { + return false + } + + // Filter out messages that already have been estimated by the validator + for _, v := range msg.GetGasEstimates() { + if v.ValAddress.Equals(valAddress) { + return false + } + } + + return filters.IsNotBlockedByValset(valsetUpdatesOnChain, msg) + }) + + if len(msgs) > defaultResponseMessageCount { + msgs = msgs[:defaultResponseMessageCount] + } + + return msgs, nil +} + // TODO: The infusion of EVM types into the consensus module is a bit of a code smell. // We should consider moving the entire logic of message assignment and retrieval // to the EVM module to keep the consensus module content-agnostic. @@ -178,6 +219,7 @@ func (k Keeper) GetMessagesForRelaying(ctx context.Context, queueTypeName string return filters.IsNotBlockedByValset(valsetUpdatesOnChain, msg) && filters.IsUnprocessed(msg) && filters.IsOldestMsgPerSender(msgLut, unpackedMsg) && + filters.HasGasEstimate(msg) && filters.IsAssignedTo(unpackedMsg, valAddress.String()) }) @@ -274,7 +316,11 @@ func (k Keeper) jailValidatorsWhichMissedAttestation(ctx sdk.Context, queueTypeN return nil } - r, err := k.consensusChecker.VerifyEvidence(ctx, msg.GetEvidence()) + r, err := k.consensusChecker.VerifyEvidence(ctx, + slice.Map(msg.GetEvidence(), func(evidence *types.Evidence) libcons.Evidence { + return evidence + }), + ) if err == nil { // We expect only messages which fail this verification to be in the queue at this point. return fmt.Errorf("VerifyEvidence: unexpected message with valid consensus found, skipping jailing steps") @@ -457,6 +503,40 @@ func (k Keeper) AddMessageSignature( return err } +func (k Keeper) AddMessageGasEstimates( + ctx context.Context, + valAddr sdk.ValAddress, + msgs []*types.MsgAddMessageGasEstimates_GasEstimate, +) error { + for _, msg := range msgs { + sdkCtx := sdk.UnwrapSDKContext(ctx) + cq := whoops.Must( + k.getConsensusQueue(sdkCtx, msg.GetQueueTypeName()), + ) + chainType, chainReferenceID := cq.ChainInfo() + + if err := cq.AddGasEstimate( + sdkCtx, + msg.MsgId, + &types.GasEstimate{ + ValAddress: valAddr, + Value: msg.Value, + }); err != nil { + return fmt.Errorf("error while adding gas estimate: %w", err) + } + + liblog.FromKeeper(ctx, k).WithFields( + "message-id", msg.GetMsgId(), + "queue-type-name", msg.GetQueueTypeName(), + "chain-type", chainType, + "validator", valAddr.String(), + "chain-reference-id", chainReferenceID). + Info("added message gas estimate.") + } + + return nil +} + func (k Keeper) AddMessageEvidence( ctx context.Context, valAddr sdk.ValAddress, @@ -567,7 +647,7 @@ func (k Keeper) SetMessageErrorData( func (k Keeper) reassignMessageValidator( ctx sdk.Context, - valAddr string, + valAddr, remoteAddr string, msgID uint64, queueTypeName string, ) error { @@ -585,69 +665,9 @@ func (k Keeper) reassignMessageValidator( "new-assignee", valAddr, ) - return cq.ReassignValidator(ctx, msgID, valAddr) + return cq.ReassignValidator(ctx, msgID, valAddr, remoteAddr) } func nonceFromID(id uint64) []byte { return sdk.Uint64ToBigEndian(id) } - -func (k Keeper) queuedMessageToMessageToSign(msg types.QueuedSignedMessageI) *types.MessageToSign { - consensusMsg, err := msg.ConsensusMsg(k.cdc) - if err != nil { - panic(err) - } - anyMsg, err := codectypes.NewAnyWithValue(consensusMsg) - if err != nil { - panic(err) - } - return &types.MessageToSign{ - Nonce: nonceFromID(msg.GetId()), - Id: msg.GetId(), - BytesToSign: msg.GetBytesToSign(), - Msg: anyMsg, - } -} - -func (k Keeper) queuedMessageToMessageWithSignatures(msg types.QueuedSignedMessageI) (types.MessageWithSignatures, error) { - consensusMsg, err := msg.ConsensusMsg(k.cdc) - if err != nil { - return types.MessageWithSignatures{}, err - } - anyMsg, err := codectypes.NewAnyWithValue(consensusMsg) - if err != nil { - return types.MessageWithSignatures{}, err - } - - var publicAccessData []byte - - if msg.GetPublicAccessData() != nil { - publicAccessData = msg.GetPublicAccessData().GetData() - } - - var errorData []byte - - if msg.GetErrorData() != nil { - errorData = msg.GetErrorData().GetData() - } - - respMsg := types.MessageWithSignatures{ - Nonce: nonceFromID(msg.GetId()), - Id: msg.GetId(), - BytesToSign: msg.GetBytesToSign(), - Msg: anyMsg, - PublicAccessData: publicAccessData, - ErrorData: errorData, - } - - for _, signData := range msg.GetSignData() { - respMsg.SignData = append(respMsg.SignData, &types.ValidatorSignature{ - ValAddress: signData.GetValAddress(), - Signature: signData.GetSignature(), - ExternalAccountAddress: signData.GetExternalAccountAddress(), - PublicKey: signData.GetPublicKey(), - }) - } - - return respMsg, nil -} diff --git a/x/consensus/keeper/concensus_keeper_test.go b/x/consensus/keeper/concensus_keeper_test.go index 995a6e9f..0e666237 100644 --- a/x/consensus/keeper/concensus_keeper_test.go +++ b/x/consensus/keeper/concensus_keeper_test.go @@ -47,7 +47,6 @@ func TestEndToEndTestingOfPuttingAndGettingMessagesOfTheConsensusQueue(t *testin opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -103,7 +102,6 @@ func TestJailValidatorsWhichMissedAttestation(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -387,7 +385,6 @@ func TestGetMessagesFromQueue(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -422,7 +419,6 @@ func TestGetMessagesForRelaying(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(uvType), - consensus.WithBytesToSignCalc(func(msg types.ConsensusMsg, salt types.Salt) []byte { return []byte{} }), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -433,7 +429,6 @@ func TestGetMessagesForRelaying(t *testing.T) { opt: consensus.ApplyOpts(nil, consensus.WithQueueTypeName(queueWithValsetUpdatesPending), consensus.WithStaticTypeCheck(uvType), - consensus.WithBytesToSignCalc(func(msg types.ConsensusMsg, salt types.Salt) []byte { return []byte{} }), consensus.WithChainInfo(chainType, "pending-chain"), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true @@ -926,9 +921,6 @@ func TestGettingMessagesThatHaveReachedConsensus(t *testing.T) { consensus.WithStaticTypeCheck(&types.SimpleMessage{}), consensus.WithQueueTypeName(defaultQueueName), consensus.WithChainInfo(chainType, chainReferenceID), - consensus.WithBytesToSignCalc(func(msg types.ConsensusMsg, salt types.Salt) []byte { - return []byte("sign-me") - }), consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { return true }), @@ -967,7 +959,6 @@ func TestAddingSignatures(t *testing.T) { consensus.WithAttestator(mck), consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(msgType), - consensus.WithBytesToSignCalc(msgType.ConsensusSignBytes()), consensus.WithChainInfo(chainType, chainReferenceID), consensus.WithVerifySignature(func(msg []byte, sig []byte, pk []byte) bool { p := secp256k1.PubKey(pk) @@ -990,7 +981,10 @@ func TestAddingSignatures(t *testing.T) { require.Len(t, msgs, 1) msg := msgs[0] - signedBytes, err := key1.Sign(msg.GetBytesToSign()) + bytesToSign, err := msg.GetBytesToSign(keeper.cdc) + require.NoError(t, err) + + signedBytes, err := key1.Sign(bytesToSign) require.NoError(t, err) @@ -1049,3 +1043,65 @@ func (q queueSupporter) SupportedQueues(ctx context.Context) ([]consensus.Suppor }, }, nil } + +func TestGetMessagesForEstimating(t *testing.T) { + k, _, ctx := newConsensusKeeper(t) + queue := types.Queue(defaultQueueName, chainType, chainReferenceID) + + uvType := &evmtypes.Message{} + + types.RegisterInterfaces(types.ModuleCdc.InterfaceRegistry()) + evmtypes.RegisterInterfaces(types.ModuleCdc.InterfaceRegistry()) + + types.ModuleCdc.InterfaceRegistry().RegisterImplementations((*types.ConsensusMsg)(nil), &evmtypes.Message{}) + types.ModuleCdc.InterfaceRegistry().RegisterImplementations((*evmtypes.TurnstoneMsg)(nil), &evmtypes.Message{}) + + k.registry.Add( + queueSupporter{ + opt: consensus.ApplyOpts(nil, + consensus.WithQueueTypeName(queue), + consensus.WithStaticTypeCheck(uvType), + consensus.WithChainInfo(chainType, chainReferenceID), + consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { + return true + }), + ), + }, + ) + + val := sdk.ValAddress("validator-1") + + // message with no need for estimation + _, err := k.PutMessageInQueue(ctx, queue, &evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: chainReferenceID, + Assignee: val.String(), + }, nil) + require.NoError(t, err) + + msgs, err := k.GetMessagesForGasEstimation(ctx, queue, val) + require.NoError(t, err) + require.Len(t, msgs, 0, "validator should get 0 messages, since estimation isn't needed") + + // message with estimation needed + mid, err := k.PutMessageInQueue(ctx, queue, &evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: chainReferenceID, + Assignee: val.String(), + }, &consensus.PutOptions{RequireGasEstimation: true}) + require.NoError(t, err) + + msgs, err = k.GetMessagesForGasEstimation(ctx, queue, val) + require.NoError(t, err) + require.Len(t, msgs, 1, "validator should get 1 message requiring gas estimation") + + // Update message with gas estimate + q, err := k.getConsensusQueue(ctx, queue) + require.NoError(t, err) + err = q.SetElectedGasEstimate(ctx, mid, 1000) + require.NoError(t, err) + + msgs, err = k.GetMessagesForGasEstimation(ctx, queue, val) + require.NoError(t, err) + require.Len(t, msgs, 0, "validator should not get message requiring gas estimation after gas estimate is set") +} diff --git a/x/consensus/keeper/consensus/batch.go b/x/consensus/keeper/consensus/batch.go index 8452490f..fb171bd0 100644 --- a/x/consensus/keeper/consensus/batch.go +++ b/x/consensus/keeper/consensus/batch.go @@ -36,6 +36,8 @@ func NewBatchQueue(qo QueueOptions) (BatchQueue, error) { } func (c BatchQueue) Put(ctx context.Context, msg ConsensusMsg, opts *PutOptions) (uint64, error) { + // TODO: Add support for updating opt.MsgIDtoReplace + // or remove BatchQueue, I don't think it's used at all. sdkCtx := sdk.UnwrapSDKContext(ctx) if !c.batchedTypeChecker(msg) { return 0, ErrIncorrectMessageType.Format(msg) @@ -138,6 +140,15 @@ func (c BatchQueue) AddSignature(ctx context.Context, id uint64, signData *types return c.base.AddSignature(sdkCtx, id, signData) } +func (c BatchQueue) AddGasEstimate(ctx context.Context, id uint64, estimate *types.GasEstimate) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return c.base.AddGasEstimate(sdkCtx, id, estimate) +} + +func (c BatchQueue) SetElectedGasEstimate(ctx context.Context, msgID uint64, estimate uint64) error { + return c.base.SetElectedGasEstimate(ctx, msgID, estimate) +} + func (c BatchQueue) Remove(ctx context.Context, msgID uint64) error { sdkCtx := sdk.UnwrapSDKContext(ctx) return c.base.Remove(sdkCtx, msgID) @@ -158,8 +169,8 @@ func (c BatchQueue) AddEvidence(ctx context.Context, id uint64, evidence *types. return c.base.AddEvidence(sdkCtx, id, evidence) } -func (c BatchQueue) ReassignValidator(ctx sdk.Context, id uint64, val string) error { - return c.base.ReassignValidator(ctx, id, val) +func (c BatchQueue) ReassignValidator(ctx sdk.Context, id uint64, val, remoteAddr string) error { + return c.base.ReassignValidator(ctx, id, val, remoteAddr) } func (c BatchQueue) SetPublicAccessData(ctx context.Context, id uint64, data *types.PublicAccessData) error { diff --git a/x/consensus/keeper/consensus/batch_test.go b/x/consensus/keeper/consensus/batch_test.go index 1585a3bd..49e202fa 100644 --- a/x/consensus/keeper/consensus/batch_test.go +++ b/x/consensus/keeper/consensus/batch_test.go @@ -47,9 +47,6 @@ func TestBatching(t *testing.T) { Ider: keeperutil.NewIDGenerator(sg, nil), Cdc: types.ModuleCdc, TypeCheck: types.StaticTypeChecker(msgType), - BytesToSignCalculator: types.TypedBytesToSign(func(msgs *types.Batch, _ types.Salt) []byte { - return []byte("hello") - }), VerifySignature: func([]byte, []byte, []byte) bool { return true }, @@ -94,13 +91,16 @@ func TestBatching(t *testing.T) { require.Len(t, msgs, 7) }) }) - t.Run("verifying the bytes to sign", func(t *testing.T) { - msgs, err := cq.GetAll(ctx) - require.NoError(t, err) - for _, msg := range msgs { - require.Equal(t, msg.GetBytesToSign(), []byte("hello")) - } - }) + // TODO BytesToSign are never assigned to Batch messages + // t.Run("verifying the bytes to sign", func(t *testing.T) { + // msgs, err := cq.GetAll(ctx) + // require.NoError(t, err) + // for _, msg := range msgs { + // bytesToSign, err := msg.GetBytesToSign(cq.base.qo.Cdc) + // require.NoError(t, err) + // require.Equal(t, bytesToSign, []byte("hello")) + // } + // }) t.Run("removing all removes items", func(t *testing.T) { msgs, err := cq.GetAll(ctx) require.NoError(t, err) diff --git a/x/consensus/keeper/consensus/consensus.go b/x/consensus/keeper/consensus/consensus.go index dd4b9460..72e3e9f7 100644 --- a/x/consensus/keeper/consensus/consensus.go +++ b/x/consensus/keeper/consensus/consensus.go @@ -29,17 +29,16 @@ type Queue struct { } type QueueOptions struct { - Batched bool - QueueTypeName string - Sg keeperutil.StoreGetter - Ider keeperutil.IDGenerator - Cdc codec.Codec - TypeCheck types.TypeChecker - BytesToSignCalculator types.BytesToSignFunc - VerifySignature types.VerifySignatureFunc - ChainType types.ChainType - Attestator types.Attestator - ChainReferenceID string + Batched bool + QueueTypeName string + Sg keeperutil.StoreGetter + Ider keeperutil.IDGenerator + Cdc codec.Codec + TypeCheck types.TypeChecker + VerifySignature types.VerifySignatureFunc + ChainType types.ChainType + Attestator types.Attestator + ChainReferenceID string } type OptFnc func(*QueueOptions) @@ -56,12 +55,6 @@ func WithStaticTypeCheck(val any) OptFnc { } } -func WithBytesToSignCalc(val types.BytesToSignFunc) OptFnc { - return func(opt *QueueOptions) { - opt.BytesToSignCalculator = val - } -} - func WithVerifySignature(val types.VerifySignatureFunc) OptFnc { return func(opt *QueueOptions) { opt.VerifySignature = val @@ -102,10 +95,6 @@ func NewQueue(qo QueueOptions) (Queue, error) { return Queue{}, ErrNilTypeCheck } - if qo.BytesToSignCalculator == nil { - return Queue{}, ErrNilBytesToSignCalculator - } - if qo.VerifySignature == nil { return Queue{}, ErrNilVerifySignature } @@ -130,43 +119,62 @@ func NewQueue(qo QueueOptions) (Queue, error) { // Put puts raw message into a signing queue. func (c Queue) Put(ctx context.Context, msg ConsensusMsg, opts *PutOptions) (uint64, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - requireSignatures := true var publicAccessData *types.PublicAccessData + var mid uint64 + requireSignatures := true + requireGasEstimation := false if opts != nil { requireSignatures = opts.RequireSignatures - publicAccessData = &types.PublicAccessData{ - ValAddress: nil, - Data: opts.PublicAccessData, + requireGasEstimation = opts.RequireGasEstimation + mid = opts.MsgIDToReplace + if len(opts.PublicAccessData) > 0 { + publicAccessData = &types.PublicAccessData{ + ValAddress: nil, + Data: opts.PublicAccessData, + } } } if !c.qo.TypeCheck(msg) { return 0, ErrIncorrectMessageType.Format(msg) } - newID := c.qo.Ider.IncrementNextID(sdkCtx, consensusQueueIDCounterKey) - // just so it's clear that nonce is an actual ID - nonce := newID anyMsg, err := codectypes.NewAnyWithValue(msg) if err != nil { return 0, err } - queuedMsg := &types.QueuedSignedMessage{ - Id: newID, - Msg: anyMsg, - SignData: []*types.SignData{}, - AddedAtBlockHeight: sdkCtx.BlockHeight(), - AddedAt: sdkCtx.BlockTime(), - RequireSignatures: requireSignatures, - PublicAccessData: publicAccessData, - BytesToSign: c.qo.BytesToSignCalculator(msg, types.Salt{ - Nonce: nonce, - }), - } - if err := c.save(sdkCtx, queuedMsg); err != nil { + + var m *types.QueuedSignedMessage + if mid != 0 { + // TODO: You need your own implementation since cons msg doesn thave iD + qsmi, err := c.GetMsgByID(sdkCtx, mid) + if err != nil { + return 0, fmt.Errorf("failed to get message by id: %w", err) + } + var ok bool + m, ok = qsmi.(*types.QueuedSignedMessage) + if !ok { + return 0, fmt.Errorf("failed to cast to queued signed message") + } + m.Msg = anyMsg + } else { + mid = c.qo.Ider.IncrementNextID(sdkCtx, consensusQueueIDCounterKey) + m = &types.QueuedSignedMessage{ + Id: mid, + Msg: anyMsg, + SignData: []*types.SignData{}, + GasEstimates: []*types.GasEstimate{}, + AddedAtBlockHeight: sdkCtx.BlockHeight(), + AddedAt: sdkCtx.BlockTime(), + RequireSignatures: requireSignatures, + FlagMask: types.BuildFlagMask(requireGasEstimation), + PublicAccessData: publicAccessData, + } + } + if err := c.save(sdkCtx, m); err != nil { return 0, err } - return newID, nil + return mid, nil } // getAll returns all messages from a signing queu @@ -210,10 +218,10 @@ func (c Queue) AddEvidence(ctx context.Context, msgID uint64, evidence *types.Ev type assignableMessage interface { proto.Message - SetAssignee(ctx sdk.Context, val string) + SetAssignee(ctx sdk.Context, val, remoteAddr string) } -func (c Queue) ReassignValidator(ctx sdk.Context, msgID uint64, val string) error { +func (c Queue) ReassignValidator(ctx sdk.Context, msgID uint64, val, remoteAddr string) error { imsg, err := c.GetMsgByID(ctx, msgID) if err != nil { return err @@ -227,7 +235,7 @@ func (c Queue) ReassignValidator(ctx sdk.Context, msgID uint64, val string) erro if !ok { return fmt.Errorf("message does not support setting assignee") } - assignable.SetAssignee(ctx, val) + assignable.SetAssignee(ctx, val, remoteAddr) var a proto.Message a = assignable msg := imsg.(*types.QueuedSignedMessage) @@ -315,7 +323,12 @@ func (c Queue) AddSignature(ctx context.Context, msgID uint64, signData *types.S } } - if !c.qo.VerifySignature(msg.GetBytesToSign(), signData.Signature, signData.PublicKey) { + bytesToSign, err := msg.GetBytesToSign(c.qo.Cdc) + if err != nil { + return err + } + + if !c.qo.VerifySignature(bytesToSign, signData.Signature, signData.PublicKey) { return ErrInvalidSignature } @@ -324,6 +337,46 @@ func (c Queue) AddSignature(ctx context.Context, msgID uint64, signData *types.S return c.save(sdkCtx, msg) } +// AddGasEstimate adds a gas estimate to the message +func (c Queue) AddGasEstimate(ctx context.Context, msgID uint64, estimate *types.GasEstimate) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + msg, err := c.GetMsgByID(sdkCtx, msgID) + if err != nil { + return err + } + + if !msg.GetRequireGasEstimation() { + return fmt.Errorf("message %d does not require gas estimation", msgID) + } + + for _, v := range msg.GetGasEstimates() { + if estimate.ValAddress.Equals(v.ValAddress) { + return fmt.Errorf("gas estimate already exists for validator %s", v.ValAddress) + } + } + + msg.AddGasEstimate(estimate) + return c.save(sdkCtx, msg) +} + +func (c Queue) SetElectedGasEstimate(ctx context.Context, msgID uint64, estimate uint64) error { + msg, err := c.GetMsgByID(ctx, msgID) + if err != nil { + return err + } + + if !msg.GetRequireGasEstimation() { + return fmt.Errorf("message %d does not require gas estimation", msgID) + } + + if msg.GetGasEstimate() != 0 { + return fmt.Errorf("gas estimate already exists for message %d", msgID) + } + + msg.SetElectedGasEstimate(estimate) + return c.save(ctx, msg) +} + // remove removes the message from the queue. func (c Queue) Remove(ctx context.Context, msgID uint64) error { sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -463,7 +516,7 @@ func RemoveQueueCompletely(ctx context.Context, cq Queuer) { } } -func ToMessageWithSignatures(msg types.QueuedSignedMessageI, cdc codec.BinaryCodec) (types.MessageWithSignatures, error) { +func ToMessageWithSignatures(msg types.QueuedSignedMessageI, cdc codec.Codec) (types.MessageWithSignatures, error) { origMsg, err := msg.ConsensusMsg(cdc) if err != nil { return types.MessageWithSignatures{}, err @@ -487,16 +540,23 @@ func ToMessageWithSignatures(msg types.QueuedSignedMessageI, cdc codec.BinaryCod errorData = msg.GetErrorData().GetData() } + bytesToSign, err := msg.GetBytesToSign(cdc) + if err != nil { + return types.MessageWithSignatures{}, err + } + approvedMessage := types.MessageWithSignatures{ Nonce: msg.Nonce(), Id: msg.GetId(), Msg: anyMsg, - BytesToSign: msg.GetBytesToSign(), + BytesToSign: bytesToSign, SignData: []*types.ValidatorSignature{}, PublicAccessData: publicAccessData, ValsetID: valsetID, ErrorData: errorData, + GasEstimate: msg.GetGasEstimate(), } + for _, signData := range msg.GetSignData() { approvedMessage.SignData = append(approvedMessage.SignData, &types.ValidatorSignature{ ValAddress: signData.GetValAddress(), diff --git a/x/consensus/keeper/consensus/consensus_test.go b/x/consensus/keeper/consensus/consensus_test.go index f0925b44..6bbdc289 100644 --- a/x/consensus/keeper/consensus/consensus_test.go +++ b/x/consensus/keeper/consensus/consensus_test.go @@ -41,13 +41,12 @@ func TestConsensusQueueAllMethods(t *testing.T) { mck.On("ValidateEvidence", mock.Anything, mock.Anything, mock.Anything).Return(nil).Maybe() cq := Queue{ qo: QueueOptions{ - QueueTypeName: "simple-message", - Sg: sg, - Ider: keeperutil.NewIDGenerator(sg, nil), - Cdc: types.ModuleCdc, - TypeCheck: types.StaticTypeChecker(msgType), - Attestator: mck, - BytesToSignCalculator: msgType.ConsensusSignBytes(), + QueueTypeName: "simple-message", + Sg: sg, + Ider: keeperutil.NewIDGenerator(sg, nil), + Cdc: types.ModuleCdc, + TypeCheck: types.StaticTypeChecker(msgType), + Attestator: mck, VerifySignature: func([]byte, []byte, []byte) bool { return true }, diff --git a/x/consensus/keeper/consensus/mocks/Queuer.go b/x/consensus/keeper/consensus/mocks/Queuer.go index a8167147..a739b6b2 100644 --- a/x/consensus/keeper/consensus/mocks/Queuer.go +++ b/x/consensus/keeper/consensus/mocks/Queuer.go @@ -1,15 +1,17 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks import ( - "context" + context "context" + consensus "github.com/palomachain/paloma/x/consensus/keeper/consensus" - consensustypes "github.com/palomachain/paloma/x/consensus/types" + + cosmos_sdktypes "github.com/cosmos/cosmos-sdk/types" mock "github.com/stretchr/testify/mock" - types "github.com/cosmos/cosmos-sdk/types" + types "github.com/palomachain/paloma/x/consensus/types" ) // Queuer is an autogenerated mock type for the Queuer type @@ -18,7 +20,7 @@ type Queuer struct { } // AddEvidence provides a mock function with given fields: ctx, id, evidence -func (_m *Queuer) AddEvidence(ctx context.Context, id uint64, evidence *consensustypes.Evidence) error { +func (_m *Queuer) AddEvidence(ctx context.Context, id uint64, evidence *types.Evidence) error { ret := _m.Called(ctx, id, evidence) if len(ret) == 0 { @@ -26,7 +28,7 @@ func (_m *Queuer) AddEvidence(ctx context.Context, id uint64, evidence *consensu } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *consensustypes.Evidence) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.Evidence) error); ok { r0 = rf(ctx, id, evidence) } else { r0 = ret.Error(0) @@ -35,8 +37,26 @@ func (_m *Queuer) AddEvidence(ctx context.Context, id uint64, evidence *consensu return r0 } +// AddGasEstimate provides a mock function with given fields: ctx, id, estimate +func (_m *Queuer) AddGasEstimate(ctx context.Context, id uint64, estimate *types.GasEstimate) error { + ret := _m.Called(ctx, id, estimate) + + if len(ret) == 0 { + panic("no return value specified for AddGasEstimate") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.GasEstimate) error); ok { + r0 = rf(ctx, id, estimate) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // AddSignature provides a mock function with given fields: ctx, id, signData -func (_m *Queuer) AddSignature(ctx context.Context, id uint64, signData *consensustypes.SignData) error { +func (_m *Queuer) AddSignature(ctx context.Context, id uint64, signData *types.SignData) error { ret := _m.Called(ctx, id, signData) if len(ret) == 0 { @@ -44,7 +64,7 @@ func (_m *Queuer) AddSignature(ctx context.Context, id uint64, signData *consens } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *consensustypes.SignData) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.SignData) error); ok { r0 = rf(ctx, id, signData) } else { r0 = ret.Error(0) @@ -82,23 +102,23 @@ func (_m *Queuer) ChainInfo() (string, string) { } // GetAll provides a mock function with given fields: _a0 -func (_m *Queuer) GetAll(_a0 context.Context) ([]consensustypes.QueuedSignedMessageI, error) { +func (_m *Queuer) GetAll(_a0 context.Context) ([]types.QueuedSignedMessageI, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetAll") } - var r0 []consensustypes.QueuedSignedMessageI + var r0 []types.QueuedSignedMessageI var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]consensustypes.QueuedSignedMessageI, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) ([]types.QueuedSignedMessageI, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(context.Context) []consensustypes.QueuedSignedMessageI); ok { + if rf, ok := ret.Get(0).(func(context.Context) []types.QueuedSignedMessageI); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]consensustypes.QueuedSignedMessageI) + r0 = ret.Get(0).([]types.QueuedSignedMessageI) } } @@ -112,23 +132,23 @@ func (_m *Queuer) GetAll(_a0 context.Context) ([]consensustypes.QueuedSignedMess } // GetErrorData provides a mock function with given fields: ctx, id -func (_m *Queuer) GetErrorData(ctx context.Context, id uint64) (*consensustypes.ErrorData, error) { +func (_m *Queuer) GetErrorData(ctx context.Context, id uint64) (*types.ErrorData, error) { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for GetErrorData") } - var r0 *consensustypes.ErrorData + var r0 *types.ErrorData var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (*consensustypes.ErrorData, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.ErrorData, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) *consensustypes.ErrorData); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.ErrorData); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*consensustypes.ErrorData) + r0 = ret.Get(0).(*types.ErrorData) } } @@ -142,23 +162,23 @@ func (_m *Queuer) GetErrorData(ctx context.Context, id uint64) (*consensustypes. } // GetMsgByID provides a mock function with given fields: ctx, id -func (_m *Queuer) GetMsgByID(ctx context.Context, id uint64) (consensustypes.QueuedSignedMessageI, error) { +func (_m *Queuer) GetMsgByID(ctx context.Context, id uint64) (types.QueuedSignedMessageI, error) { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for GetMsgByID") } - var r0 consensustypes.QueuedSignedMessageI + var r0 types.QueuedSignedMessageI var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (consensustypes.QueuedSignedMessageI, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) (types.QueuedSignedMessageI, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) consensustypes.QueuedSignedMessageI); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) types.QueuedSignedMessageI); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(consensustypes.QueuedSignedMessageI) + r0 = ret.Get(0).(types.QueuedSignedMessageI) } } @@ -172,23 +192,23 @@ func (_m *Queuer) GetMsgByID(ctx context.Context, id uint64) (consensustypes.Que } // GetPublicAccessData provides a mock function with given fields: ctx, id -func (_m *Queuer) GetPublicAccessData(ctx context.Context, id uint64) (*consensustypes.PublicAccessData, error) { +func (_m *Queuer) GetPublicAccessData(ctx context.Context, id uint64) (*types.PublicAccessData, error) { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for GetPublicAccessData") } - var r0 *consensustypes.PublicAccessData + var r0 *types.PublicAccessData var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (*consensustypes.PublicAccessData, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.PublicAccessData, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) *consensustypes.PublicAccessData); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.PublicAccessData); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*consensustypes.PublicAccessData) + r0 = ret.Get(0).(*types.PublicAccessData) } } @@ -202,7 +222,7 @@ func (_m *Queuer) GetPublicAccessData(ctx context.Context, id uint64) (*consensu } // Put provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Queuer) Put(_a0 context.Context, _a1 consensustypes.ConsensusMsg, _a2 *consensus.PutOptions) (uint64, error) { +func (_m *Queuer) Put(_a0 context.Context, _a1 types.ConsensusMsg, _a2 *consensus.PutOptions) (uint64, error) { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -211,16 +231,16 @@ func (_m *Queuer) Put(_a0 context.Context, _a1 consensustypes.ConsensusMsg, _a2 var r0 uint64 var r1 error - if rf, ok := ret.Get(0).(func(context.Context, consensustypes.ConsensusMsg, *consensus.PutOptions) (uint64, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, types.ConsensusMsg, *consensus.PutOptions) (uint64, error)); ok { return rf(_a0, _a1, _a2) } - if rf, ok := ret.Get(0).(func(context.Context, consensustypes.ConsensusMsg, *consensus.PutOptions) uint64); ok { + if rf, ok := ret.Get(0).(func(context.Context, types.ConsensusMsg, *consensus.PutOptions) uint64); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(uint64) } - if rf, ok := ret.Get(1).(func(context.Context, consensustypes.ConsensusMsg, *consensus.PutOptions) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, types.ConsensusMsg, *consensus.PutOptions) error); ok { r1 = rf(_a0, _a1, _a2) } else { r1 = ret.Error(1) @@ -229,17 +249,17 @@ func (_m *Queuer) Put(_a0 context.Context, _a1 consensustypes.ConsensusMsg, _a2 return r0, r1 } -// ReassignValidator provides a mock function with given fields: ctx, id, val -func (_m *Queuer) ReassignValidator(ctx types.Context, id uint64, val string) error { - ret := _m.Called(ctx, id, val) +// ReassignValidator provides a mock function with given fields: ctx, id, val, remoteAddr +func (_m *Queuer) ReassignValidator(ctx cosmos_sdktypes.Context, id uint64, val string, remoteAddr string) error { + ret := _m.Called(ctx, id, val, remoteAddr) if len(ret) == 0 { panic("no return value specified for ReassignValidator") } var r0 error - if rf, ok := ret.Get(0).(func(types.Context, uint64, string) error); ok { - r0 = rf(ctx, id, val) + if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, uint64, string, string) error); ok { + r0 = rf(ctx, id, val, remoteAddr) } else { r0 = ret.Error(0) } @@ -265,8 +285,26 @@ func (_m *Queuer) Remove(_a0 context.Context, _a1 uint64) error { return r0 } +// SetElectedGasEstimate provides a mock function with given fields: ctx, id, estimate +func (_m *Queuer) SetElectedGasEstimate(ctx context.Context, id uint64, estimate uint64) error { + ret := _m.Called(ctx, id, estimate) + + if len(ret) == 0 { + panic("no return value specified for SetElectedGasEstimate") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64) error); ok { + r0 = rf(ctx, id, estimate) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // SetErrorData provides a mock function with given fields: ctx, id, data -func (_m *Queuer) SetErrorData(ctx context.Context, id uint64, data *consensustypes.ErrorData) error { +func (_m *Queuer) SetErrorData(ctx context.Context, id uint64, data *types.ErrorData) error { ret := _m.Called(ctx, id, data) if len(ret) == 0 { @@ -274,7 +312,7 @@ func (_m *Queuer) SetErrorData(ctx context.Context, id uint64, data *consensusty } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *consensustypes.ErrorData) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.ErrorData) error); ok { r0 = rf(ctx, id, data) } else { r0 = ret.Error(0) @@ -284,7 +322,7 @@ func (_m *Queuer) SetErrorData(ctx context.Context, id uint64, data *consensusty } // SetPublicAccessData provides a mock function with given fields: ctx, id, data -func (_m *Queuer) SetPublicAccessData(ctx context.Context, id uint64, data *consensustypes.PublicAccessData) error { +func (_m *Queuer) SetPublicAccessData(ctx context.Context, id uint64, data *types.PublicAccessData) error { ret := _m.Called(ctx, id, data) if len(ret) == 0 { @@ -292,7 +330,7 @@ func (_m *Queuer) SetPublicAccessData(ctx context.Context, id uint64, data *cons } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *consensustypes.PublicAccessData) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.PublicAccessData) error); ok { r0 = rf(ctx, id, data) } else { r0 = ret.Error(0) diff --git a/x/consensus/keeper/consensus/types.go b/x/consensus/keeper/consensus/types.go index 1f57ecf6..6a651aef 100644 --- a/x/consensus/keeper/consensus/types.go +++ b/x/consensus/keeper/consensus/types.go @@ -16,14 +16,18 @@ const ( ) type PutOptions struct { - RequireSignatures bool - PublicAccessData []byte + RequireSignatures bool + RequireGasEstimation bool + MsgIDToReplace uint64 + PublicAccessData []byte } //go:generate mockery --name=Queuer type Queuer interface { Put(context.Context, ConsensusMsg, *PutOptions) (uint64, error) AddSignature(ctx context.Context, id uint64, signData *types.SignData) error + AddGasEstimate(ctx context.Context, id uint64, estimate *types.GasEstimate) error + SetElectedGasEstimate(ctx context.Context, id uint64, estimate uint64) error AddEvidence(ctx context.Context, id uint64, evidence *types.Evidence) error SetPublicAccessData(ctx context.Context, id uint64, data *types.PublicAccessData) error GetPublicAccessData(ctx context.Context, id uint64) (*types.PublicAccessData, error) @@ -33,7 +37,7 @@ type Queuer interface { GetAll(context.Context) ([]types.QueuedSignedMessageI, error) GetMsgByID(ctx context.Context, id uint64) (types.QueuedSignedMessageI, error) ChainInfo() (types.ChainType, string) - ReassignValidator(ctx sdk.Context, id uint64, val string) error + ReassignValidator(ctx sdk.Context, id uint64, val, remoteAddr string) error } type QueueBatcher interface { diff --git a/x/consensus/keeper/estimate.go b/x/consensus/keeper/estimate.go new file mode 100644 index 00000000..981fd5e0 --- /dev/null +++ b/x/consensus/keeper/estimate.go @@ -0,0 +1,176 @@ +package keeper + +import ( + "context" + "errors" + "fmt" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/util/libcons" + "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/util/libmsg" + "github.com/palomachain/paloma/util/slice" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" + "github.com/palomachain/paloma/x/consensus/types" + evmtypes "github.com/palomachain/paloma/x/evm/types" +) + +// CheckAndProcessEstimatedMessages is supposed to be used within the +// EndBlocker. It will get messages which have received gas estimates +// and try to process them. +func (k Keeper) CheckAndProcessEstimatedMessages(ctx context.Context) (err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + logger := liblog.FromKeeper(ctx, k).WithComponent("check-and-process-estimated-messages") + for _, supportedConsensusQueue := range k.registry.slice { + opts, err := supportedConsensusQueue.SupportedQueues(sdkCtx) + if err != nil { + logger.WithError(err).Warn("Failed to get supported queues") + continue + } + for _, opt := range opts { + msgs, err := k.GetMessagesFromQueue(sdkCtx, opt.QueueTypeName, 0) + if err != nil { + logger.WithError(err).Warn("Failed to get messages from queue") + continue + } + + cq, err := k.getConsensusQueue(sdkCtx, opt.QueueTypeName) + if err != nil { + logger.WithChain(opt.ChainReferenceID). + WithError(err). + Warn("Failed to get consensus queue") + continue + } + for _, msg := range msgs { + cachedCtx, commit := sdk.UnwrapSDKContext(ctx).CacheContext() + if err := k.checkAndProcessEstimatedMessage(cachedCtx, msg, cq); err != nil { + logger.WithFields("msg_id", msg.GetId()). + WithError(err). + Warn("Failed to process estimated message") + continue + } + commit() + } + } + } + return nil +} + +func (k Keeper) checkAndProcessEstimatedMessage(ctx context.Context, + msg types.QueuedSignedMessageI, + q consensus.Queuer, +) error { + _, rcid := q.ChainInfo() + // Skip messages that don't require gas estimation + if !msg.GetRequireGasEstimation() { + return nil + } + + // Skip messages that don't have gas estimates + if len(msg.GetGasEstimates()) < 1 { + return nil + } + + // Skip messages that have gas estimate + if msg.GetGasEstimate() > 0 { + return nil + } + logger := liblog.FromKeeper(ctx, k). + WithComponent("check-and-process-estimated-messages"). + WithChain(rcid). + WithFields( + "id", msg.GetId(), + "nonce", msg.Nonce()) + logger.Debug("Processing gas estimates for message.") + + estimate, err := k.consensusChecker.VerifyGasEstimates(ctx, k, + slice.Map(msg.GetGasEstimates(), func(ge *types.GasEstimate) libcons.GasEstimate { + return ge + })) + if err != nil { + if errors.Is(err, libcons.ErrConsensusNotAchieved) { + logger.WithError(err).Debug("Consensus not achieved for gas estimates") + return nil + } + return fmt.Errorf("failed to verify gas estimates: %w", err) + } + + if err := q.SetElectedGasEstimate(ctx, msg.GetId(), estimate); err != nil { + return fmt.Errorf("failed to set elected gas estimate: %w", err) + } + + if err := k.checkAndProcessEstimatedSubmitLogicCall(ctx, msg, q, estimate); err != nil { + return fmt.Errorf("failed to process estimated submit logic call: %w", err) + } + + return nil +} + +func (k Keeper) checkAndProcessEstimatedSubmitLogicCall( + ctx context.Context, + msg types.QueuedSignedMessageI, + q consensus.Queuer, + estimate uint64, +) error { + m, err := libmsg.ToEvmMessage(msg, k.cdc) + if err != nil { + return fmt.Errorf("failed to convert message to evm message: %w", err) + } + action, ok := m.Action.(*evmtypes.Message_SubmitLogicCall) + if !ok { + // Skip messages that are not SubmitLogicCall + return nil + } + + valAddr, err := sdk.ValAddressFromBech32(m.GetAssignee()) + if err != nil { + return fmt.Errorf("failed to parse validator address: %w", err) + } + fees, err := k.calculateFeesForEstimate(ctx, valAddr, m.GetChainReferenceID(), estimate) + if err != nil { + return fmt.Errorf("failed to calculate fees for estimate: %w", err) + } + action.SubmitLogicCall.Fees = fees + _, err = q.Put(ctx, m, &consensus.PutOptions{ + MsgIDToReplace: msg.GetId(), + }) + + return err +} + +func (k Keeper) calculateFeesForEstimate( + ctx context.Context, + relayer sdk.ValAddress, + chainReferenceID string, + estimate uint64, +) (*evmtypes.SubmitLogicCall_Fees, error) { + fees := &evmtypes.SubmitLogicCall_Fees{} + multiplicators, err := k.feeProvider.GetCombinedFeesForRelay(ctx, relayer, chainReferenceID) + if err != nil { + return nil, fmt.Errorf("failed to get fee settings: %w", err) + } + + // Relayer fees are stored as multiplicator of total gas estimate value + fees.RelayerFee = multiplicators.RelayerFee. + MulInt(math.NewIntFromUint64(estimate)). + Ceil(). + TruncateInt(). + Uint64() + + // Community fees are stored as multiplicator of the relayer fee + fees.CommunityFee = multiplicators.CommunityFee. + MulInt(math.NewIntFromUint64(fees.RelayerFee)). + Ceil(). + TruncateInt(). + Uint64() + + // Security fees are stored as multiplicator of the relayer fee + fees.SecurityFee = multiplicators.SecurityFee. + MulInt(math.NewIntFromUint64(fees.RelayerFee)). + Ceil(). + TruncateInt(). + Uint64() + + return fees, nil +} diff --git a/x/consensus/keeper/estimate_test.go b/x/consensus/keeper/estimate_test.go new file mode 100644 index 00000000..7dee94d9 --- /dev/null +++ b/x/consensus/keeper/estimate_test.go @@ -0,0 +1,186 @@ +package keeper + +import ( + "context" + "fmt" + "testing" + "time" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/util/libmsg" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" + "github.com/palomachain/paloma/x/consensus/types" + evmtypes "github.com/palomachain/paloma/x/evm/types" + valsettypes "github.com/palomachain/paloma/x/valset/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" +) + +type treasyreKeeperMock struct{} + +func (tk *treasyreKeeperMock) GetCombinedFeesForRelay(ctx context.Context, valAddress sdk.ValAddress, chainReferenceID string) (*types.MessageFeeSettings, error) { + return &types.MessageFeeSettings{ + RelayerFee: math.LegacyMustNewDecFromStr("1.25"), + CommunityFee: math.LegacyMustNewDecFromStr("0.3"), + SecurityFee: math.LegacyMustNewDecFromStr("0.01"), + }, nil +} + +func Test_CheckAndProcessEstimatedMessages(t *testing.T) { + k, ms, ctx := newConsensusKeeper(t) + queue := types.Queue(defaultQueueName, chainType, chainReferenceID) + + k.feeProvider = &treasyreKeeperMock{} + + uvType := &evmtypes.Message{} + + types.RegisterInterfaces(types.ModuleCdc.InterfaceRegistry()) + evmtypes.RegisterInterfaces(types.ModuleCdc.InterfaceRegistry()) + + types.ModuleCdc.InterfaceRegistry().RegisterImplementations((*types.ConsensusMsg)(nil), &evmtypes.Message{}) + types.ModuleCdc.InterfaceRegistry().RegisterImplementations((*evmtypes.TurnstoneMsg)(nil), &evmtypes.Message{}) + + k.registry.Add( + queueSupporter{ + opt: consensus.ApplyOpts(nil, + consensus.WithQueueTypeName(queue), + consensus.WithStaticTypeCheck(uvType), + consensus.WithChainInfo(chainType, chainReferenceID), + consensus.WithVerifySignature(func([]byte, []byte, []byte) bool { + return true + }), + ), + }, + ) + + validators := []valsettypes.Validator{} + for i := range 10 { + validators = append(validators, valsettypes.Validator{ + Address: sdk.ValAddress(fmt.Sprintf("validator-%d", i)), + ShareCount: math.NewInt(500), + }) + } + // Estimates for the first votes which won't reach consensus yet + estimates := []uint64{ + 21_000, + 19_000, + 11_000, + 25_000, + 21_000, + 25_000, + } + + ms.ValsetKeeper.On("GetCurrentSnapshot", mock.Anything).Return(&valsettypes.Snapshot{ + Id: 1, + Height: 500, + Validators: validators, + TotalShares: math.NewInt(10 * 500), + CreatedAt: time.Time{}, + Chains: []string{}, + }, nil) + + tt := []struct { + name string + msg *evmtypes.Message + slcCheck func(*evmtypes.Message, *require.Assertions, bool) bool + }{ + { + name: "regular old message", + msg: &evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: chainReferenceID, + Assignee: validators[0].Address.String(), + }, + slcCheck: func(_ *evmtypes.Message, _ *require.Assertions, expected bool) bool { + return expected + }, + }, + { + name: "SLC message", + msg: &evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: chainReferenceID, + Assignee: validators[0].Address.String(), + Action: &evmtypes.Message_SubmitLogicCall{ + SubmitLogicCall: &evmtypes.SubmitLogicCall{}, + }, + }, + slcCheck: func(m *evmtypes.Message, r *require.Assertions, expected bool) bool { + slc := m.GetSubmitLogicCall() + if slc == nil { + return expected + } + if !expected { + return slc.Fees == nil + } + + r.NotNil(slc.Fees) + r.Equal(uint64(31500), slc.Fees.RelayerFee, "relayer fee: got %d", slc.Fees.RelayerFee) + r.Equal(uint64(9450), slc.Fees.CommunityFee, "community fee: got %d", slc.Fees.CommunityFee) + r.Equal(uint64(315), slc.Fees.SecurityFee, "security fee: got %d", slc.Fees.SecurityFee) + return true + }, + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + r := require.New(t) + q, err := k.getConsensusQueue(ctx, queue) + r.NoError(err) + + getMsg := func(mid uint64) *evmtypes.Message { + m, err := q.GetMsgByID(ctx, mid) + r.NoError(err) + em, err := libmsg.ToEvmMessage(m, k.cdc) + r.NoError(err) + return em + } + + // message with no need for estimation + mid, err := k.PutMessageInQueue(ctx, queue, tc.msg, &consensus.PutOptions{RequireGasEstimation: true}) + r.NoError(err) + r.NoError(k.CheckAndProcessEstimatedMessages(ctx)) + tc.slcCheck(getMsg(mid), r, false) + + // Start processing the first votes + // Not enough validators will have vast their vote yet + for i, estimate := range estimates { + err = k.AddMessageGasEstimates(ctx, validators[i].Address, []*types.MsgAddMessageGasEstimates_GasEstimate{ + { + MsgId: mid, + QueueTypeName: queue, + Value: estimate, + EstimatedByAddress: validators[i].Address.String(), + }, + }) + r.NoError(err) + r.NoError(k.CheckAndProcessEstimatedMessages(ctx)) + m, err := q.GetMsgByID(ctx, mid) + r.NoError(err) + r.Len(m.GetGasEstimates(), i+1) + r.Equal(uint64(0), m.GetGasEstimate()) + tc.slcCheck(getMsg(mid), r, false) + } + + // We now get a new estimate that will push us above the threshold + // Paloma should build an expected gas cost from the median of all submitted estimates + err = k.AddMessageGasEstimates(ctx, validators[6].Address, []*types.MsgAddMessageGasEstimates_GasEstimate{ + { + MsgId: mid, + QueueTypeName: queue, + Value: 18_000, + EstimatedByAddress: validators[6].Address.String(), + }, + }) + r.NoError(err) + r.NoError(k.CheckAndProcessEstimatedMessages(ctx)) + m, err := q.GetMsgByID(ctx, mid) + r.NoError(err) + r.Len(m.GetGasEstimates(), 7) + r.Equal(uint64(25200), m.GetGasEstimate()) + tc.slcCheck(getMsg(mid), r, true) + }) + } +} diff --git a/x/consensus/keeper/filters/has_gas_estimate.go b/x/consensus/keeper/filters/has_gas_estimate.go new file mode 100644 index 00000000..b98771e4 --- /dev/null +++ b/x/consensus/keeper/filters/has_gas_estimate.go @@ -0,0 +1,13 @@ +package filters + +import "github.com/palomachain/paloma/x/consensus/types" + +// HasGasEstimate checks if the message has a gas estimate +func HasGasEstimate(msg types.QueuedSignedMessageI) bool { + if !msg.GetRequireGasEstimation() { + // Message does not require gas estimation + return true + } + + return msg.GetGasEstimate() > 0 +} diff --git a/x/consensus/keeper/filters/has_gas_estimate_test.go b/x/consensus/keeper/filters/has_gas_estimate_test.go new file mode 100644 index 00000000..8558fbef --- /dev/null +++ b/x/consensus/keeper/filters/has_gas_estimate_test.go @@ -0,0 +1,53 @@ +package filters + +import ( + "testing" + + "github.com/palomachain/paloma/x/consensus/types" + "github.com/stretchr/testify/require" +) + +func Test_HasGasEstimate(t *testing.T) { + tt := []struct { + name string + gasEstimate uint64 + flagMask uint32 + want bool + }{ + { + name: "no estimate needed, no gas estimate", + gasEstimate: 0, + flagMask: 0, + want: true, + }, + { + name: "no estimate needed, with gas estimate", + gasEstimate: 100, + flagMask: 0, + want: true, + }, + { + name: "estimate needed, no gas estimate", + gasEstimate: 0, + flagMask: 1, + want: false, + }, + { + name: "estimate needed, with gas estimate", + gasEstimate: 100, + flagMask: 1, + want: true, + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + msg := &types.QueuedSignedMessage{ + GasEstimate: tc.gasEstimate, + FlagMask: tc.flagMask, + } + res := HasGasEstimate(msg) + require.Equal(t, tc.want, res) + }) + } +} diff --git a/x/consensus/keeper/grpc_query_messages_in_queue.go b/x/consensus/keeper/grpc_query_messages_in_queue.go index afe15da1..68cb65fe 100644 --- a/x/consensus/keeper/grpc_query_messages_in_queue.go +++ b/x/consensus/keeper/grpc_query_messages_in_queue.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) MessageByID(goCtx context.Context, req *types.QueryMessageByIDRequest) (*types.MessageWithSignatures, error) { +func (k Keeper) MessageByID(goCtx context.Context, req *types.QueryMessageByIDRequest) (*types.MessageQueryResult, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -34,8 +34,14 @@ func (k Keeper) MessageByID(goCtx context.Context, req *types.QueryMessageByIDRe if err != nil { return nil, err } - approvedMessage.Evidence = append(approvedMessage.Evidence, msg.GetEvidence()...) - return &approvedMessage, nil + res := &types.MessageQueryResult{ + Message: &approvedMessage, + } + + copy(res.Evidence, msg.GetEvidence()) + copy(res.GasEstimates, msg.GetGasEstimates()) + + return res, nil } func (k Keeper) MessagesInQueue(goCtx context.Context, req *types.QueryMessagesInQueueRequest) (*types.QueryMessagesInQueueResponse, error) { diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index e7cca6a9..fc6895ea 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -17,6 +17,10 @@ import ( "github.com/palomachain/paloma/x/consensus/types" ) +type FeeProvider interface { + GetCombinedFeesForRelay(ctx context.Context, valAddress sdk.ValAddress, chainReferenceID string) (*types.MessageFeeSettings, error) +} + type ( Keeper struct { cdc codec.Codec @@ -30,6 +34,7 @@ type ( registry *registry evmKeeper types.EvmKeeper consensusChecker *libcons.ConsensusChecker + feeProvider FeeProvider } ) @@ -39,13 +44,15 @@ func NewKeeper( ps paramtypes.Subspace, valsetKeeper types.ValsetKeeper, reg *registry, + fp FeeProvider, ) *Keeper { k := &Keeper{ - cdc: cdc, - storeKey: storeKey, - paramstore: ps, - valset: valsetKeeper, - registry: reg, + cdc: cdc, + storeKey: storeKey, + paramstore: ps, + valset: valsetKeeper, + registry: reg, + feeProvider: fp, } ider := keeperutil.NewIDGenerator(k, nil) k.ider = ider diff --git a/x/consensus/keeper/keeper_setup_test.go b/x/consensus/keeper/keeper_setup_test.go index 6e24a4c7..fd2b0956 100644 --- a/x/consensus/keeper/keeper_setup_test.go +++ b/x/consensus/keeper/keeper_setup_test.go @@ -61,6 +61,7 @@ func newConsensusKeeper(t testing.TB) (*Keeper, mockedServices, sdk.Context) { paramsSubspace, ms.ValsetKeeper, NewRegistry(), + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, logger) diff --git a/x/consensus/keeper/msg_server.go b/x/consensus/keeper/msg_server.go index 49af951e..1ff176b0 100644 --- a/x/consensus/keeper/msg_server.go +++ b/x/consensus/keeper/msg_server.go @@ -2,9 +2,11 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/consensus/types" + "google.golang.org/protobuf/types/known/emptypb" ) type msgServer struct { @@ -39,3 +41,34 @@ func (k msgServer) AddMessagesSignatures(goCtx context.Context, msg *types.MsgAd return &types.MsgAddMessagesSignaturesResponse{}, nil } + +func (k msgServer) AddMessageEstimates(goCtx context.Context, msg *types.MsgAddMessageGasEstimates) (*emptypb.Empty, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + creator, _ := sdk.AccAddressFromBech32(msg.Metadata.Creator) + valAddr := sdk.ValAddress(creator.Bytes()) + + if err := k.Keeper.valset.CanAcceptValidator(ctx, valAddr); err != nil { + return nil, err + } + + if msg.Estimates == nil { + return nil, nil + } + + for _, estimate := range msg.Estimates { + if estimate.GetValue() < 1 { + return nil, fmt.Errorf("invalid gas estimate") + } + } + + if err := k.AddMessageGasEstimates( + ctx, + valAddr, + msg.Estimates, + ); err != nil { + return nil, err + } + + return &emptypb.Empty{}, nil +} diff --git a/x/consensus/keeper/msg_server_set_error_data.go b/x/consensus/keeper/msg_server_set_error_data.go index 67e644a9..2e39f0be 100644 --- a/x/consensus/keeper/msg_server_set_error_data.go +++ b/x/consensus/keeper/msg_server_set_error_data.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/consensus/types" @@ -18,6 +19,10 @@ func (k msgServer) SetErrorData(goCtx context.Context, msg *types.MsgSetErrorDat return nil, err } + if len(msg.Data) < 1 { + return nil, fmt.Errorf("data must not be nil") + } + err := k.Keeper.SetMessageErrorData(ctx, valAddr, msg) if err != nil { return nil, err diff --git a/x/consensus/keeper/msg_server_set_public_access_data.go b/x/consensus/keeper/msg_server_set_public_access_data.go index 0323e9b7..895489ef 100644 --- a/x/consensus/keeper/msg_server_set_public_access_data.go +++ b/x/consensus/keeper/msg_server_set_public_access_data.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/consensus/types" @@ -18,6 +19,10 @@ func (k msgServer) SetPublicAccessData(goCtx context.Context, msg *types.MsgSetP return nil, err } + if len(msg.Data) < 1 { + return nil, fmt.Errorf("data must not be nil") + } + err := k.Keeper.SetMessagePublicAccessData(ctx, valAddr, msg) if err != nil { return nil, err diff --git a/x/consensus/keeper/query_queued_messages_for_attesting.go b/x/consensus/keeper/query_queued_messages_for_attesting.go index d1e58dff..e383f05f 100644 --- a/x/consensus/keeper/query_queued_messages_for_attesting.go +++ b/x/consensus/keeper/query_queued_messages_for_attesting.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" "github.com/palomachain/paloma/x/consensus/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -22,7 +23,7 @@ func (k Keeper) QueuedMessagesForAttesting(goCtx context.Context, req *types.Que res := make([]types.MessageWithSignatures, len(msgs)) for i, msg := range msgs { - msgWithSignatures, err := k.queuedMessageToMessageWithSignatures(msg) + msgWithSignatures, err := consensus.ToMessageWithSignatures(msg, k.cdc) if err != nil { return nil, err } diff --git a/x/consensus/keeper/query_queued_messages_for_gas_estimation.go b/x/consensus/keeper/query_queued_messages_for_gas_estimation.go new file mode 100644 index 00000000..dfddb12f --- /dev/null +++ b/x/consensus/keeper/query_queued_messages_for_gas_estimation.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" + "github.com/palomachain/paloma/x/consensus/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) QueuedMessagesForGasEstimation(goCtx context.Context, req *types.QueryQueuedMessagesForGasEstimationRequest) (*types.QueryQueuedMessagesForGasEstimationResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + msgs, err := k.GetMessagesForGasEstimation(ctx, req.GetQueueTypeName(), req.GetValAddress()) + if err != nil { + return nil, fmt.Errorf("failed to query messages for gas estimation: %w", err) + } + + var res []types.MessageWithSignatures + for _, msg := range msgs { + if msg.GetRequireSignatures() { + msgWithSignatures, err := consensus.ToMessageWithSignatures(msg, k.cdc) + if err != nil { + return nil, fmt.Errorf("failed to convert queued message to message with signatures: %w", err) + } + res = append(res, msgWithSignatures) + } + } + + return &types.QueryQueuedMessagesForGasEstimationResponse{ + MessagesToEstimate: res, + }, nil +} diff --git a/x/consensus/keeper/query_queued_messages_for_relaying.go b/x/consensus/keeper/query_queued_messages_for_relaying.go index aa29d9d0..d83ef016 100644 --- a/x/consensus/keeper/query_queued_messages_for_relaying.go +++ b/x/consensus/keeper/query_queued_messages_for_relaying.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" "github.com/palomachain/paloma/x/consensus/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -28,7 +29,7 @@ func (k Keeper) QueuedMessagesForRelaying(goCtx context.Context, req *types.Quer var res []types.MessageWithSignatures for _, msg := range msgs { if msg.GetRequireSignatures() { - msgWithSignatures, err := k.queuedMessageToMessageWithSignatures(msg) + msgWithSignatures, err := consensus.ToMessageWithSignatures(msg, k.cdc) if err != nil { logger.WithError(err).Error("Failed to parse queued message to message with signatures.") return nil, err diff --git a/x/consensus/keeper/query_queued_messages_for_signing.go b/x/consensus/keeper/query_queued_messages_for_signing.go index d3db95ed..7b9fb341 100644 --- a/x/consensus/keeper/query_queued_messages_for_signing.go +++ b/x/consensus/keeper/query_queued_messages_for_signing.go @@ -3,6 +3,7 @@ package keeper import ( "context" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/consensus/types" "google.golang.org/grpc/codes" @@ -23,7 +24,7 @@ func (k Keeper) QueuedMessagesForSigning(goCtx context.Context, req *types.Query var res []*types.MessageToSign for _, msg := range msgs { if msg.GetRequireSignatures() { - res = append(res, k.queuedMessageToMessageToSign(msg)) + res = append(res, k.queuedMessageToMessageToSign(ctx, msg)) } } @@ -31,3 +32,27 @@ func (k Keeper) QueuedMessagesForSigning(goCtx context.Context, req *types.Query MessageToSign: res, }, nil } + +func (k Keeper) queuedMessageToMessageToSign(ctx context.Context, msg types.QueuedSignedMessageI) *types.MessageToSign { + consensusMsg, err := msg.ConsensusMsg(k.cdc) + if err != nil { + panic(err) + } + + anyMsg, err := codectypes.NewAnyWithValue(consensusMsg) + if err != nil { + panic(err) + } + + bytesToSign, err := msg.GetBytesToSign(k.cdc) + if err != nil { + panic(err) + } + + return &types.MessageToSign{ + Nonce: nonceFromID(msg.GetId()), + Id: msg.GetId(), + BytesToSign: bytesToSign, + Msg: anyMsg, + } +} diff --git a/x/consensus/module.go b/x/consensus/module.go index 071a9c94..57ab2af0 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -178,15 +178,12 @@ func (am AppModule) BeginBlock(context.Context) error { func (am AppModule) EndBlock(ct context.Context) error { ctx := sdk.UnwrapSDKContext(ct) am.keeper.Logger(ctx).Info("abci-validator-size", abci.ValidatorUpdates{}.Len()) - if err := am.keeper.CheckAndProcessAttestedMessages(ctx); err != nil { - am.keeper.Logger(ctx).Error("error while attesting to messages", "err", err) + if err := am.keeper.CheckAndProcessEstimatedMessages(ctx); err != nil { + am.keeper.Logger(ctx).Error("error while estimating to messages", "err", err) } - if ctx.BlockHeight()%10 == 0 { - err := am.keeper.ReassignOrphanedMessages(ctx, 10) - if err != nil { - am.keeper.Logger(ctx).Error("error while reassigning orphaned messages", "err", err) - } + if err := am.keeper.CheckAndProcessAttestedMessages(ctx); err != nil { + am.keeper.Logger(ctx).Error("error while attesting to messages", "err", err) } if ctx.BlockHeight()%50 == 0 { diff --git a/x/consensus/types/codec.go b/x/consensus/types/codec.go index 76865168..c045b458 100644 --- a/x/consensus/types/codec.go +++ b/x/consensus/types/codec.go @@ -11,6 +11,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&QueuedSignedMessage{}, "consensus/QueuedSignedMessage", nil) cdc.RegisterConcrete(&SignData{}, "consensus/SignData", nil) cdc.RegisterConcrete(&MsgAddMessagesSignatures{}, "consensus/AddMessagesSignatures", nil) + cdc.RegisterConcrete(&MsgAddMessageGasEstimates{}, "consensus/AddMessageGasEstimates", nil) cdc.RegisterConcrete(&MsgAddEvidence{}, "consensus/AddEvidence", nil) cdc.RegisterConcrete(&MsgSetPublicAccessData{}, "consensus/SetPublicAccessData", nil) cdc.RegisterConcrete(&MsgSetErrorData{}, "consensus/SetErrorData", nil) @@ -26,6 +27,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddMessagesSignatures{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgAddMessageGasEstimates{}, + ) registry.RegisterImplementations((*ConsensusMsg)(nil), &Batch{}, ) diff --git a/x/consensus/types/consensus.go b/x/consensus/types/consensus.go index 9c608078..a7cea44a 100644 --- a/x/consensus/types/consensus.go +++ b/x/consensus/types/consensus.go @@ -11,6 +11,14 @@ import ( xchain "github.com/palomachain/paloma/internal/x-chain" ) +const ( + cFlagGasEstimationRequired = 1 << 0 // Bit 0 +) + +type MessageHasher interface { + Keccak256WithSignedMessage(*QueuedSignedMessage) ([]byte, error) +} + type ConsensusQueueType string //go:generate mockery --name=QueuedSignedMessageI @@ -22,7 +30,11 @@ type QueuedSignedMessageI interface { GetAddedAt() time.Time ConsensusMsg(AnyUnpacker) (ConsensusMsg, error) GetSignData() []*SignData + GetGasEstimates() []*GasEstimate + GetGasEstimate() uint64 AddSignData(*SignData) + AddGasEstimate(*GasEstimate) + SetElectedGasEstimate(uint64) AddEvidence(Evidence) GetEvidence() []*Evidence SetPublicAccessData(*PublicAccessData) @@ -31,8 +43,9 @@ type QueuedSignedMessageI interface { GetErrorData() *ErrorData SetHandledAtBlockHeight(math.Int) GetHandledAtBlockHeight() *math.Int - GetBytesToSign() []byte + GetBytesToSign(AnyUnpacker) ([]byte, error) GetRequireSignatures() bool + GetRequireGasEstimation() bool GetMsg() *types.Any } @@ -56,6 +69,15 @@ func TypedBytesToSign[T any](fnc func(msg T, salt Salt) []byte) BytesToSignFunc }) } +func BuildFlagMask(requireGasEstimation bool) uint32 { + var value uint32 = 0 + if requireGasEstimation { + value |= cFlagGasEstimationRequired + } + + return value +} + var _ QueuedSignedMessageI = &QueuedSignedMessage{} type MessageQueuedForBatchingI interface { @@ -65,6 +87,19 @@ type MessageQueuedForBatchingI interface { var _ MessageQueuedForBatchingI = &BatchOfConsensusMessages{} +func (q *QueuedSignedMessage) GetBytesToSign(unpacker AnyUnpacker) ([]byte, error) { + msg, err := q.ConsensusMsg(unpacker) + if err != nil { + return nil, err + } + + k, ok := msg.(MessageHasher) + if !ok { + return nil, fmt.Errorf("message's action is not hashable: %T", msg) + } + return k.Keccak256WithSignedMessage(q) +} + func (q *QueuedSignedMessage) String() string { if q == nil { return "" @@ -80,6 +115,21 @@ func (q *QueuedSignedMessage) AddSignData(data *SignData) { q.SignData = append(q.SignData, data) } +func (q *QueuedSignedMessage) AddGasEstimate(data *GasEstimate) { + if q.GasEstimates == nil { + q.GasEstimates = []*GasEstimate{} + } + q.GasEstimates = append(q.GasEstimates, data) +} + +func (q *QueuedSignedMessage) SetElectedGasEstimate(estimate uint64) { + // Setting an estimated gas value for a message + // means we'll have to restart the signing process, + // this time with the complete information. + q.SignData = nil + q.GasEstimate = estimate +} + func (q *QueuedSignedMessage) AddEvidence(data Evidence) { if q.Evidence == nil { q.Evidence = []*Evidence{} @@ -100,6 +150,10 @@ func (q *QueuedSignedMessage) SetPublicAccessData(data *PublicAccessData) { q.PublicAccessData = data } +func (q *QueuedSignedMessage) GetRequireGasEstimation() bool { + return q.FlagMask&cFlagGasEstimationRequired != 0 +} + func (q *QueuedSignedMessage) SetErrorData(data *ErrorData) { q.ErrorData = data } @@ -128,6 +182,11 @@ func (b *Batch) GetSignBytes() []byte { return b.GetBytesToSign() } +// TODO should compute hash from msgs hashes +func (b *Batch) Keccak256WithSignedMessage(_ *QueuedSignedMessage) ([]byte, error) { + return nil, nil +} + func Queue(queueTypeName string, typ xchain.Type, refID xchain.ReferenceID) string { return fmt.Sprintf("%s/%s/%s", typ, refID, queueTypeName) } diff --git a/x/consensus/types/consensus_queue.pb.go b/x/consensus/types/consensus_queue.pb.go index 94b2fd87..b80db95d 100644 --- a/x/consensus/types/consensus_queue.pb.go +++ b/x/consensus/types/consensus_queue.pb.go @@ -38,7 +38,6 @@ type QueuedSignedMessage struct { AddedAtBlockHeight int64 `protobuf:"varint,2,opt,name=addedAtBlockHeight,proto3" json:"addedAtBlockHeight,omitempty"` AddedAt time.Time `protobuf:"bytes,3,opt,name=addedAt,proto3,stdtime" json:"addedAt"` Msg *types.Any `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` - BytesToSign []byte `protobuf:"bytes,5,opt,name=bytesToSign,proto3" json:"bytesToSign,omitempty"` SignData []*SignData `protobuf:"bytes,6,rep,name=signData,proto3" json:"signData,omitempty"` Evidence []*Evidence `protobuf:"bytes,7,rep,name=evidence,proto3" json:"evidence,omitempty"` PublicAccessData *PublicAccessData `protobuf:"bytes,8,opt,name=publicAccessData,proto3" json:"publicAccessData,omitempty"` @@ -47,6 +46,11 @@ type QueuedSignedMessage struct { // block height at which the message was assinged to the // current relayer. Updated when message is reassigned. HandledAtBlockHeight *cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=handled_at_block_height,json=handledAtBlockHeight,proto3,customtype=cosmossdk.io/math.Int" json:"handled_at_block_height,omitempty"` + GasEstimates []*GasEstimate `protobuf:"bytes,12,rep,name=gasEstimates,proto3" json:"gasEstimates,omitempty"` + // flagMask is a bitmask of flags that the message has. + // 1 = require gas estimate + FlagMask uint32 `protobuf:"varint,13,opt,name=flagMask,proto3" json:"flagMask,omitempty"` + GasEstimate uint64 `protobuf:"varint,14,opt,name=gasEstimate,proto3" json:"gasEstimate,omitempty"` } func (m *QueuedSignedMessage) Reset() { *m = QueuedSignedMessage{} } @@ -109,13 +113,6 @@ func (m *QueuedSignedMessage) GetMsg() *types.Any { return nil } -func (m *QueuedSignedMessage) GetBytesToSign() []byte { - if m != nil { - return m.BytesToSign - } - return nil -} - func (m *QueuedSignedMessage) GetSignData() []*SignData { if m != nil { return m.SignData @@ -151,6 +148,27 @@ func (m *QueuedSignedMessage) GetErrorData() *ErrorData { return nil } +func (m *QueuedSignedMessage) GetGasEstimates() []*GasEstimate { + if m != nil { + return m.GasEstimates + } + return nil +} + +func (m *QueuedSignedMessage) GetFlagMask() uint32 { + if m != nil { + return m.FlagMask + } + return 0 +} + +func (m *QueuedSignedMessage) GetGasEstimate() uint64 { + if m != nil { + return m.GasEstimate + } + return 0 +} + type BatchOfConsensusMessages struct { Msg *types.Any `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` } @@ -375,6 +393,58 @@ func (m *Evidence) GetProof() *types.Any { return nil } +type GasEstimate struct { + ValAddress github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=valAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"valAddress,omitempty"` + Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *GasEstimate) Reset() { *m = GasEstimate{} } +func (m *GasEstimate) String() string { return proto.CompactTextString(m) } +func (*GasEstimate) ProtoMessage() {} +func (*GasEstimate) Descriptor() ([]byte, []int) { + return fileDescriptor_3a5520bff1a7c91d, []int{5} +} +func (m *GasEstimate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GasEstimate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GasEstimate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GasEstimate) XXX_Merge(src proto.Message) { + xxx_messageInfo_GasEstimate.Merge(m, src) +} +func (m *GasEstimate) XXX_Size() int { + return m.Size() +} +func (m *GasEstimate) XXX_DiscardUnknown() { + xxx_messageInfo_GasEstimate.DiscardUnknown(m) +} + +var xxx_messageInfo_GasEstimate proto.InternalMessageInfo + +func (m *GasEstimate) GetValAddress() github_com_cosmos_cosmos_sdk_types.ValAddress { + if m != nil { + return m.ValAddress + } + return nil +} + +func (m *GasEstimate) GetValue() uint64 { + if m != nil { + return m.Value + } + return 0 +} + type PublicAccessData struct { ValAddress github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=valAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"valAddress,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -385,7 +455,7 @@ func (m *PublicAccessData) Reset() { *m = PublicAccessData{} } func (m *PublicAccessData) String() string { return proto.CompactTextString(m) } func (*PublicAccessData) ProtoMessage() {} func (*PublicAccessData) Descriptor() ([]byte, []int) { - return fileDescriptor_3a5520bff1a7c91d, []int{5} + return fileDescriptor_3a5520bff1a7c91d, []int{6} } func (m *PublicAccessData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,7 +514,7 @@ func (m *ErrorData) Reset() { *m = ErrorData{} } func (m *ErrorData) String() string { return proto.CompactTextString(m) } func (*ErrorData) ProtoMessage() {} func (*ErrorData) Descriptor() ([]byte, []int) { - return fileDescriptor_3a5520bff1a7c91d, []int{6} + return fileDescriptor_3a5520bff1a7c91d, []int{7} } func (m *ErrorData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -493,6 +563,7 @@ func init() { proto.RegisterType((*Batch)(nil), "palomachain.paloma.consensus.Batch") proto.RegisterType((*SignData)(nil), "palomachain.paloma.consensus.SignData") proto.RegisterType((*Evidence)(nil), "palomachain.paloma.consensus.Evidence") + proto.RegisterType((*GasEstimate)(nil), "palomachain.paloma.consensus.GasEstimate") proto.RegisterType((*PublicAccessData)(nil), "palomachain.paloma.consensus.PublicAccessData") proto.RegisterType((*ErrorData)(nil), "palomachain.paloma.consensus.ErrorData") } @@ -502,55 +573,60 @@ func init() { } var fileDescriptor_3a5520bff1a7c91d = []byte{ - // 761 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x3d, 0x6f, 0xdb, 0x48, - 0x10, 0xd5, 0xea, 0xc3, 0x96, 0x56, 0xc6, 0xc1, 0xde, 0xf3, 0xdd, 0xd1, 0x82, 0x21, 0x11, 0x2a, - 0x7c, 0x84, 0x71, 0x26, 0xef, 0x7c, 0xc0, 0x15, 0x57, 0x04, 0x10, 0x63, 0x03, 0x11, 0x82, 0x20, - 0x31, 0x6d, 0xa4, 0x70, 0x23, 0xac, 0xb8, 0x6b, 0x8a, 0x30, 0xc9, 0x95, 0xb9, 0x4b, 0xc3, 0xfa,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f0, 0x77, 0x7a, 0x22, 0x68, 0x18, 0x60, 0xaf, 0x65, 0xdb, 0x2c, 0x0a, 0x44, - 0x26, 0x2d, 0xde, 0xac, 0x8a, 0x75, 0x4d, 0x35, 0xee, 0x9a, 0x98, 0xec, 0x21, 0x1d, 0xa4, 0x4b, - 0x35, 0x4e, 0x34, 0x9f, 0x01, 0x58, 0xce, 0x1c, 0x7e, 0x17, 0x27, 0x5e, 0x87, 0xa5, 0x7e, 0xc8, - 0xd8, 0x81, 0x3c, 0xed, 0x75, 0xe3, 0x49, 0x20, 0xcd, 0xe7, 0x00, 0x2e, 0x4e, 0x6f, 0xc8, 0x5d, - 0x68, 0x42, 0xb0, 0x48, 0xe2, 0x2b, 0x4e, 0x06, 0x20, 0x63, 0x54, 0x83, 0xe5, 0x63, 0xec, 0x71, - 0x2a, 0xda, 0x5b, 0xf2, 0xea, 0x8b, 0xd6, 0xe8, 0xb9, 0x19, 0xc2, 0xca, 0x68, 0x6b, 0x7e, 0x92, - 0x1e, 0xb3, 0x7d, 0x76, 0x51, 0x07, 0xe7, 0x17, 0x75, 0xf0, 0xe9, 0xa2, 0x0e, 0x4e, 0x2f, 0xeb, - 0xb9, 0xf3, 0xcb, 0x7a, 0xee, 0xfd, 0x65, 0x3d, 0xb7, 0x6f, 0x4c, 0xbc, 0xe8, 0x8a, 0x6f, 0xd8, - 0xc9, 0xc4, 0x57, 0x4c, 0xbe, 0xb5, 0x3b, 0x27, 0xef, 0xfa, 0xdf, 0x6f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xfa, 0x1b, 0xa6, 0xec, 0xf2, 0x06, 0x00, 0x00, + // 835 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xbf, 0x8f, 0xe3, 0x44, + 0x14, 0xce, 0x6c, 0x9c, 0x3d, 0x67, 0xb2, 0x77, 0xda, 0x1b, 0x16, 0xf0, 0xad, 0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, 0x2d, 0x48, 0xc4, 0xa9, 0x18, 0x3e, 0x91, 0x2d, 0xd7, + 0x70, 0xb5, 0xee, 0xa7, 0xb0, 0x5d, 0xbd, 0x26, 0xff, 0x13, 0x1f, 0x77, 0x78, 0x72, 0xda, 0x05, + 0xaf, 0x4e, 0xbb, 0xe0, 0xcf, 0xd3, 0x2e, 0x78, 0x79, 0xd6, 0x6d, 0xbc, 0x3a, 0xeb, 0x36, 0x7e, + 0x3b, 0xeb, 0x36, 0x9e, 0x3b, 0xb5, 0x8d, 0xae, 0xf8, 0x72, 0x1f, 0xd7, 0xbe, 0xdd, 0x72, 0xd7, + 0xf1, 0xa6, 0xec, 0xf1, 0x87, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x07, 0x2a, 0x30, 0xe8, + 0x07, 0x00, 0x00, } func (m *QueuedSignedMessage) Marshal() (dAtA []byte, err error) { @@ -573,6 +649,30 @@ func (m *QueuedSignedMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GasEstimate != 0 { + i = encodeVarintConsensusQueue(dAtA, i, uint64(m.GasEstimate)) + i-- + dAtA[i] = 0x70 + } + if m.FlagMask != 0 { + i = encodeVarintConsensusQueue(dAtA, i, uint64(m.FlagMask)) + i-- + dAtA[i] = 0x68 + } + if len(m.GasEstimates) > 0 { + for iNdEx := len(m.GasEstimates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GasEstimates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusQueue(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + } if m.HandledAtBlockHeight != nil { { size := m.HandledAtBlockHeight.Size() @@ -647,13 +747,6 @@ func (m *QueuedSignedMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x32 } } - if len(m.BytesToSign) > 0 { - i -= len(m.BytesToSign) - copy(dAtA[i:], m.BytesToSign) - i = encodeVarintConsensusQueue(dAtA, i, uint64(len(m.BytesToSign))) - i-- - dAtA[i] = 0x2a - } if m.Msg != nil { { size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) @@ -866,6 +959,41 @@ func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GasEstimate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GasEstimate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GasEstimate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != 0 { + i = encodeVarintConsensusQueue(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 + } + if len(m.ValAddress) > 0 { + i -= len(m.ValAddress) + copy(dAtA[i:], m.ValAddress) + i = encodeVarintConsensusQueue(dAtA, i, uint64(len(m.ValAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *PublicAccessData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -974,10 +1102,6 @@ func (m *QueuedSignedMessage) Size() (n int) { l = m.Msg.Size() n += 1 + l + sovConsensusQueue(uint64(l)) } - l = len(m.BytesToSign) - if l > 0 { - n += 1 + l + sovConsensusQueue(uint64(l)) - } if len(m.SignData) > 0 { for _, e := range m.SignData { l = e.Size() @@ -1005,6 +1129,18 @@ func (m *QueuedSignedMessage) Size() (n int) { l = m.HandledAtBlockHeight.Size() n += 1 + l + sovConsensusQueue(uint64(l)) } + if len(m.GasEstimates) > 0 { + for _, e := range m.GasEstimates { + l = e.Size() + n += 1 + l + sovConsensusQueue(uint64(l)) + } + } + if m.FlagMask != 0 { + n += 1 + sovConsensusQueue(uint64(m.FlagMask)) + } + if m.GasEstimate != 0 { + n += 1 + sovConsensusQueue(uint64(m.GasEstimate)) + } return n } @@ -1086,6 +1222,22 @@ func (m *Evidence) Size() (n int) { return n } +func (m *GasEstimate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValAddress) + if l > 0 { + n += 1 + l + sovConsensusQueue(uint64(l)) + } + if m.Value != 0 { + n += 1 + sovConsensusQueue(uint64(m.Value)) + } + return n +} + func (m *PublicAccessData) Size() (n int) { if m == nil { return 0 @@ -1265,40 +1417,6 @@ func (m *QueuedSignedMessage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BytesToSign", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensusQueue - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConsensusQueue - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConsensusQueue - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BytesToSign = append(m.BytesToSign[:0], dAtA[iNdEx:postIndex]...) - if m.BytesToSign == nil { - m.BytesToSign = []byte{} - } - iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SignData", wireType) @@ -1495,6 +1613,78 @@ func (m *QueuedSignedMessage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasEstimates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusQueue + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusQueue + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GasEstimates = append(m.GasEstimates, &GasEstimate{}) + if err := m.GasEstimates[len(m.GasEstimates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FlagMask", wireType) + } + m.FlagMask = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FlagMask |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasEstimate", wireType) + } + m.GasEstimate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasEstimate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipConsensusQueue(dAtA[iNdEx:]) @@ -2058,6 +2248,109 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { } return nil } +func (m *GasEstimate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GasEstimate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GasEstimate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthConsensusQueue + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthConsensusQueue + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValAddress = append(m.ValAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ValAddress == nil { + m.ValAddress = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsensusQueue + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipConsensusQueue(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConsensusQueue + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *PublicAccessData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/consensus/types/expected_keepers.go b/x/consensus/types/expected_keepers.go index 88ec1c69..747a98b9 100644 --- a/x/consensus/types/expected_keepers.go +++ b/x/consensus/types/expected_keepers.go @@ -31,5 +31,5 @@ type ValsetKeeper interface { //go:generate mockery --name=EvmKeeper type EvmKeeper interface { - PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) + PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, string, error) } diff --git a/x/consensus/types/fees.go b/x/consensus/types/fees.go new file mode 100644 index 00000000..27979fa3 --- /dev/null +++ b/x/consensus/types/fees.go @@ -0,0 +1,19 @@ +package types + +import ( + "context" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type MessageFeeSettings struct { + RelayerFee math.LegacyDec + CommunityFee math.LegacyDec + SecurityFee math.LegacyDec +} + +type FeeProvider func( + ctx context.Context, + valAddress sdk.ValAddress, + ChainReferenceID string) (*MessageFeeSettings, error) diff --git a/x/consensus/types/mocks/AttestTask.go b/x/consensus/types/mocks/AttestTask.go index 924cfc32..455866be 100644 --- a/x/consensus/types/mocks/AttestTask.go +++ b/x/consensus/types/mocks/AttestTask.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -19,7 +19,8 @@ func (_m *AttestTask) Attest() { func NewAttestTask(t interface { mock.TestingT Cleanup(func()) -}) *AttestTask { +}, +) *AttestTask { mock := &AttestTask{} mock.Mock.Test(t) diff --git a/x/consensus/types/mocks/Attestator.go b/x/consensus/types/mocks/Attestator.go index 4fd315f4..2eabc826 100644 --- a/x/consensus/types/mocks/Attestator.go +++ b/x/consensus/types/mocks/Attestator.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -65,7 +65,8 @@ func (_m *Attestator) ValidateEvidence(ctx context.Context, task types.AttestTas func NewAttestator(t interface { mock.TestingT Cleanup(func()) -}) *Attestator { +}, +) *Attestator { mock := &Attestator{} mock.Mock.Test(t) diff --git a/x/consensus/types/mocks/EvmKeeper.go b/x/consensus/types/mocks/EvmKeeper.go index 38490503..37d853c3 100644 --- a/x/consensus/types/mocks/EvmKeeper.go +++ b/x/consensus/types/mocks/EvmKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -16,7 +16,7 @@ type EvmKeeper struct { } // PickValidatorForMessage provides a mock function with given fields: ctx, chainReferenceID, requirements -func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) { +func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, string, error) { ret := _m.Called(ctx, chainReferenceID, requirements) if len(ret) == 0 { @@ -24,8 +24,9 @@ func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReference } var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) (string, error)); ok { + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) (string, string, error)); ok { return rf(ctx, chainReferenceID, requirements) } if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) string); ok { @@ -34,13 +35,19 @@ func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReference r0 = ret.Get(0).(string) } - if rf, ok := ret.Get(1).(func(context.Context, string, *xchain.JobRequirements) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, string, *xchain.JobRequirements) string); ok { r1 = rf(ctx, chainReferenceID, requirements) } else { - r1 = ret.Error(1) + r1 = ret.Get(1).(string) } - return r0, r1 + if rf, ok := ret.Get(2).(func(context.Context, string, *xchain.JobRequirements) error); ok { + r2 = rf(ctx, chainReferenceID, requirements) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 } // NewEvmKeeper creates a new instance of EvmKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. @@ -48,8 +55,7 @@ func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReference func NewEvmKeeper(t interface { mock.TestingT Cleanup(func()) -}, -) *EvmKeeper { +}) *EvmKeeper { mock := &EvmKeeper{} mock.Mock.Test(t) diff --git a/x/consensus/types/mocks/QueryServer.go b/x/consensus/types/mocks/QueryServer.go index 000b304f..c6268f35 100644 --- a/x/consensus/types/mocks/QueryServer.go +++ b/x/consensus/types/mocks/QueryServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -45,23 +45,23 @@ func (_m *QueryServer) GetAllQueueNames(_a0 context.Context, _a1 *types.QueryGet } // MessageByID provides a mock function with given fields: _a0, _a1 -func (_m *QueryServer) MessageByID(_a0 context.Context, _a1 *types.QueryMessageByIDRequest) (*types.MessageWithSignatures, error) { +func (_m *QueryServer) MessageByID(_a0 context.Context, _a1 *types.QueryMessageByIDRequest) (*types.MessageQueryResult, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for MessageByID") } - var r0 *types.MessageWithSignatures + var r0 *types.MessageQueryResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryMessageByIDRequest) (*types.MessageWithSignatures, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryMessageByIDRequest) (*types.MessageQueryResult, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryMessageByIDRequest) *types.MessageWithSignatures); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryMessageByIDRequest) *types.MessageQueryResult); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.MessageWithSignatures) + r0 = ret.Get(0).(*types.MessageQueryResult) } } @@ -164,6 +164,36 @@ func (_m *QueryServer) QueuedMessagesForAttesting(_a0 context.Context, _a1 *type return r0, r1 } +// QueuedMessagesForGasEstimation provides a mock function with given fields: _a0, _a1 +func (_m *QueryServer) QueuedMessagesForGasEstimation(_a0 context.Context, _a1 *types.QueryQueuedMessagesForGasEstimationRequest) (*types.QueryQueuedMessagesForGasEstimationResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for QueuedMessagesForGasEstimation") + } + + var r0 *types.QueryQueuedMessagesForGasEstimationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryQueuedMessagesForGasEstimationRequest) (*types.QueryQueuedMessagesForGasEstimationResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryQueuedMessagesForGasEstimationRequest) *types.QueryQueuedMessagesForGasEstimationResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryQueuedMessagesForGasEstimationResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.QueryQueuedMessagesForGasEstimationRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // QueuedMessagesForRelaying provides a mock function with given fields: _a0, _a1 func (_m *QueryServer) QueuedMessagesForRelaying(_a0 context.Context, _a1 *types.QueryQueuedMessagesForRelayingRequest) (*types.QueryQueuedMessagesForRelayingResponse, error) { ret := _m.Called(_a0, _a1) diff --git a/x/consensus/types/mocks/QueuedSignedMessageI.go b/x/consensus/types/mocks/QueuedSignedMessageI.go index 27708545..2da0702a 100644 --- a/x/consensus/types/mocks/QueuedSignedMessageI.go +++ b/x/consensus/types/mocks/QueuedSignedMessageI.go @@ -1,9 +1,11 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks import ( + math "cosmossdk.io/math" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + mock "github.com/stretchr/testify/mock" time "time" @@ -21,6 +23,11 @@ func (_m *QueuedSignedMessageI) AddEvidence(_a0 types.Evidence) { _m.Called(_a0) } +// AddGasEstimate provides a mock function with given fields: _a0 +func (_m *QueuedSignedMessageI) AddGasEstimate(_a0 *types.GasEstimate) { + _m.Called(_a0) +} + // AddSignData provides a mock function with given fields: _a0 func (_m *QueuedSignedMessageI) AddSignData(_a0 *types.SignData) { _m.Called(_a0) @@ -92,24 +99,34 @@ func (_m *QueuedSignedMessageI) GetAddedAtBlockHeight() int64 { return r0 } -// GetBytesToSign provides a mock function with given fields: -func (_m *QueuedSignedMessageI) GetBytesToSign() []byte { - ret := _m.Called() +// GetBytesToSign provides a mock function with given fields: _a0 +func (_m *QueuedSignedMessageI) GetBytesToSign(_a0 codectypes.AnyUnpacker) ([]byte, error) { + ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetBytesToSign") } var r0 []byte - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() + var r1 error + if rf, ok := ret.Get(0).(func(codectypes.AnyUnpacker) ([]byte, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(codectypes.AnyUnpacker) []byte); ok { + r0 = rf(_a0) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } - return r0 + if rf, ok := ret.Get(1).(func(codectypes.AnyUnpacker) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // GetErrorData provides a mock function with given fields: @@ -152,6 +169,64 @@ func (_m *QueuedSignedMessageI) GetEvidence() []*types.Evidence { return r0 } +// GetGasEstimate provides a mock function with given fields: +func (_m *QueuedSignedMessageI) GetGasEstimate() uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasEstimate") + } + + var r0 uint64 + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + return r0 +} + +// GetGasEstimates provides a mock function with given fields: +func (_m *QueuedSignedMessageI) GetGasEstimates() []*types.GasEstimate { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasEstimates") + } + + var r0 []*types.GasEstimate + if rf, ok := ret.Get(0).(func() []*types.GasEstimate); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.GasEstimate) + } + } + + return r0 +} + +// GetHandledAtBlockHeight provides a mock function with given fields: +func (_m *QueuedSignedMessageI) GetHandledAtBlockHeight() *math.Int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHandledAtBlockHeight") + } + + var r0 *math.Int + if rf, ok := ret.Get(0).(func() *math.Int); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*math.Int) + } + } + + return r0 +} + // GetId provides a mock function with given fields: func (_m *QueuedSignedMessageI) GetId() uint64 { ret := _m.Called() @@ -210,6 +285,24 @@ func (_m *QueuedSignedMessageI) GetPublicAccessData() *types.PublicAccessData { return r0 } +// GetRequireGasEstimation provides a mock function with given fields: +func (_m *QueuedSignedMessageI) GetRequireGasEstimation() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRequireGasEstimation") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // GetRequireSignatures provides a mock function with given fields: func (_m *QueuedSignedMessageI) GetRequireSignatures() bool { ret := _m.Called() @@ -278,11 +371,21 @@ func (_m *QueuedSignedMessageI) Reset() { _m.Called() } +// SetElectedGasEstimate provides a mock function with given fields: _a0 +func (_m *QueuedSignedMessageI) SetElectedGasEstimate(_a0 uint64) { + _m.Called(_a0) +} + // SetErrorData provides a mock function with given fields: _a0 func (_m *QueuedSignedMessageI) SetErrorData(_a0 *types.ErrorData) { _m.Called(_a0) } +// SetHandledAtBlockHeight provides a mock function with given fields: _a0 +func (_m *QueuedSignedMessageI) SetHandledAtBlockHeight(_a0 math.Int) { + _m.Called(_a0) +} + // SetPublicAccessData provides a mock function with given fields: _a0 func (_m *QueuedSignedMessageI) SetPublicAccessData(_a0 *types.PublicAccessData) { _m.Called(_a0) diff --git a/x/consensus/types/mocks/ValsetKeeper.go b/x/consensus/types/mocks/ValsetKeeper.go index 9f7d3eb8..601752bd 100644 --- a/x/consensus/types/mocks/ValsetKeeper.go +++ b/x/consensus/types/mocks/ValsetKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/x/consensus/types/query.pb.go b/x/consensus/types/query.pb.go index 857f7f6d..0d25deb5 100644 --- a/x/consensus/types/query.pb.go +++ b/x/consensus/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -15,15 +19,14 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -32,8 +35,7 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} +type QueryParamsRequest struct{} func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } @@ -41,9 +43,11 @@ func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{0} } + func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) @@ -56,12 +60,15 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsRequest.Merge(m, src) } + func (m *QueryParamsRequest) XXX_Size() int { return m.Size() } + func (m *QueryParamsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) } @@ -80,9 +87,11 @@ func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{1} } + func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) @@ -95,12 +104,15 @@ func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsResponse.Merge(m, src) } + func (m *QueryParamsResponse) XXX_Size() int { return m.Size() } + func (m *QueryParamsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) } @@ -125,9 +137,11 @@ func (*QueryQueuedMessagesForSigningRequest) ProtoMessage() {} func (*QueryQueuedMessagesForSigningRequest) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{2} } + func (m *QueryQueuedMessagesForSigningRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForSigningRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForSigningRequest.Marshal(b, m, deterministic) @@ -140,12 +154,15 @@ func (m *QueryQueuedMessagesForSigningRequest) XXX_Marshal(b []byte, determinist return b[:n], nil } } + func (m *QueryQueuedMessagesForSigningRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForSigningRequest.Merge(m, src) } + func (m *QueryQueuedMessagesForSigningRequest) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForSigningRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForSigningRequest.DiscardUnknown(m) } @@ -176,9 +193,11 @@ func (*QueryQueuedMessagesForSigningResponse) ProtoMessage() {} func (*QueryQueuedMessagesForSigningResponse) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{3} } + func (m *QueryQueuedMessagesForSigningResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForSigningResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForSigningResponse.Marshal(b, m, deterministic) @@ -191,12 +210,15 @@ func (m *QueryQueuedMessagesForSigningResponse) XXX_Marshal(b []byte, determinis return b[:n], nil } } + func (m *QueryQueuedMessagesForSigningResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForSigningResponse.Merge(m, src) } + func (m *QueryQueuedMessagesForSigningResponse) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForSigningResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForSigningResponse.DiscardUnknown(m) } @@ -223,9 +245,11 @@ func (*MessageToSign) ProtoMessage() {} func (*MessageToSign) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{4} } + func (m *MessageToSign) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MessageToSign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MessageToSign.Marshal(b, m, deterministic) @@ -238,12 +262,15 @@ func (m *MessageToSign) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } + func (m *MessageToSign) XXX_Merge(src proto.Message) { xxx_messageInfo_MessageToSign.Merge(m, src) } + func (m *MessageToSign) XXX_Size() int { return m.Size() } + func (m *MessageToSign) XXX_DiscardUnknown() { xxx_messageInfo_MessageToSign.DiscardUnknown(m) } @@ -292,9 +319,11 @@ func (*ValidatorSignature) ProtoMessage() {} func (*ValidatorSignature) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{5} } + func (m *ValidatorSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *ValidatorSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ValidatorSignature.Marshal(b, m, deterministic) @@ -307,12 +336,15 @@ func (m *ValidatorSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *ValidatorSignature) XXX_Merge(src proto.Message) { xxx_messageInfo_ValidatorSignature.Merge(m, src) } + func (m *ValidatorSignature) XXX_Size() int { return m.Size() } + func (m *ValidatorSignature) XXX_DiscardUnknown() { xxx_messageInfo_ValidatorSignature.DiscardUnknown(m) } @@ -362,8 +394,8 @@ type MessageWithSignatures struct { BytesToSign []byte `protobuf:"bytes,5,opt,name=bytesToSign,proto3" json:"bytesToSign,omitempty"` PublicAccessData []byte `protobuf:"bytes,6,opt,name=publicAccessData,proto3" json:"publicAccessData,omitempty"` ErrorData []byte `protobuf:"bytes,7,opt,name=errorData,proto3" json:"errorData,omitempty"` - Evidence []*Evidence `protobuf:"bytes,8,rep,name=evidence,proto3" json:"evidence,omitempty"` ValsetID uint64 `protobuf:"varint,9,opt,name=valsetID,proto3" json:"valsetID,omitempty"` + GasEstimate uint64 `protobuf:"varint,10,opt,name=gasEstimate,proto3" json:"gasEstimate,omitempty"` } func (m *MessageWithSignatures) Reset() { *m = MessageWithSignatures{} } @@ -372,9 +404,11 @@ func (*MessageWithSignatures) ProtoMessage() {} func (*MessageWithSignatures) Descriptor() ([]byte, []int) { return fileDescriptor_186b66ae011355e3, []int{6} } + func (m *MessageWithSignatures) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MessageWithSignatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MessageWithSignatures.Marshal(b, m, deterministic) @@ -387,12 +421,15 @@ func (m *MessageWithSignatures) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } + func (m *MessageWithSignatures) XXX_Merge(src proto.Message) { xxx_messageInfo_MessageWithSignatures.Merge(m, src) } + func (m *MessageWithSignatures) XXX_Size() int { return m.Size() } + func (m *MessageWithSignatures) XXX_DiscardUnknown() { xxx_messageInfo_MessageWithSignatures.DiscardUnknown(m) } @@ -448,18 +485,83 @@ func (m *MessageWithSignatures) GetErrorData() []byte { return nil } -func (m *MessageWithSignatures) GetEvidence() []*Evidence { +func (m *MessageWithSignatures) GetValsetID() uint64 { + if m != nil { + return m.ValsetID + } + return 0 +} + +func (m *MessageWithSignatures) GetGasEstimate() uint64 { + if m != nil { + return m.GasEstimate + } + return 0 +} + +type MessageQueryResult struct { + Message *MessageWithSignatures `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Evidence []*Evidence `protobuf:"bytes,2,rep,name=evidence,proto3" json:"evidence,omitempty"` + GasEstimates []*GasEstimate `protobuf:"bytes,3,rep,name=gasEstimates,proto3" json:"gasEstimates,omitempty"` +} + +func (m *MessageQueryResult) Reset() { *m = MessageQueryResult{} } +func (m *MessageQueryResult) String() string { return proto.CompactTextString(m) } +func (*MessageQueryResult) ProtoMessage() {} +func (*MessageQueryResult) Descriptor() ([]byte, []int) { + return fileDescriptor_186b66ae011355e3, []int{7} +} + +func (m *MessageQueryResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *MessageQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MessageQueryResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *MessageQueryResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageQueryResult.Merge(m, src) +} + +func (m *MessageQueryResult) XXX_Size() int { + return m.Size() +} + +func (m *MessageQueryResult) XXX_DiscardUnknown() { + xxx_messageInfo_MessageQueryResult.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageQueryResult proto.InternalMessageInfo + +func (m *MessageQueryResult) GetMessage() *MessageWithSignatures { + if m != nil { + return m.Message + } + return nil +} + +func (m *MessageQueryResult) GetEvidence() []*Evidence { if m != nil { return m.Evidence } return nil } -func (m *MessageWithSignatures) GetValsetID() uint64 { +func (m *MessageQueryResult) GetGasEstimates() []*GasEstimate { if m != nil { - return m.ValsetID + return m.GasEstimates } - return 0 + return nil } type QueryMessageByIDRequest struct { @@ -471,11 +573,13 @@ func (m *QueryMessageByIDRequest) Reset() { *m = QueryMessageByIDRequest func (m *QueryMessageByIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryMessageByIDRequest) ProtoMessage() {} func (*QueryMessageByIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{7} + return fileDescriptor_186b66ae011355e3, []int{8} } + func (m *QueryMessageByIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryMessageByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryMessageByIDRequest.Marshal(b, m, deterministic) @@ -488,12 +592,15 @@ func (m *QueryMessageByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } + func (m *QueryMessageByIDRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMessageByIDRequest.Merge(m, src) } + func (m *QueryMessageByIDRequest) XXX_Size() int { return m.Size() } + func (m *QueryMessageByIDRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryMessageByIDRequest.DiscardUnknown(m) } @@ -523,11 +630,13 @@ func (m *QueryMessagesInQueueRequest) Reset() { *m = QueryMessagesInQueu func (m *QueryMessagesInQueueRequest) String() string { return proto.CompactTextString(m) } func (*QueryMessagesInQueueRequest) ProtoMessage() {} func (*QueryMessagesInQueueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{8} + return fileDescriptor_186b66ae011355e3, []int{9} } + func (m *QueryMessagesInQueueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryMessagesInQueueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryMessagesInQueueRequest.Marshal(b, m, deterministic) @@ -540,12 +649,15 @@ func (m *QueryMessagesInQueueRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } + func (m *QueryMessagesInQueueRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMessagesInQueueRequest.Merge(m, src) } + func (m *QueryMessagesInQueueRequest) XXX_Size() int { return m.Size() } + func (m *QueryMessagesInQueueRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryMessagesInQueueRequest.DiscardUnknown(m) } @@ -574,11 +686,13 @@ func (m *QueryMessagesInQueueResponse) Reset() { *m = QueryMessagesInQue func (m *QueryMessagesInQueueResponse) String() string { return proto.CompactTextString(m) } func (*QueryMessagesInQueueResponse) ProtoMessage() {} func (*QueryMessagesInQueueResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{9} + return fileDescriptor_186b66ae011355e3, []int{10} } + func (m *QueryMessagesInQueueResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryMessagesInQueueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryMessagesInQueueResponse.Marshal(b, m, deterministic) @@ -591,12 +705,15 @@ func (m *QueryMessagesInQueueResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } + func (m *QueryMessagesInQueueResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMessagesInQueueResponse.Merge(m, src) } + func (m *QueryMessagesInQueueResponse) XXX_Size() int { return m.Size() } + func (m *QueryMessagesInQueueResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryMessagesInQueueResponse.DiscardUnknown(m) } @@ -619,11 +736,13 @@ func (m *QueryQueuedMessagesForRelayingRequest) Reset() { *m = QueryQueu func (m *QueryQueuedMessagesForRelayingRequest) String() string { return proto.CompactTextString(m) } func (*QueryQueuedMessagesForRelayingRequest) ProtoMessage() {} func (*QueryQueuedMessagesForRelayingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{10} + return fileDescriptor_186b66ae011355e3, []int{11} } + func (m *QueryQueuedMessagesForRelayingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForRelayingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForRelayingRequest.Marshal(b, m, deterministic) @@ -636,12 +755,15 @@ func (m *QueryQueuedMessagesForRelayingRequest) XXX_Marshal(b []byte, determinis return b[:n], nil } } + func (m *QueryQueuedMessagesForRelayingRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForRelayingRequest.Merge(m, src) } + func (m *QueryQueuedMessagesForRelayingRequest) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForRelayingRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForRelayingRequest.DiscardUnknown(m) } @@ -672,11 +794,13 @@ func (m *QueryQueuedMessagesForRelayingResponse) Reset() { func (m *QueryQueuedMessagesForRelayingResponse) String() string { return proto.CompactTextString(m) } func (*QueryQueuedMessagesForRelayingResponse) ProtoMessage() {} func (*QueryQueuedMessagesForRelayingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{11} + return fileDescriptor_186b66ae011355e3, []int{12} } + func (m *QueryQueuedMessagesForRelayingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForRelayingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForRelayingResponse.Marshal(b, m, deterministic) @@ -689,12 +813,15 @@ func (m *QueryQueuedMessagesForRelayingResponse) XXX_Marshal(b []byte, determini return b[:n], nil } } + func (m *QueryQueuedMessagesForRelayingResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForRelayingResponse.Merge(m, src) } + func (m *QueryQueuedMessagesForRelayingResponse) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForRelayingResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForRelayingResponse.DiscardUnknown(m) } @@ -719,11 +846,13 @@ func (m *QueryQueuedMessagesForAttestingRequest) Reset() { func (m *QueryQueuedMessagesForAttestingRequest) String() string { return proto.CompactTextString(m) } func (*QueryQueuedMessagesForAttestingRequest) ProtoMessage() {} func (*QueryQueuedMessagesForAttestingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{12} + return fileDescriptor_186b66ae011355e3, []int{13} } + func (m *QueryQueuedMessagesForAttestingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForAttestingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForAttestingRequest.Marshal(b, m, deterministic) @@ -736,12 +865,15 @@ func (m *QueryQueuedMessagesForAttestingRequest) XXX_Marshal(b []byte, determini return b[:n], nil } } + func (m *QueryQueuedMessagesForAttestingRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForAttestingRequest.Merge(m, src) } + func (m *QueryQueuedMessagesForAttestingRequest) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForAttestingRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForAttestingRequest.DiscardUnknown(m) } @@ -772,11 +904,13 @@ func (m *QueryQueuedMessagesForAttestingResponse) Reset() { func (m *QueryQueuedMessagesForAttestingResponse) String() string { return proto.CompactTextString(m) } func (*QueryQueuedMessagesForAttestingResponse) ProtoMessage() {} func (*QueryQueuedMessagesForAttestingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{13} + return fileDescriptor_186b66ae011355e3, []int{14} } + func (m *QueryQueuedMessagesForAttestingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryQueuedMessagesForAttestingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryQueuedMessagesForAttestingResponse.Marshal(b, m, deterministic) @@ -789,12 +923,15 @@ func (m *QueryQueuedMessagesForAttestingResponse) XXX_Marshal(b []byte, determin return b[:n], nil } } + func (m *QueryQueuedMessagesForAttestingResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryQueuedMessagesForAttestingResponse.Merge(m, src) } + func (m *QueryQueuedMessagesForAttestingResponse) XXX_Size() int { return m.Size() } + func (m *QueryQueuedMessagesForAttestingResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryQueuedMessagesForAttestingResponse.DiscardUnknown(m) } @@ -808,18 +945,19 @@ func (m *QueryQueuedMessagesForAttestingResponse) GetMessages() []MessageWithSig return nil } -type QueryGetAllQueueNamesRequest struct { -} +type QueryGetAllQueueNamesRequest struct{} func (m *QueryGetAllQueueNamesRequest) Reset() { *m = QueryGetAllQueueNamesRequest{} } func (m *QueryGetAllQueueNamesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetAllQueueNamesRequest) ProtoMessage() {} func (*QueryGetAllQueueNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{14} + return fileDescriptor_186b66ae011355e3, []int{15} } + func (m *QueryGetAllQueueNamesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryGetAllQueueNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryGetAllQueueNamesRequest.Marshal(b, m, deterministic) @@ -832,12 +970,15 @@ func (m *QueryGetAllQueueNamesRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } + func (m *QueryGetAllQueueNamesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryGetAllQueueNamesRequest.Merge(m, src) } + func (m *QueryGetAllQueueNamesRequest) XXX_Size() int { return m.Size() } + func (m *QueryGetAllQueueNamesRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryGetAllQueueNamesRequest.DiscardUnknown(m) } @@ -852,11 +993,13 @@ func (m *QueryGetAllQueueNamesResponse) Reset() { *m = QueryGetAllQueueN func (m *QueryGetAllQueueNamesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetAllQueueNamesResponse) ProtoMessage() {} func (*QueryGetAllQueueNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_186b66ae011355e3, []int{15} + return fileDescriptor_186b66ae011355e3, []int{16} } + func (m *QueryGetAllQueueNamesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryGetAllQueueNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryGetAllQueueNamesResponse.Marshal(b, m, deterministic) @@ -869,12 +1012,15 @@ func (m *QueryGetAllQueueNamesResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } + func (m *QueryGetAllQueueNamesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryGetAllQueueNamesResponse.Merge(m, src) } + func (m *QueryGetAllQueueNamesResponse) XXX_Size() int { return m.Size() } + func (m *QueryGetAllQueueNamesResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryGetAllQueueNamesResponse.DiscardUnknown(m) } @@ -888,6 +1034,122 @@ func (m *QueryGetAllQueueNamesResponse) GetQueues() []string { return nil } +type QueryQueuedMessagesForGasEstimationRequest struct { + QueueTypeName string `protobuf:"bytes,1,opt,name=queueTypeName,proto3" json:"queueTypeName,omitempty"` + ValAddress github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,2,opt,name=valAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"valAddress,omitempty"` +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) Reset() { + *m = QueryQueuedMessagesForGasEstimationRequest{} +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryQueuedMessagesForGasEstimationRequest) ProtoMessage() {} +func (*QueryQueuedMessagesForGasEstimationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_186b66ae011355e3, []int{17} +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryQueuedMessagesForGasEstimationRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryQueuedMessagesForGasEstimationRequest.Merge(m, src) +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) XXX_Size() int { + return m.Size() +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryQueuedMessagesForGasEstimationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryQueuedMessagesForGasEstimationRequest proto.InternalMessageInfo + +func (m *QueryQueuedMessagesForGasEstimationRequest) GetQueueTypeName() string { + if m != nil { + return m.QueueTypeName + } + return "" +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) GetValAddress() github_com_cosmos_cosmos_sdk_types.ValAddress { + if m != nil { + return m.ValAddress + } + return nil +} + +type QueryQueuedMessagesForGasEstimationResponse struct { + MessagesToEstimate []MessageWithSignatures `protobuf:"bytes,1,rep,name=messagesToEstimate,proto3" json:"messagesToEstimate"` +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) Reset() { + *m = QueryQueuedMessagesForGasEstimationResponse{} +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryQueuedMessagesForGasEstimationResponse) ProtoMessage() {} +func (*QueryQueuedMessagesForGasEstimationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_186b66ae011355e3, []int{18} +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryQueuedMessagesForGasEstimationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryQueuedMessagesForGasEstimationResponse.Merge(m, src) +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) XXX_Size() int { + return m.Size() +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryQueuedMessagesForGasEstimationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryQueuedMessagesForGasEstimationResponse proto.InternalMessageInfo + +func (m *QueryQueuedMessagesForGasEstimationResponse) GetMessagesToEstimate() []MessageWithSignatures { + if m != nil { + return m.MessagesToEstimate + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "palomachain.paloma.consensus.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "palomachain.paloma.consensus.QueryParamsResponse") @@ -896,6 +1158,7 @@ func init() { proto.RegisterType((*MessageToSign)(nil), "palomachain.paloma.consensus.MessageToSign") proto.RegisterType((*ValidatorSignature)(nil), "palomachain.paloma.consensus.ValidatorSignature") proto.RegisterType((*MessageWithSignatures)(nil), "palomachain.paloma.consensus.MessageWithSignatures") + proto.RegisterType((*MessageQueryResult)(nil), "palomachain.paloma.consensus.MessageQueryResult") proto.RegisterType((*QueryMessageByIDRequest)(nil), "palomachain.paloma.consensus.QueryMessageByIDRequest") proto.RegisterType((*QueryMessagesInQueueRequest)(nil), "palomachain.paloma.consensus.QueryMessagesInQueueRequest") proto.RegisterType((*QueryMessagesInQueueResponse)(nil), "palomachain.paloma.consensus.QueryMessagesInQueueResponse") @@ -905,6 +1168,8 @@ func init() { proto.RegisterType((*QueryQueuedMessagesForAttestingResponse)(nil), "palomachain.paloma.consensus.QueryQueuedMessagesForAttestingResponse") proto.RegisterType((*QueryGetAllQueueNamesRequest)(nil), "palomachain.paloma.consensus.QueryGetAllQueueNamesRequest") proto.RegisterType((*QueryGetAllQueueNamesResponse)(nil), "palomachain.paloma.consensus.QueryGetAllQueueNamesResponse") + proto.RegisterType((*QueryQueuedMessagesForGasEstimationRequest)(nil), "palomachain.paloma.consensus.QueryQueuedMessagesForGasEstimationRequest") + proto.RegisterType((*QueryQueuedMessagesForGasEstimationResponse)(nil), "palomachain.paloma.consensus.QueryQueuedMessagesForGasEstimationResponse") } func init() { @@ -912,81 +1177,92 @@ func init() { } var fileDescriptor_186b66ae011355e3 = []byte{ - // 1089 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xce, 0x6c, 0x7e, 0x90, 0xbc, 0x34, 0x50, 0x0d, 0xa1, 0x6c, 0x4d, 0xd8, 0x46, 0x56, 0x08, - 0xe1, 0x47, 0x6d, 0x92, 0x08, 0x50, 0x1a, 0x10, 0xda, 0x6d, 0x4a, 0x15, 0x41, 0xa1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xc1, 0xf3, 0x30, 0x5d, 0x6b, 0x0a, 0xca, 0x15, 0x8f, - 0x51, 0xb9, 0x36, 0x3f, 0x84, 0x17, 0x61, 0xb4, 0xce, 0xdd, 0xe2, 0x98, 0xcc, 0xdb, 0xac, 0x91, - 0x1c, 0x08, 0x23, 0x3d, 0x10, 0x46, 0x39, 0x68, 0x5a, 0xf1, 0x02, 0xfd, 0x2f, 0x04, 0xf8, 0x36, - 0xf1, 0x3d, 0x87, 0x88, 0x44, 0x30, 0x11, 0x51, 0x48, 0xcf, 0x22, 0x19, 0x73, 0x30, 0xc5, 0x53, - 0x7c, 0x29, 0xe5, 0x9c, 0x75, 0x34, 0x10, 0xcf, 0xd2, 0x3d, 0x11, 0x92, 0x0d, 0x22, 0x88, 0xd2, - 0x73, 0x34, 0x80, 0x5f, 0x83, 0x0b, 0x74, 0x4f, 0xd0, 0x30, 0x20, 0x7e, 0xd9, 0xb6, 0x59, 0x14, - 0x88, 0x94, 0xda, 0x98, 0xcc, 0x68, 0x97, 0xd9, 0x18, 0xb5, 0x11, 0xd5, 0x7c, 0xcf, 0x7e, 0x87, - 0x36, 0x8b, 0xe3, 0x09, 0x6a, 0x36, 0xa0, 0xff, 0x53, 0x80, 0xa7, 0x94, 0xfb, 0x1f, 0x79, 0x62, - 0x3b, 0x53, 0xcf, 0x07, 0xcc, 0x82, 0xf2, 0x78, 0xb4, 0x8f, 0xc7, 0xf8, 0x5d, 0x98, 0x8c, 0x85, - 0x4a, 0x69, 0x63, 0xf2, 0xc8, 0xbc, 0xd2, 0xfb, 0xc8, 0x74, 0x26, 0xc4, 0xca, 0x10, 0xda, 0x73, - 0x3f, 0xde, 0x99, 0xfb, 0x17, 0xe1, 0x7c, 0x22, 0xb2, 0x6c, 0xdb, 0x94, 0x73, 0xb9, 0xef, 0x84, - 0x5c, 0xd6, 0x31, 0x2e, 0x7d, 0x0f, 0x43, 0x16, 0xca, 0x45, 0x8f, 0x29, 0xdf, 0xd3, 0x01, 0x5c, - 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9, 0x84, 0x78, 0x41, 0xf2, - 0xef, 0xc9, 0xbc, 0xd7, 0x52, 0x70, 0xf7, 0xf1, 0x77, 0x08, 0xa6, 0x73, 0xfd, 0x06, 0x7e, 0x75, - 0x70, 0x52, 0xb9, 0xfe, 0x44, 0x1b, 0xa6, 0x4e, 0x0e, 0x7a, 0x08, 0xdb, 0x28, 0xa7, 0xa2, 0xcc, - 0x7b, 0x9e, 0xb3, 0x8f, 0x7f, 0x40, 0x70, 0xbe, 0xbd, 0x6e, 0xe2, 0x41, 0x9c, 0xed, 0x52, 0x8c, - 0xb5, 0xf5, 0xa1, 0x62, 0x55, 0x5a, 0xd6, 0xa4, 0xa2, 0x55, 0xbc, 0xdc, 0x5b, 0x91, 0x4b, 0x45, - 0x95, 0xf8, 0x7e, 0x92, 0x92, 0x6a, 0x10, 0x43, 0x54, 0x36, 0x1f, 0x1c, 0x94, 0xd0, 0xc3, 0x83, - 0x12, 0xfa, 0xf5, 0xa0, 0x84, 0xbe, 0x38, 0x2c, 0x8d, 0x3c, 0x3c, 0x2c, 0x8d, 0xfc, 0x72, 0x58, - 0x1a, 0xf9, 0xc4, 0xcc, 0x7d, 0xfc, 0x8e, 0x81, 0xdd, 0xcb, 0x01, 0xcb, 0x2f, 0x61, 0x6d, 0x42, - 0x36, 0xdd, 0xab, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x87, 0x9e, 0xaa, 0x43, 0xd4, 0x0f, 0x00, - 0x00, + // 1235 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x33, 0x8e, 0x93, 0x3a, 0x2f, 0x0d, 0x54, 0x43, 0x28, 0xee, 0x12, 0xdc, 0x68, 0x15, + 0x42, 0xda, 0x52, 0x6f, 0x93, 0x08, 0x50, 0x1a, 0x10, 0xd8, 0x4d, 0x48, 0x03, 0x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95, 0x3d, 0xfc, 0x3d, 0x82, 0x73, 0xad, 0x37, 0x2f, 0x4e, 0x12, 0xd6, + 0x0e, 0xd7, 0xb9, 0xb2, 0xd8, 0x97, 0xad, 0xcc, 0xc9, 0x82, 0x20, 0x9a, 0xc7, 0xb3, 0xdd, 0x89, + 0x0c, 0xca, 0x4b, 0xc4, 0xb2, 0x82, 0x7c, 0x94, 0x6c, 0x5f, 0xa2, 0xb8, 0xba, 0x7f, 0x90, 0x43, + 0x0f, 0x0e, 0x72, 0xe8, 0xe7, 0x83, 0x1c, 0xfa, 0xf4, 0x30, 0x37, 0xf0, 0xe0, 0x30, 0x37, 0xf0, + 0xd3, 0x61, 0x6e, 0xe0, 0x43, 0x2d, 0x76, 0x75, 0xb7, 0x91, 0xdd, 0x8d, 0x09, 0x8b, 0x7b, 0x7c, + 0x73, 0x58, 0xfc, 0x3a, 0x9d, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x96, 0xd0, 0xdb, 0xfd, + 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var ( + _ context.Context + _ grpc.ClientConn +) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -1002,12 +1278,14 @@ type QueryClient interface { QueuedMessagesForSigning(ctx context.Context, in *QueryQueuedMessagesForSigningRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForSigningResponse, error) // Queries a list of QueuedMessagesForRelaying items. QueuedMessagesForRelaying(ctx context.Context, in *QueryQueuedMessagesForRelayingRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForRelayingResponse, error) + // Queries a list of QueuedMessagesForGasEstimation items. + QueuedMessagesForGasEstimation(ctx context.Context, in *QueryQueuedMessagesForGasEstimationRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForGasEstimationResponse, error) // Queries a list of QueuedMessagesForAttesting items. QueuedMessagesForAttesting(ctx context.Context, in *QueryQueuedMessagesForAttestingRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForAttestingResponse, error) // Queries a list of MessagesInQueue items. MessagesInQueue(ctx context.Context, in *QueryMessagesInQueueRequest, opts ...grpc.CallOption) (*QueryMessagesInQueueResponse, error) // Queries one message by ID. - MessageByID(ctx context.Context, in *QueryMessageByIDRequest, opts ...grpc.CallOption) (*MessageWithSignatures, error) + MessageByID(ctx context.Context, in *QueryMessageByIDRequest, opts ...grpc.CallOption) (*MessageQueryResult, error) // Queries a list of GetAllQueueNames items. GetAllQueueNames(ctx context.Context, in *QueryGetAllQueueNamesRequest, opts ...grpc.CallOption) (*QueryGetAllQueueNamesResponse, error) } @@ -1047,6 +1325,15 @@ func (c *queryClient) QueuedMessagesForRelaying(ctx context.Context, in *QueryQu return out, nil } +func (c *queryClient) QueuedMessagesForGasEstimation(ctx context.Context, in *QueryQueuedMessagesForGasEstimationRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForGasEstimationResponse, error) { + out := new(QueryQueuedMessagesForGasEstimationResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.consensus.Query/QueuedMessagesForGasEstimation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueuedMessagesForAttesting(ctx context.Context, in *QueryQueuedMessagesForAttestingRequest, opts ...grpc.CallOption) (*QueryQueuedMessagesForAttestingResponse, error) { out := new(QueryQueuedMessagesForAttestingResponse) err := c.cc.Invoke(ctx, "/palomachain.paloma.consensus.Query/QueuedMessagesForAttesting", in, out, opts...) @@ -1065,8 +1352,8 @@ func (c *queryClient) MessagesInQueue(ctx context.Context, in *QueryMessagesInQu return out, nil } -func (c *queryClient) MessageByID(ctx context.Context, in *QueryMessageByIDRequest, opts ...grpc.CallOption) (*MessageWithSignatures, error) { - out := new(MessageWithSignatures) +func (c *queryClient) MessageByID(ctx context.Context, in *QueryMessageByIDRequest, opts ...grpc.CallOption) (*MessageQueryResult, error) { + out := new(MessageQueryResult) err := c.cc.Invoke(ctx, "/palomachain.paloma.consensus.Query/MessageByID", in, out, opts...) if err != nil { return nil, err @@ -1091,38 +1378,49 @@ type QueryServer interface { QueuedMessagesForSigning(context.Context, *QueryQueuedMessagesForSigningRequest) (*QueryQueuedMessagesForSigningResponse, error) // Queries a list of QueuedMessagesForRelaying items. QueuedMessagesForRelaying(context.Context, *QueryQueuedMessagesForRelayingRequest) (*QueryQueuedMessagesForRelayingResponse, error) + // Queries a list of QueuedMessagesForGasEstimation items. + QueuedMessagesForGasEstimation(context.Context, *QueryQueuedMessagesForGasEstimationRequest) (*QueryQueuedMessagesForGasEstimationResponse, error) // Queries a list of QueuedMessagesForAttesting items. QueuedMessagesForAttesting(context.Context, *QueryQueuedMessagesForAttestingRequest) (*QueryQueuedMessagesForAttestingResponse, error) // Queries a list of MessagesInQueue items. MessagesInQueue(context.Context, *QueryMessagesInQueueRequest) (*QueryMessagesInQueueResponse, error) // Queries one message by ID. - MessageByID(context.Context, *QueryMessageByIDRequest) (*MessageWithSignatures, error) + MessageByID(context.Context, *QueryMessageByIDRequest) (*MessageQueryResult, error) // Queries a list of GetAllQueueNames items. GetAllQueueNames(context.Context, *QueryGetAllQueueNamesRequest) (*QueryGetAllQueueNamesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +type UnimplementedQueryServer struct{} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } + func (*UnimplementedQueryServer) QueuedMessagesForSigning(ctx context.Context, req *QueryQueuedMessagesForSigningRequest) (*QueryQueuedMessagesForSigningResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueuedMessagesForSigning not implemented") } + func (*UnimplementedQueryServer) QueuedMessagesForRelaying(ctx context.Context, req *QueryQueuedMessagesForRelayingRequest) (*QueryQueuedMessagesForRelayingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueuedMessagesForRelaying not implemented") } + +func (*UnimplementedQueryServer) QueuedMessagesForGasEstimation(ctx context.Context, req *QueryQueuedMessagesForGasEstimationRequest) (*QueryQueuedMessagesForGasEstimationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueuedMessagesForGasEstimation not implemented") +} + func (*UnimplementedQueryServer) QueuedMessagesForAttesting(ctx context.Context, req *QueryQueuedMessagesForAttestingRequest) (*QueryQueuedMessagesForAttestingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueuedMessagesForAttesting not implemented") } + func (*UnimplementedQueryServer) MessagesInQueue(ctx context.Context, req *QueryMessagesInQueueRequest) (*QueryMessagesInQueueResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MessagesInQueue not implemented") } -func (*UnimplementedQueryServer) MessageByID(ctx context.Context, req *QueryMessageByIDRequest) (*MessageWithSignatures, error) { + +func (*UnimplementedQueryServer) MessageByID(ctx context.Context, req *QueryMessageByIDRequest) (*MessageQueryResult, error) { return nil, status.Errorf(codes.Unimplemented, "method MessageByID not implemented") } + func (*UnimplementedQueryServer) GetAllQueueNames(ctx context.Context, req *QueryGetAllQueueNamesRequest) (*QueryGetAllQueueNamesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllQueueNames not implemented") } @@ -1185,25 +1483,43 @@ func _Query_QueuedMessagesForRelaying_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } -func _Query_QueuedMessagesForAttesting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryQueuedMessagesForAttestingRequest) +func _Query_QueuedMessagesForGasEstimation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryQueuedMessagesForGasEstimationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueuedMessagesForAttesting(ctx, in) + return srv.(QueryServer).QueuedMessagesForGasEstimation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/palomachain.paloma.consensus.Query/QueuedMessagesForAttesting", + FullMethod: "/palomachain.paloma.consensus.Query/QueuedMessagesForGasEstimation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueuedMessagesForAttesting(ctx, req.(*QueryQueuedMessagesForAttestingRequest)) + return srv.(QueryServer).QueuedMessagesForGasEstimation(ctx, req.(*QueryQueuedMessagesForGasEstimationRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_MessagesInQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_QueuedMessagesForAttesting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryQueuedMessagesForAttestingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueuedMessagesForAttesting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.consensus.Query/QueuedMessagesForAttesting", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueuedMessagesForAttesting(ctx, req.(*QueryQueuedMessagesForAttestingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MessagesInQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryMessagesInQueueRequest) if err := dec(in); err != nil { return nil, err @@ -1273,6 +1589,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueuedMessagesForRelaying", Handler: _Query_QueuedMessagesForRelaying_Handler, }, + { + MethodName: "QueuedMessagesForGasEstimation", + Handler: _Query_QueuedMessagesForGasEstimation_Handler, + }, { MethodName: "QueuedMessagesForAttesting", Handler: _Query_QueuedMessagesForAttesting_Handler, @@ -1556,25 +1876,16 @@ func (m *MessageWithSignatures) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GasEstimate != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GasEstimate)) + i-- + dAtA[i] = 0x50 + } if m.ValsetID != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ValsetID)) i-- dAtA[i] = 0x48 } - if len(m.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } if len(m.ErrorData) > 0 { i -= len(m.ErrorData) copy(dAtA[i:], m.ErrorData) @@ -1637,6 +1948,69 @@ func (m *MessageWithSignatures) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MessageQueryResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MessageQueryResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MessageQueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GasEstimates) > 0 { + for iNdEx := len(m.GasEstimates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GasEstimates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Evidence) > 0 { + for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Message != nil { + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryMessageByIDRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1949,6 +2323,80 @@ func (m *QueryGetAllQueueNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryQueuedMessagesForGasEstimationRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryQueuedMessagesForGasEstimationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValAddress) > 0 { + i -= len(m.ValAddress) + copy(dAtA[i:], m.ValAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.QueueTypeName) > 0 { + i -= len(m.QueueTypeName) + copy(dAtA[i:], m.QueueTypeName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.QueueTypeName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MessagesToEstimate) > 0 { + for iNdEx := len(m.MessagesToEstimate) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MessagesToEstimate[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1960,6 +2408,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -2100,14 +2549,36 @@ func (m *MessageWithSignatures) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.ValsetID != 0 { + n += 1 + sovQuery(uint64(m.ValsetID)) + } + if m.GasEstimate != 0 { + n += 1 + sovQuery(uint64(m.GasEstimate)) + } + return n +} + +func (m *MessageQueryResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Message != nil { + l = m.Message.Size() + n += 1 + l + sovQuery(uint64(l)) + } if len(m.Evidence) > 0 { for _, e := range m.Evidence { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } } - if m.ValsetID != 0 { - n += 1 + sovQuery(uint64(m.ValsetID)) + if len(m.GasEstimates) > 0 { + for _, e := range m.GasEstimates { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } return n } @@ -2248,12 +2719,46 @@ func (m *QueryGetAllQueueNamesResponse) Size() (n int) { return n } +func (m *QueryQueuedMessagesForGasEstimationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.QueueTypeName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MessagesToEstimate) > 0 { + for _, e := range m.MessagesToEstimate { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2304,6 +2809,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2387,6 +2893,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForSigningRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2503,6 +3010,7 @@ func (m *QueryQueuedMessagesForSigningRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForSigningResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2587,6 +3095,7 @@ func (m *QueryQueuedMessagesForSigningResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MessageToSign) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2760,6 +3269,7 @@ func (m *MessageToSign) Unmarshal(dAtA []byte) error { } return nil } + func (m *ValidatorSignature) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2978,6 +3488,7 @@ func (m *ValidatorSignature) Unmarshal(dAtA []byte) error { } return nil } + func (m *MessageWithSignatures) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3232,11 +3743,11 @@ func (m *MessageWithSignatures) Unmarshal(dAtA []byte) error { m.ErrorData = []byte{} } iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValsetID", wireType) } - var msglen int + m.ValsetID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3246,31 +3757,16 @@ func (m *MessageWithSignatures) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.ValsetID |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Evidence = append(m.Evidence, &Evidence{}) - if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: + case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValsetID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GasEstimate", wireType) } - m.ValsetID = 0 + m.GasEstimate = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3280,7 +3776,7 @@ func (m *MessageWithSignatures) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValsetID |= uint64(b&0x7F) << shift + m.GasEstimate |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -3306,7 +3802,8 @@ func (m *MessageWithSignatures) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMessageByIDRequest) Unmarshal(dAtA []byte) error { + +func (m *MessageQueryResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3329,17 +3826,17 @@ func (m *QueryMessageByIDRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMessageByIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MessageQueryResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMessageByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MessageQueryResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueueTypeName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3349,23 +3846,178 @@ func (m *QueryMessageByIDRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.QueueTypeName = string(dAtA[iNdEx:postIndex]) + if m.Message == nil { + m.Message = &MessageWithSignatures{} + } + if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evidence = append(m.Evidence, &Evidence{}) + if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasEstimates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GasEstimates = append(m.GasEstimates, &GasEstimate{}) + if err := m.GasEstimates[len(m.GasEstimates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *QueryMessageByIDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryMessageByIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMessageByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueTypeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueTypeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { @@ -3407,6 +4059,7 @@ func (m *QueryMessageByIDRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryMessagesInQueueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3523,6 +4176,7 @@ func (m *QueryMessagesInQueueRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryMessagesInQueueResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3607,6 +4261,7 @@ func (m *QueryMessagesInQueueResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForRelayingRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3723,6 +4378,7 @@ func (m *QueryQueuedMessagesForRelayingRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForRelayingResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3807,6 +4463,7 @@ func (m *QueryQueuedMessagesForRelayingResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForAttestingRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3923,6 +4580,7 @@ func (m *QueryQueuedMessagesForAttestingRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryQueuedMessagesForAttestingResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4007,6 +4665,7 @@ func (m *QueryQueuedMessagesForAttestingResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryGetAllQueueNamesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4057,6 +4716,7 @@ func (m *QueryGetAllQueueNamesRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryGetAllQueueNamesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4139,6 +4799,209 @@ func (m *QueryGetAllQueueNamesResponse) Unmarshal(dAtA []byte) error { } return nil } + +func (m *QueryQueuedMessagesForGasEstimationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryQueuedMessagesForGasEstimationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryQueuedMessagesForGasEstimationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueTypeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueTypeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValAddress = append(m.ValAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ValAddress == nil { + m.ValAddress = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *QueryQueuedMessagesForGasEstimationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryQueuedMessagesForGasEstimationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryQueuedMessagesForGasEstimationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessagesToEstimate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessagesToEstimate = append(m.MessagesToEstimate, MessageWithSignatures{}) + if err := m.MessagesToEstimate[len(m.MessagesToEstimate)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/consensus/types/query.pb.gw.go b/x/consensus/types/query.pb.gw.go index 5c30f818..b795c50b 100644 --- a/x/consensus/types/query.pb.gw.go +++ b/x/consensus/types/query.pb.gw.go @@ -123,6 +123,42 @@ func local_request_Query_QueuedMessagesForRelaying_0(ctx context.Context, marsha } +var ( + filter_Query_QueuedMessagesForGasEstimation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueuedMessagesForGasEstimation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryQueuedMessagesForGasEstimationRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueuedMessagesForGasEstimation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueuedMessagesForGasEstimation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueuedMessagesForGasEstimation_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryQueuedMessagesForGasEstimationRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueuedMessagesForGasEstimation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueuedMessagesForGasEstimation(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_QueuedMessagesForAttesting_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -400,6 +436,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueuedMessagesForGasEstimation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueuedMessagesForGasEstimation_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueuedMessagesForGasEstimation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueuedMessagesForAttesting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -593,6 +652,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueuedMessagesForGasEstimation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueuedMessagesForGasEstimation_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueuedMessagesForGasEstimation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueuedMessagesForAttesting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -683,6 +762,8 @@ var ( pattern_Query_QueuedMessagesForRelaying_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "consensus", "queued_messages_for_relaying"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueuedMessagesForGasEstimation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "consensus", "queued_messages_for_gas_estimation"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueuedMessagesForAttesting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "consensus", "queued_messages_for_attesting"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_MessagesInQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"palomachain", "paloma", "consensus", "messages_in_queue", "queueTypeName"}, "", runtime.AssumeColonVerbOpt(false))) @@ -699,6 +780,8 @@ var ( forward_Query_QueuedMessagesForRelaying_0 = runtime.ForwardResponseMessage + forward_Query_QueuedMessagesForGasEstimation_0 = runtime.ForwardResponseMessage + forward_Query_QueuedMessagesForAttesting_0 = runtime.ForwardResponseMessage forward_Query_MessagesInQueue_0 = runtime.ForwardResponseMessage diff --git a/x/consensus/types/simple_message.go b/x/consensus/types/simple_message.go index 55bdb6d2..6a538506 100644 --- a/x/consensus/types/simple_message.go +++ b/x/consensus/types/simple_message.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/crypto" ) var ( @@ -24,3 +25,7 @@ func (msg *SimpleMessage) ConsensusSignBytes() BytesToSignFunc { return append(m.GetSignBytes(), Uint64ToByte(salt.Nonce)...) }) } + +func (msg *SimpleMessage) Keccak256WithSignedMessage(_ *QueuedSignedMessage) ([]byte, error) { + return crypto.Keccak256([]byte(msg.Sender), []byte(msg.Hello), []byte(msg.World)), nil +} diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index b88f4926..9c63f04a 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -15,6 +15,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" io "io" math "math" math_bits "math/bits" @@ -507,6 +508,126 @@ func (m *MsgSetErrorDataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetErrorDataResponse proto.InternalMessageInfo +type MsgAddMessageGasEstimates struct { + Metadata types.MsgMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` + Estimates []*MsgAddMessageGasEstimates_GasEstimate `protobuf:"bytes,2,rep,name=estimates,proto3" json:"estimates,omitempty"` +} + +func (m *MsgAddMessageGasEstimates) Reset() { *m = MsgAddMessageGasEstimates{} } +func (m *MsgAddMessageGasEstimates) String() string { return proto.CompactTextString(m) } +func (*MsgAddMessageGasEstimates) ProtoMessage() {} +func (*MsgAddMessageGasEstimates) Descriptor() ([]byte, []int) { + return fileDescriptor_9a053a9b8cda05fe, []int{9} +} +func (m *MsgAddMessageGasEstimates) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddMessageGasEstimates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddMessageGasEstimates.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddMessageGasEstimates) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddMessageGasEstimates.Merge(m, src) +} +func (m *MsgAddMessageGasEstimates) XXX_Size() int { + return m.Size() +} +func (m *MsgAddMessageGasEstimates) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddMessageGasEstimates.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddMessageGasEstimates proto.InternalMessageInfo + +func (m *MsgAddMessageGasEstimates) GetMetadata() types.MsgMetadata { + if m != nil { + return m.Metadata + } + return types.MsgMetadata{} +} + +func (m *MsgAddMessageGasEstimates) GetEstimates() []*MsgAddMessageGasEstimates_GasEstimate { + if m != nil { + return m.Estimates + } + return nil +} + +type MsgAddMessageGasEstimates_GasEstimate struct { + MsgId uint64 `protobuf:"varint,1,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` + QueueTypeName string `protobuf:"bytes,2,opt,name=queueTypeName,proto3" json:"queueTypeName,omitempty"` + Value uint64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` + EstimatedByAddress string `protobuf:"bytes,5,opt,name=estimatedByAddress,proto3" json:"estimatedByAddress,omitempty"` +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) Reset() { *m = MsgAddMessageGasEstimates_GasEstimate{} } +func (m *MsgAddMessageGasEstimates_GasEstimate) String() string { return proto.CompactTextString(m) } +func (*MsgAddMessageGasEstimates_GasEstimate) ProtoMessage() {} +func (*MsgAddMessageGasEstimates_GasEstimate) Descriptor() ([]byte, []int) { + return fileDescriptor_9a053a9b8cda05fe, []int{9, 0} +} +func (m *MsgAddMessageGasEstimates_GasEstimate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddMessageGasEstimates_GasEstimate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddMessageGasEstimates_GasEstimate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddMessageGasEstimates_GasEstimate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddMessageGasEstimates_GasEstimate.Merge(m, src) +} +func (m *MsgAddMessageGasEstimates_GasEstimate) XXX_Size() int { + return m.Size() +} +func (m *MsgAddMessageGasEstimates_GasEstimate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddMessageGasEstimates_GasEstimate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddMessageGasEstimates_GasEstimate proto.InternalMessageInfo + +func (m *MsgAddMessageGasEstimates_GasEstimate) GetMsgId() uint64 { + if m != nil { + return m.MsgId + } + return 0 +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) GetQueueTypeName() string { + if m != nil { + return m.QueueTypeName + } + return "" +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) GetValue() uint64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) GetEstimatedByAddress() string { + if m != nil { + return m.EstimatedByAddress + } + return "" +} + func init() { proto.RegisterType((*MsgAddMessagesSignatures)(nil), "palomachain.paloma.consensus.MsgAddMessagesSignatures") proto.RegisterType((*ConsensusMessageSignature)(nil), "palomachain.paloma.consensus.ConsensusMessageSignature") @@ -517,6 +638,8 @@ func init() { proto.RegisterType((*MsgSetPublicAccessDataResponse)(nil), "palomachain.paloma.consensus.MsgSetPublicAccessDataResponse") proto.RegisterType((*MsgSetErrorData)(nil), "palomachain.paloma.consensus.MsgSetErrorData") proto.RegisterType((*MsgSetErrorDataResponse)(nil), "palomachain.paloma.consensus.MsgSetErrorDataResponse") + proto.RegisterType((*MsgAddMessageGasEstimates)(nil), "palomachain.paloma.consensus.MsgAddMessageGasEstimates") + proto.RegisterType((*MsgAddMessageGasEstimates_GasEstimate)(nil), "palomachain.paloma.consensus.MsgAddMessageGasEstimates.GasEstimate") } func init() { @@ -524,48 +647,55 @@ func init() { } var fileDescriptor_9a053a9b8cda05fe = []byte{ - // 647 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6b, 0xd4, 0x40, - 0x18, 0xde, 0xc9, 0xa6, 0xb5, 0x9d, 0xed, 0x87, 0x8c, 0xd5, 0xa6, 0xa1, 0xc4, 0xb0, 0x68, 0x59, - 0x8a, 0x26, 0xb8, 0x7e, 0x81, 0x88, 0xb0, 0xb5, 0x05, 0x2b, 0xac, 0x48, 0xea, 0xc9, 0x8b, 0xcc, - 0x26, 0xd3, 0x69, 0x60, 0x93, 0x49, 0x33, 0x49, 0xe9, 0x5e, 0xbd, 0x09, 0x82, 0x5e, 0xfd, 0x17, - 0xfe,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d, 0xfd, 0x64, 0x27, 0x6d, 0x59, 0x2e, 0x0b, 0xec, 0x82, 0xe7, 0x70, 0x7f, 0xf0, 0x7d, - 0xee, 0x44, 0x84, 0xb7, 0x26, 0xc5, 0xe5, 0x79, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, - 0x9b, 0x24, 0x13, 0xcc, 0x07, 0x00, 0x00, + // 759 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4b, 0x6f, 0xd3, 0x4a, + 0x14, 0xce, 0x24, 0x4e, 0x6f, 0x7b, 0xd2, 0xc7, 0xd5, 0xf4, 0xe5, 0xf8, 0x56, 0xb9, 0x51, 0x74, + 0x6f, 0x15, 0x55, 0xf7, 0xda, 0x22, 0x3c, 0x2a, 0x21, 0x84, 0x94, 0xb6, 0x11, 0x04, 0x29, 0x08, + 0xb9, 0xac, 0xd8, 0x54, 0x13, 0x7b, 0xea, 0x5a, 0x8a, 0x3d, 0xa9, 0xc7, 0x8e, 0x9a, 0x2d, 0x3b, + 0x56, 0x74, 0xcb, 0xbf, 0xe0, 0x67, 0x74, 0x59, 0x76, 0xac, 0x10, 0x6a, 0x16, 0x20, 0xd6, 0xfd, + 0x01, 0x28, 0x7e, 0xe5, 0x51, 0xb7, 0x69, 0x0b, 0x2c, 0x58, 0x65, 0x66, 0xce, 0x77, 0x3e, 0x9f, + 0xef, 0x7c, 0xf1, 0xf1, 0xc0, 0xbf, 0x6d, 0xd2, 0x62, 0x16, 0xd1, 0x0e, 0x88, 0x69, 0x2b, 0xc1, + 0x5a, 0xd1, 0x98, 0xcd, 0xa9, 0xcd, 0x3d, 0xae, 0xb8, 0x47, 0x72, 0xdb, 0x61, 0x2e, 0xc3, 0x6b, + 0x43, 0x30, 0x39, 0x58, 0xcb, 0x31, 0x4c, 0x5a, 0x32, 0x98, 0xc1, 0x7c, 0xa0, 0xd2, 0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70, 0xe9, 0xfe, 0x8d, 0xe0, 0xd1, 0x53, 0xb7, 0xea, 0x27, 0x67, 0x05, 0x74, 0x7a, 0x56, + 0x40, 0x9f, 0xcf, 0x0a, 0xe8, 0xb8, 0x57, 0x48, 0x9d, 0xf6, 0x0a, 0xa9, 0x8f, 0xbd, 0x42, 0xea, + 0x95, 0x62, 0x98, 0xee, 0x81, 0xd7, 0x94, 0x35, 0x66, 0x29, 0x09, 0x17, 0xa0, 0xa3, 0xe1, 0x1b, + 0x59, 0xb7, 0x4d, 0x79, 0x73, 0xca, 0xf7, 0xf3, 0xee, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x64, + 0x69, 0x8f, 0xf0, 0xbe, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -581,6 +711,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { AddMessagesSignatures(ctx context.Context, in *MsgAddMessagesSignatures, opts ...grpc.CallOption) (*MsgAddMessagesSignaturesResponse, error) + AddMessageEstimates(ctx context.Context, in *MsgAddMessageGasEstimates, opts ...grpc.CallOption) (*emptypb.Empty, error) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts ...grpc.CallOption) (*MsgAddEvidenceResponse, error) SetPublicAccessData(ctx context.Context, in *MsgSetPublicAccessData, opts ...grpc.CallOption) (*MsgSetPublicAccessDataResponse, error) SetErrorData(ctx context.Context, in *MsgSetErrorData, opts ...grpc.CallOption) (*MsgSetErrorDataResponse, error) @@ -603,6 +734,15 @@ func (c *msgClient) AddMessagesSignatures(ctx context.Context, in *MsgAddMessage return out, nil } +func (c *msgClient) AddMessageEstimates(ctx context.Context, in *MsgAddMessageGasEstimates, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/palomachain.paloma.consensus.Msg/AddMessageEstimates", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) AddEvidence(ctx context.Context, in *MsgAddEvidence, opts ...grpc.CallOption) (*MsgAddEvidenceResponse, error) { out := new(MsgAddEvidenceResponse) err := c.cc.Invoke(ctx, "/palomachain.paloma.consensus.Msg/AddEvidence", in, out, opts...) @@ -633,6 +773,7 @@ func (c *msgClient) SetErrorData(ctx context.Context, in *MsgSetErrorData, opts // MsgServer is the server API for Msg service. type MsgServer interface { AddMessagesSignatures(context.Context, *MsgAddMessagesSignatures) (*MsgAddMessagesSignaturesResponse, error) + AddMessageEstimates(context.Context, *MsgAddMessageGasEstimates) (*emptypb.Empty, error) AddEvidence(context.Context, *MsgAddEvidence) (*MsgAddEvidenceResponse, error) SetPublicAccessData(context.Context, *MsgSetPublicAccessData) (*MsgSetPublicAccessDataResponse, error) SetErrorData(context.Context, *MsgSetErrorData) (*MsgSetErrorDataResponse, error) @@ -645,6 +786,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AddMessagesSignatures(ctx context.Context, req *MsgAddMessagesSignatures) (*MsgAddMessagesSignaturesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddMessagesSignatures not implemented") } +func (*UnimplementedMsgServer) AddMessageEstimates(ctx context.Context, req *MsgAddMessageGasEstimates) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddMessageEstimates not implemented") +} func (*UnimplementedMsgServer) AddEvidence(ctx context.Context, req *MsgAddEvidence) (*MsgAddEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddEvidence not implemented") } @@ -677,6 +821,24 @@ func _Msg_AddMessagesSignatures_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Msg_AddMessageEstimates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddMessageGasEstimates) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddMessageEstimates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.consensus.Msg/AddMessageEstimates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddMessageEstimates(ctx, req.(*MsgAddMessageGasEstimates)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_AddEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAddEvidence) if err := dec(in); err != nil { @@ -739,6 +901,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddMessagesSignatures", Handler: _Msg_AddMessagesSignatures_Handler, }, + { + MethodName: "AddMessageEstimates", + Handler: _Msg_AddMessageEstimates_Handler, + }, { MethodName: "AddEvidence", Handler: _Msg_AddEvidence_Handler, @@ -1110,6 +1276,100 @@ func (m *MsgSetErrorDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgAddMessageGasEstimates) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddMessageGasEstimates) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddMessageGasEstimates) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Estimates) > 0 { + for iNdEx := len(m.Estimates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Estimates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EstimatedByAddress) > 0 { + i -= len(m.EstimatedByAddress) + copy(dAtA[i:], m.EstimatedByAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.EstimatedByAddress))) + i-- + dAtA[i] = 0x2a + } + if m.Value != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x18 + } + if len(m.QueueTypeName) > 0 { + i -= len(m.QueueTypeName) + copy(dAtA[i:], m.QueueTypeName) + i = encodeVarintTx(dAtA, i, uint64(len(m.QueueTypeName))) + i-- + dAtA[i] = 0x12 + } + if m.MsgId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MsgId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1267,6 +1527,46 @@ func (m *MsgSetErrorDataResponse) Size() (n int) { return n } +func (m *MsgAddMessageGasEstimates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.Estimates) > 0 { + for _, e := range m.Estimates { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAddMessageGasEstimates_GasEstimate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgId != 0 { + n += 1 + sovTx(uint64(m.MsgId)) + } + l = len(m.QueueTypeName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Value != 0 { + n += 1 + sovTx(uint64(m.Value)) + } + l = len(m.EstimatedByAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2282,6 +2582,275 @@ func (m *MsgSetErrorDataResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAddMessageGasEstimates) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddMessageGasEstimates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddMessageGasEstimates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Estimates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Estimates = append(m.Estimates, &MsgAddMessageGasEstimates_GasEstimate{}) + if err := m.Estimates[len(m.Estimates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddMessageGasEstimates_GasEstimate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GasEstimate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GasEstimate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgId", wireType) + } + m.MsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MsgId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueTypeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueTypeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EstimatedByAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EstimatedByAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/client/cli/tx_deploy_smart_contract.go b/x/evm/client/cli/tx_deploy_smart_contract.go index 2c2c888c..1495ac42 100644 --- a/x/evm/client/cli/tx_deploy_smart_contract.go +++ b/x/evm/client/cli/tx_deploy_smart_contract.go @@ -24,7 +24,7 @@ func CmdDeploySmartContract() *cobra.Command { creator := clientCtx.GetFromAddress() title := whoops.Must(cmd.Flags().GetString(cli.FlagTitle)) - description := whoops.Must(cmd.Flags().GetString(cli.FlagDescription)) + description := whoops.Must(cmd.Flags().GetString(cli.FlagSummary)) abiJSON, bytecodeHex := args[0], args[1] msg := types.NewMsgDeployNewSmartContractRequest(creator, title, description, abiJSON, bytecodeHex) diff --git a/x/evm/client/cli/tx_proposal.go b/x/evm/client/cli/tx_proposal.go index fabbd8e6..37185ebe 100644 --- a/x/evm/client/cli/tx_proposal.go +++ b/x/evm/client/cli/tx_proposal.go @@ -2,6 +2,7 @@ package cli import ( "encoding/json" + "fmt" "math/big" "strconv" @@ -12,6 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govv1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + gethcommon "github.com/ethereum/go-ethereum/common" "github.com/palomachain/paloma/x/evm/types" "github.com/spf13/cobra" ) @@ -20,13 +22,13 @@ func applyFlags(cmd *cobra.Command) { flags.AddTxFlagsToCmd(cmd) cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") + cmd.Flags().String(cli.FlagSummary, "", "summary description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") //nolint:errcheck cmd.MarkFlagRequired(cli.FlagTitle) //nolint:errcheck - cmd.MarkFlagRequired(cli.FlagDescription) + cmd.MarkFlagRequired(cli.FlagSummary) } func CmdEvmChainProposalHandler() *cobra.Command { @@ -40,6 +42,7 @@ func CmdEvmChainProposalHandler() *cobra.Command { cmd.AddCommand(CmdEvmProposalDeployNewSmartContract()) cmd.AddCommand(CmdEvmProposalChangeMinOnChainBalance()) cmd.AddCommand(CmdEvmProposalChangeRelayWeights()) + cmd.AddCommand(CmdEvmProposalSetFeeManagerAddress()) return cmd } @@ -93,7 +96,7 @@ func CmdEvmProposeNewChain() *cobra.Command { ChainReferenceID: chainReferenceID, ChainID: uint64(chainID), Title: whoops.Must(cmd.Flags().GetString(cli.FlagTitle)), - Description: whoops.Must(cmd.Flags().GetString(cli.FlagDescription)), + Description: whoops.Must(cmd.Flags().GetString(cli.FlagSummary)), BlockHeight: uint64(blockHeight), BlockHashAtHeight: blockHashAtHeight, MinOnChainBalance: minOnChainBalance, @@ -134,7 +137,7 @@ func CmdEvmProposalDeployNewSmartContract() *cobra.Command { deployNewSmartContractProposal := &types.DeployNewSmartContractProposal{ Title: whoops.Must(cmd.Flags().GetString(cli.FlagTitle)), - Description: whoops.Must(cmd.Flags().GetString(cli.FlagDescription)), + Description: whoops.Must(cmd.Flags().GetString(cli.FlagSummary)), AbiJSON: abiJSON, BytecodeHex: bytecodeHex, } @@ -180,7 +183,7 @@ func CmdEvmProposalChangeMinOnChainBalance() *cobra.Command { proposal := &types.ChangeMinOnChainBalanceProposal{ Title: whoops.Must(cmd.Flags().GetString(cli.FlagTitle)), - Description: whoops.Must(cmd.Flags().GetString(cli.FlagDescription)), + Description: whoops.Must(cmd.Flags().GetString(cli.FlagSummary)), ChainReferenceID: chainReferenceID, MinOnChainBalance: balance, } @@ -220,7 +223,7 @@ func CmdEvmProposeChainRemoval() *cobra.Command { addChainProposal := &types.RemoveChainProposal{ Title: whoops.Must(cmd.Flags().GetString(cli.FlagTitle)), - Description: whoops.Must(cmd.Flags().GetString(cli.FlagDescription)), + Description: whoops.Must(cmd.Flags().GetString(cli.FlagSummary)), ChainReferenceID: chainReferenceID, } @@ -264,7 +267,7 @@ func CmdEvmProposalChangeRelayWeights() *cobra.Command { proposal := &types.RelayWeightsProposal{ Title: whoops.Must(cmd.Flags().GetString(cli.FlagTitle)), - Description: whoops.Must(cmd.Flags().GetString(cli.FlagDescription)), + Description: whoops.Must(cmd.Flags().GetString(cli.FlagSummary)), ChainReferenceID: chainReferenceID, Fee: weights.Fee, Uptime: weights.Uptime, @@ -293,3 +296,77 @@ func CmdEvmProposalChangeRelayWeights() *cobra.Command { return cmd } + +func CmdEvmProposalSetFeeManagerAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-fee-manager-address [chain-reference-id] [remote-address]", + Short: "Changes the fee manager contract address for a given EVM chain referenced by the chain-reference-id", + Example: "set-fee-manager-address eth-main 0xb794f5ea0ba39494ce839613fffba74279579268", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + whoops.Assert(err) + + chainReferenceID, address := args[0], args[1] + + if !gethcommon.IsHexAddress(address) { + return fmt.Errorf("address(%s) doesn't pass format validation", address) + } + + queryClient := types.NewQueryClient(clientCtx) + params := &types.QueryChainsInfosRequest{} + res, err := queryClient.ChainsInfos(cmd.Context(), params) + if err != nil { + return fmt.Errorf("failed to query chains: %w", err) + } + + found := false + for _, ci := range res.ChainsInfos { + if ci.ChainReferenceID == chainReferenceID { + found = true + break + } + } + if !found { + return fmt.Errorf("chain-reference-id %s not found", chainReferenceID) + } + + from := clientCtx.GetFromAddress() + + title, err := cmd.Flags().GetString(cli.FlagTitle) + if err != nil { + return fmt.Errorf("failed to get title: %w", err) + } + summary, err := cmd.Flags().GetString(cli.FlagSummary) + if err != nil { + return fmt.Errorf("failed to get summary: %w", err) + } + + proposal := &types.SetFeeManagerAddressProposal{ + Title: title, + Summary: summary, + ChainReferenceID: chainReferenceID, + FeeManagerAddress: address, + } + depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) + if err != nil { + return fmt.Errorf("failed to get deposit: %w", err) + } + + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + msg, err := govv1beta1types.NewMsgSubmitProposal(proposal, deposit, from) + if err != nil { + return fmt.Errorf("failed to create new msg submit proposal: %w", err) + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + applyFlags(cmd) + + return cmd +} diff --git a/x/evm/genesis.go b/x/evm/genesis.go index 4f571a2d..c4538deb 100644 --- a/x/evm/genesis.go +++ b/x/evm/genesis.go @@ -37,6 +37,10 @@ func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisSta if err != nil { panic(err) } + err = k.SetFeeManagerAddress(ctx, chainInfo.GetChainReferenceID(), chainInfo.GetFeeManagerAddr()) + if err != nil { + panic(err) + } err = k.SetRelayWeights( ctx, @@ -85,6 +89,7 @@ func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { BlockHashAtHeight: chainInfo.GetReferenceBlockHash(), MinOnChainBalance: whoops.Must(chainInfo.GetMinOnChainBalanceBigInt()).Text(10), RelayWeights: whoops.Must(k.GetRelayWeights(ctx, chainInfo.GetChainReferenceID())), + FeeManagerAddr: chainInfo.GetFeeManagerAddr(), }) } genesis.Chains = genesisChainInfos diff --git a/x/evm/gov_handler.go b/x/evm/gov_handler.go index 8cc6d589..d8781e4d 100644 --- a/x/evm/gov_handler.go +++ b/x/evm/gov_handler.go @@ -56,6 +56,8 @@ func NewReferenceChainReferenceIDProposalHandler(k keeper.Keeper) govv1beta1type FeatureSet: c.FeatureSet, }, ) + case *types.SetFeeManagerAddressProposal: + return k.SetFeeManagerAddress(ctx, c.ChainReferenceID, c.FeeManagerAddress) } return sdkerrors.ErrUnknownRequest diff --git a/x/evm/keeper/attest.go b/x/evm/keeper/attest.go index 514a3702..9d2519f0 100644 --- a/x/evm/keeper/attest.go +++ b/x/evm/keeper/attest.go @@ -13,7 +13,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ethtypes "github.com/ethereum/go-ethereum/core/types" keeperutil "github.com/palomachain/paloma/util/keeper" + "github.com/palomachain/paloma/util/libcons" "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/util/slice" "github.com/palomachain/paloma/x/consensus/keeper/consensus" consensustypes "github.com/palomachain/paloma/x/consensus/types" "github.com/palomachain/paloma/x/evm/types" @@ -48,7 +50,11 @@ func (k Keeper) attestMessageWrapper(ctx context.Context, q consensus.Queuer, ms } }() - result, err := k.consensusChecker.VerifyEvidence(cacheCtx, msg.GetEvidence()) + result, err := k.consensusChecker.VerifyEvidence(ctx, + slice.Map(msg.GetEvidence(), func(evidence *consensustypes.Evidence) libcons.Evidence { + return evidence + }), + ) if err != nil { if errors.Is(err, ErrConsensusNotAchieved) { logger.WithFields( @@ -150,8 +156,8 @@ func attestTransactionIntegrity( msg consensustypes.QueuedSignedMessageI, k *Keeper, proof *types.TxExecutedProof, - chainReferenceID string, - verifyTx func(context.Context, *ethtypes.Transaction, consensustypes.QueuedSignedMessageI, *types.Valset, *types.SmartContract) error, + chainReferenceID, relayer string, + verifyTx func(context.Context, *ethtypes.Transaction, consensustypes.QueuedSignedMessageI, *types.Valset, *types.SmartContract, string) error, ) (*ethtypes.Transaction, error) { // check if correct thing was called tx, err := proof.GetTX() @@ -193,7 +199,7 @@ func attestTransactionIntegrity( } } - err = verifyTx(ctx, tx, msg, &valset, compass) + err = verifyTx(ctx, tx, msg, &valset, compass, relayer) if err != nil { // passed in transaction doesn't seem to be created from this smart contract return nil, fmt.Errorf("tx failed to verify: %w", err) diff --git a/x/evm/keeper/attest_submit_logic_call.go b/x/evm/keeper/attest_submit_logic_call.go index 3764d312..8d998526 100644 --- a/x/evm/keeper/attest_submit_logic_call.go +++ b/x/evm/keeper/attest_submit_logic_call.go @@ -42,7 +42,7 @@ func (a *submitLogicCallAttester) Execute(ctx sdk.Context) error { func (a *submitLogicCallAttester) attest(ctx sdk.Context, evidence *types.TxExecutedProof) (err error) { _, err = attestTransactionIntegrity(ctx, a.originalMessage, a.k, evidence, - a.chainReferenceID, a.action.VerifyAgainstTX) + a.chainReferenceID, a.msg.AssigneeRemoteAddress, a.action.VerifyAgainstTX) if err != nil { a.logger.WithError(err).Error("Failed to verify transaction integrity.") return err diff --git a/x/evm/keeper/attest_test.go b/x/evm/keeper/attest_test.go index 92c465e3..1d55b560 100644 --- a/x/evm/keeper/attest_test.go +++ b/x/evm/keeper/attest_test.go @@ -29,11 +29,14 @@ var ( contractAbi = string(whoops.Must(os.ReadFile("testdata/sample-abi.json"))) contractBytecodeStr = string(whoops.Must(os.ReadFile("testdata/sample-bytecode.out"))) - sampleTx1RawBytes = common.FromHex(string(whoops.Must(os.ReadFile("testdata/sample-tx-raw.hex")))) - - sampleTx1 = func() *ethcoretypes.Transaction { + // Keeping the upload_smart_contract test on the old ABI until compass becomes more stable as + // updates to this test harness are tedious. + uscAbi = string(whoops.Must(os.ReadFile("testdata/usc-abi.json"))) + uscBytecodeStr = string(whoops.Must(os.ReadFile("testdata/usc-bytecode.out"))) + uscTx1RawBytes = common.FromHex(string(whoops.Must(os.ReadFile("testdata/usc-tx-raw.hex")))) + uscTx1 = func() *ethcoretypes.Transaction { tx := new(ethcoretypes.Transaction) - whoops.Assert(tx.UnmarshalBinary(sampleTx1RawBytes)) + whoops.Assert(tx.UnmarshalBinary(uscTx1RawBytes)) return tx }() @@ -47,15 +50,15 @@ var ( }) ) -type record struct { - denom string - erc20 string - chain string -} +// type record struct { +// denom string +// erc20 string +// chain string +// } -func (r record) GetDenom() string { return r.denom } -func (r record) GetErc20() string { return r.erc20 } -func (r record) GetChainReferenceId() string { return r.chain } +// func (r record) GetDenom() string { return r.denom } +// func (r record) GetErc20() string { return r.erc20 } +// func (r record) GetChainReferenceId() string { return r.chain } func TestKeeperGinkgo(t *testing.T) { RegisterFailHandler(g.Fail) @@ -114,7 +117,7 @@ var _ = g.Describe("attest router", func() { var ctx sdk.Context var q *consensusmocks.Queuer var v *evmmocks.ValsetKeeper - var gk *evmmocks.SkywayKeeper + // var gk *evmmocks.SkywayKeeper var consensukeeper *evmmocks.ConsensusKeeper var mk *evmmocks.MetrixKeeper var tk *evmmocks.TreasuryKeeper @@ -147,7 +150,7 @@ var _ = g.Describe("attest router", func() { ctx = _ctx k = *kpr v = ms.ValsetKeeper - gk = ms.SkywayKeeper + // gk = ms.SkywayKeeper tk = ms.TreasuryKeeper mk = ms.MetrixKeeper consensukeeper = ms.ConsensusKeeper @@ -163,7 +166,9 @@ var _ = g.Describe("attest router", func() { }) g.BeforeEach(func() { - consensusMsg = &types.Message{} + consensusMsg = &types.Message{ + AssigneeRemoteAddress: "0x28E9e9bfedEd29747FCc33ccA25b4B75f05E434B", + } }) g.JustBeforeEach(func() { @@ -183,6 +188,7 @@ var _ = g.Describe("attest router", func() { PublicAccessData: &consensustypes.PublicAccessData{ ValsetID: 1, }, + GasEstimate: 1000, } }) @@ -277,6 +283,8 @@ var _ = g.Describe("attest router", func() { big.NewInt(55), ) Expect(err).To(BeNil()) + err = k.SetFeeManagerAddress(ctx, newChain.GetChainReferenceID(), cDummyFeeMgrAddress) + Expect(err).To(BeNil()) sc, err := k.SaveNewSmartContract(ctx, contractAbi, common.FromHex(contractBytecodeStr)) Expect(err).To(BeNil()) @@ -370,6 +378,11 @@ var _ = g.Describe("attest router", func() { HexContractAddress: "0x51eca2efb15afacc612278c71f5edb35986f172f", Abi: []byte(contractAbi), Payload: common.FromHex(slcPayload), + Fees: &types.SubmitLogicCall_Fees{ + RelayerFee: 1, + CommunityFee: 2, + SecurityFee: 3, + }, }, } }) @@ -540,7 +553,7 @@ var _ = g.Describe("attest router", func() { g.When("message is UploadSmartContract", func() { g.BeforeEach(func() { - execTx = sampleTx1 + execTx = uscTx1 proof := whoops.Must(codectypes.NewAnyWithValue(&types.TxExecutedProof{SerializedTX: whoops.Must(execTx.MarshalBinary())})) evidence = []*consensustypes.Evidence{ { @@ -559,8 +572,8 @@ var _ = g.Describe("attest router", func() { consensusMsg.Action = &types.Message_UploadSmartContract{ UploadSmartContract: &types.UploadSmartContract{ Id: 1, - Abi: contractAbi, - Bytecode: common.FromHex(contractBytecodeStr), + Abi: uscAbi, + Bytecode: common.FromHex(uscBytecodeStr), }, } address, err := sdk.ValAddressFromBech32("cosmosvaloper1pzf9apnk8yw7pjw3v9vtmxvn6guhkslanh8r07") @@ -569,9 +582,9 @@ var _ = g.Describe("attest router", func() { }) g.When("target chain has no deployed ERC20 tokens", func() { - g.BeforeEach(func() { - gk.On("CastChainERC20ToDenoms", mock.Anything, mock.Anything).Return(nil, nil) - }) + // g.BeforeEach(func() { + // gk.On("CastChainERC20ToDenoms", mock.Anything, mock.Anything).Return(nil, nil) + // }) g.It("removes deployment", func() { setupChainSupport() Expect(subject()).To(BeNil()) @@ -588,43 +601,43 @@ var _ = g.Describe("attest router", func() { }) }) - g.When("target chain has active ERC20 tokens deployed", func() { - g.BeforeEach(func() { - gk.On("CastChainERC20ToDenoms", mock.Anything, newChain.ChainReferenceID).Return([]types.ERC20Record{ - record{"denom", "address1", newChain.ChainReferenceID}, - record{"denom2", "address2", newChain.ChainReferenceID}, - }, nil) - }) - g.It("updates deployment", func() { - setupChainSupport() - Expect(subject()).To(BeNil()) - v, key := k.getSmartContractDeploymentByContractID(ctx, uint64(1), newChain.GetChainReferenceID()) - Expect(key).ToNot(BeNil()) - Expect(v).ToNot(BeNil()) - Expect(v.GetStatus()).To(BeEquivalentTo(types.SmartContractDeployment_WAITING_FOR_ERC20_OWNERSHIP_TRANSFER)) - Expect(v.GetErc20Transfers()).To(BeEquivalentTo([]types.SmartContractDeployment_ERC20Transfer{ - { - Denom: "denom", - Erc20: "address1", - MsgID: 10, - Status: types.SmartContractDeployment_ERC20Transfer_PENDING, - }, - { - Denom: "denom2", - Erc20: "address2", - MsgID: 10, - Status: types.SmartContractDeployment_ERC20Transfer_PENDING, - }, - })) - }) - g.It("doesn't set the chain as active", func() { - setupChainSupport() - Expect(subject()).To(BeNil()) - v, err := k.GetChainInfo(ctx, newChain.GetChainReferenceID()) - Expect(err).To(BeNil()) - Expect(v.GetActiveSmartContractID()).To(BeEquivalentTo(uint64(0))) - }) - }) + // g.When("target chain has active ERC20 tokens deployed", func() { + // g.BeforeEach(func() { + // gk.On("CastChainERC20ToDenoms", mock.Anything, newChain.ChainReferenceID).Return([]types.ERC20Record{ + // record{"denom", "address1", newChain.ChainReferenceID}, + // record{"denom2", "address2", newChain.ChainReferenceID}, + // }, nil) + // }) + // g.It("updates deployment", func() { + // setupChainSupport() + // Expect(subject()).To(BeNil()) + // v, key := k.getSmartContractDeploymentByContractID(ctx, uint64(1), newChain.GetChainReferenceID()) + // Expect(key).ToNot(BeNil()) + // Expect(v).ToNot(BeNil()) + // Expect(v.GetStatus()).To(BeEquivalentTo(types.SmartContractDeployment_WAITING_FOR_ERC20_OWNERSHIP_TRANSFER)) + // Expect(v.GetErc20Transfers()).To(BeEquivalentTo([]types.SmartContractDeployment_ERC20Transfer{ + // { + // Denom: "denom", + // Erc20: "address1", + // MsgID: 10, + // Status: types.SmartContractDeployment_ERC20Transfer_PENDING, + // }, + // { + // Denom: "denom2", + // Erc20: "address2", + // MsgID: 10, + // Status: types.SmartContractDeployment_ERC20Transfer_PENDING, + // }, + // })) + // }) + // g.It("doesn't set the chain as active", func() { + // setupChainSupport() + // Expect(subject()).To(BeNil()) + // v, err := k.GetChainInfo(ctx, newChain.GetChainReferenceID()) + // Expect(err).To(BeNil()) + // Expect(v.GetActiveSmartContractID()).To(BeEquivalentTo(uint64(0))) + // }) + // }) }) g.JustAfterEach(func() { diff --git a/x/evm/keeper/attest_update_valset.go b/x/evm/keeper/attest_update_valset.go index 27b45c33..f4e710e7 100644 --- a/x/evm/keeper/attest_update_valset.go +++ b/x/evm/keeper/attest_update_valset.go @@ -52,7 +52,7 @@ func (a *updateValsetAttester) Execute(ctx sdk.Context) error { func (a *updateValsetAttester) attest(ctx sdk.Context, evidence *types.TxExecutedProof) error { _, err := attestTransactionIntegrity(ctx, a.originalMessage, a.k, evidence, - a.chainReferenceID, a.action.VerifyAgainstTX) + a.chainReferenceID, a.msg.AssigneeRemoteAddress, a.action.VerifyAgainstTX) if err != nil { a.logger.WithError(err).Error("Failed to verify transaction integrity.") return err diff --git a/x/evm/keeper/attest_upload_smart_contract.go b/x/evm/keeper/attest_upload_smart_contract.go index 8043c053..527a5e92 100644 --- a/x/evm/keeper/attest_upload_smart_contract.go +++ b/x/evm/keeper/attest_upload_smart_contract.go @@ -4,12 +4,8 @@ import ( "errors" "fmt" "math/big" - "strings" - "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" @@ -69,7 +65,7 @@ func (a *uploadSmartContractAttester) Execute(ctx sdk.Context) error { func (a *uploadSmartContractAttester) attest(ctx sdk.Context, evidence *types.TxExecutedProof) error { tx, err := attestTransactionIntegrity(ctx, a.originalMessage, a.k, evidence, - a.chainReferenceID, a.action.VerifyAgainstTX) + a.chainReferenceID, a.msg.AssigneeRemoteAddress, a.action.VerifyAgainstTX) if err != nil { a.logger.WithError(err).Error("Failed to verify transaction integrity.") return err @@ -101,16 +97,20 @@ func (a *uploadSmartContractAttester) attest(ctx sdk.Context, evidence *types.Tx return err } + // TODO temporarily disable token relink so we can update to compass 2.0. + // We need to reenable this in v1.16.1 after compass 2.0 is deployed. + // See https://github.com/VolumeFi/paloma/issues/1891 + // // Get the ERC20 tokens just for this chain - records, err := a.k.Skyway.CastChainERC20ToDenoms(ctx, a.chainReferenceID) - if err != nil { - a.logger.WithError(err).Error("Failed to extract ERC20 records.") - return err - } + // records, err := a.k.Skyway.CastChainERC20ToDenoms(ctx, a.chainReferenceID) + // if err != nil { + // a.logger.WithError(err).Error("Failed to extract ERC20 records.") + // return err + // } - if len(records) > 0 { - return a.startTokenRelink(ctx, deployment, records, newCompassAddr, smartContractID) - } + // if len(records) > 0 { + // return a.startTokenRelink(ctx, deployment, records, newCompassAddr, smartContractID) + // } // If this is the first deployment on chain, it won't have a snapshot // assigned to it. We need to assign it a snapshot, or we won't be able to @@ -136,100 +136,100 @@ func (a *uploadSmartContractAttester) attest(ctx sdk.Context, evidence *types.Tx return a.k.SetSmartContractAsActive(ctx, smartContractID, a.chainReferenceID) } -func (a *uploadSmartContractAttester) startTokenRelink( - ctx sdk.Context, - deployment *types.SmartContractDeployment, - records []types.ERC20Record, - newCompassAddr common.Address, - smartContractID uint64, -) error { - msgIDs := make([]uint64, 0, len(records)) - transfers := make([]types.SmartContractDeployment_ERC20Transfer, 0, len(records)) - erc20abi := `[{"inputs": [{"name": "_compass","type": "address"}],"name": "new_compass","outputs": [],"stateMutability": "nonpayable","type": "function"}]` - - for _, v := range records { - if v.GetChainReferenceId() != a.chainReferenceID { - continue - } - - payload, err := func() ([]byte, error) { - evm, err := abi.JSON(strings.NewReader(erc20abi)) - if err != nil { - return nil, err - } - return evm.Pack("new_compass", newCompassAddr) - }() - if err != nil { - return err - } - - // SLCs are usually always authored by either a contract on Paloma, or - // a specific validator. In this case, this is really a consensus operation - // without a singular governing entity. For the sake the established - // technological boundaries, we'll set the sender to the address of the - // validator that attested this message. - valAddr, err := sdk.ValAddressFromBech32(a.msg.GetAssignee()) - if err != nil { - return fmt.Errorf("validator address from bech32: %w", err) - } - - sender := sdk.AccAddress(valAddr.Bytes()) - - modifiedPayload, err := injectSenderIntoPayload(make([]byte, 32), payload) - if err != nil { - return fmt.Errorf("inject zero padding to payload: %w", err) - } - - ci, err := a.k.GetChainInfo(ctx, a.chainReferenceID) - if err != nil { - return fmt.Errorf("get chain info: %w", err) - } - - msgID, err := a.k.AddSmartContractExecutionToConsensus( - ctx, - a.chainReferenceID, - string(ci.GetSmartContractUniqueID()), - &types.SubmitLogicCall{ - HexContractAddress: v.GetErc20(), - Abi: common.FromHex(""), - Payload: modifiedPayload, - Deadline: ctx.BlockTime().Add(10 * time.Minute).Unix(), - SenderAddress: sender, - ExecutionRequirements: types.SubmitLogicCall_ExecutionRequirements{ - EnforceMEVRelay: false, - }, - }, - ) - if err != nil { - return fmt.Errorf("execute job: %w", err) - } - - msgIDs = append(msgIDs, msgID) - transfers = append(transfers, types.SmartContractDeployment_ERC20Transfer{ - Denom: v.GetDenom(), - Erc20: v.GetErc20(), - MsgID: msgID, - Status: types.SmartContractDeployment_ERC20Transfer_PENDING, - }) - } - - // This shouldn't be needed anymore, since we query the ERC20 tokens for - // this specific chain. However, just to make double sure, we check the - // transfers. If there's none, just set the contract to active. - if len(transfers) == 0 { - return a.k.SetSmartContractAsActive(ctx, smartContractID, a.chainReferenceID) - } - - deployment.Erc20Transfers = transfers - if err := a.k.updateSmartContractDeployment(ctx, smartContractID, a.chainReferenceID, deployment); err != nil { - a.logger.WithError(err).Error("Failed to update smart contract deployment") - return err - } - - a.k.deploymentCache.Add(ctx, a.chainReferenceID, smartContractID, msgIDs...) - a.logger.Debug("attestation successful") - return nil -} +// func (a *uploadSmartContractAttester) startTokenRelink( +// ctx sdk.Context, +// deployment *types.SmartContractDeployment, +// records []types.ERC20Record, +// newCompassAddr common.Address, +// smartContractID uint64, +// ) error { +// msgIDs := make([]uint64, 0, len(records)) +// transfers := make([]types.SmartContractDeployment_ERC20Transfer, 0, len(records)) +// erc20abi := `[{"inputs": [{"name": "_compass","type": "address"}],"name": "new_compass","outputs": [],"stateMutability": "nonpayable","type": "function"}]` + +// for _, v := range records { +// if v.GetChainReferenceId() != a.chainReferenceID { +// continue +// } + +// payload, err := func() ([]byte, error) { +// evm, err := abi.JSON(strings.NewReader(erc20abi)) +// if err != nil { +// return nil, err +// } +// return evm.Pack("new_compass", newCompassAddr) +// }() +// if err != nil { +// return err +// } + +// // SLCs are usually always authored by either a contract on Paloma, or +// // a specific validator. In this case, this is really a consensus operation +// // without a singular governing entity. For the sake the established +// // technological boundaries, we'll set the sender to the address of the +// // validator that attested this message. +// valAddr, err := sdk.ValAddressFromBech32(a.msg.GetAssignee()) +// if err != nil { +// return fmt.Errorf("validator address from bech32: %w", err) +// } + +// sender := sdk.AccAddress(valAddr.Bytes()) + +// modifiedPayload, err := injectSenderIntoPayload(make([]byte, 32), payload) +// if err != nil { +// return fmt.Errorf("inject zero padding to payload: %w", err) +// } + +// ci, err := a.k.GetChainInfo(ctx, a.chainReferenceID) +// if err != nil { +// return fmt.Errorf("get chain info: %w", err) +// } + +// msgID, err := a.k.AddSmartContractExecutionToConsensus( +// ctx, +// a.chainReferenceID, +// string(ci.GetSmartContractUniqueID()), +// &types.SubmitLogicCall{ +// HexContractAddress: v.GetErc20(), +// Abi: common.FromHex(""), +// Payload: modifiedPayload, +// Deadline: ctx.BlockTime().Add(10 * time.Minute).Unix(), +// SenderAddress: sender, +// ExecutionRequirements: types.SubmitLogicCall_ExecutionRequirements{ +// EnforceMEVRelay: false, +// }, +// }, +// ) +// if err != nil { +// return fmt.Errorf("execute job: %w", err) +// } + +// msgIDs = append(msgIDs, msgID) +// transfers = append(transfers, types.SmartContractDeployment_ERC20Transfer{ +// Denom: v.GetDenom(), +// Erc20: v.GetErc20(), +// MsgID: msgID, +// Status: types.SmartContractDeployment_ERC20Transfer_PENDING, +// }) +// } + +// // This shouldn't be needed anymore, since we query the ERC20 tokens for +// // this specific chain. However, just to make double sure, we check the +// // transfers. If there's none, just set the contract to active. +// if len(transfers) == 0 { +// return a.k.SetSmartContractAsActive(ctx, smartContractID, a.chainReferenceID) +// } + +// deployment.Erc20Transfers = transfers +// if err := a.k.updateSmartContractDeployment(ctx, smartContractID, a.chainReferenceID, deployment); err != nil { +// a.logger.WithError(err).Error("Failed to update smart contract deployment") +// return err +// } + +// a.k.deploymentCache.Add(ctx, a.chainReferenceID, smartContractID, msgIDs...) +// a.logger.Debug("attestation successful") +// return nil +// } func (a *uploadSmartContractAttester) attemptRetry(ctx sdk.Context) { contract := a.action diff --git a/x/evm/keeper/attest_upload_smart_contract_test.go b/x/evm/keeper/attest_upload_smart_contract_test.go index 64db0dc7..094aaa28 100644 --- a/x/evm/keeper/attest_upload_smart_contract_test.go +++ b/x/evm/keeper/attest_upload_smart_contract_test.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" "math/big" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -47,6 +48,10 @@ func setupTestChainSupport( return err } + if err := k.SetFeeManagerAddress(ctx, chain.GetChainReferenceID(), cDummyFeeMgrAddress); err != nil { + return fmt.Errorf("failed to set fee manager address: %w", err) + } + sc, err := k.SaveNewSmartContract(ctx, contractAbi, common.FromHex(contractBytecodeStr)) if err != nil { return err diff --git a/x/evm/keeper/errors.go b/x/evm/keeper/errors.go index 575f098f..1691778b 100644 --- a/x/evm/keeper/errors.go +++ b/x/evm/keeper/errors.go @@ -10,6 +10,7 @@ const ( ErrNotEnoughValidatorsForGivenChainReferenceID = liberr.Error("not enough validators in the current snapshot to form a proper valset") ErrUnexpectedError = liberr.Error("unexpected error") ErrConsensusNotAchieved = liberr.Error("evm: consensus not achieved") + ErrFeeManagerNotPresent = liberr.Error("evm: fee manager not present") ErrCannotAddSupportForChainThatExists = liberr.Error("chain info already exists: %s") ErrCannotActiveSmartContractThatIsNotDeploying = liberr.Error("trying to activate a smart contract that is not currently deploying") ErrInvalidReferenceBlockHeight = liberr.Error("new reference block height is invalid") diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index c7184737..9c2de3aa 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -168,12 +168,40 @@ func (k *Keeper) AddMessageConsensusAttestedListener(l metrixtypes.OnConsensusMe k.onMessageAttestedListeners = append(k.onMessageAttestedListeners, l) } -func (k Keeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) { +func (k Keeper) PickValidatorForMessage( + ctx context.Context, + chainReferenceID string, + requirements *xchain.JobRequirements, +) (string, string, error) { weights, err := k.GetRelayWeights(ctx, chainReferenceID) if err != nil { - return "", err + return "", "", err + } + + pick, err := k.msgAssigner.PickValidatorForMessage(ctx, weights, chainReferenceID, requirements) + if err != nil { + return "", "", err } - return k.msgAssigner.PickValidatorForMessage(ctx, weights, chainReferenceID, requirements) + + // Get the current snapshot, so we can get the validator external address + snapshot, err := k.Valset.GetCurrentSnapshot(ctx) + if err != nil { + return "", "", err + } + + for _, val := range snapshot.Validators { + if val.Address.String() == pick { + for _, info := range val.ExternalChainInfos { + if info.ChainReferenceID == chainReferenceID { + return pick, info.Address, nil + } + } + + break + } + } + + return "", "", errors.New("picked validator is missing external address") } func (k Keeper) Logger(ctx context.Context) liblog.Logr { @@ -190,6 +218,18 @@ func (k Keeper) ChangeMinOnChainBalance(ctx sdk.Context, chainReferenceID string return k.updateChainInfo(ctx, ci) } +func (k Keeper) SetFeeManagerAddress(ctx context.Context, chainReferenceID string, address string) error { + if !common.IsHexAddress(address) { + return fmt.Errorf("invalid address: %s", address) + } + ci, err := k.GetChainInfo(ctx, chainReferenceID) + if err != nil { + return err + } + ci.FeeManagerAddr = address + return k.updateChainInfo(ctx, ci) +} + func (k Keeper) UpdateChainReferenceBlock(ctx sdk.Context, chainReferenceID string, referenceBlockHeight uint64, referenceBlockHash string) error { ci, err := k.GetChainInfo(ctx, chainReferenceID) if err != nil { @@ -223,14 +263,6 @@ func (k Keeper) SupportedQueues(ctx context.Context) ([]consensus.SupportsConsen consensus.WithChainInfo(xchainType, chainInfo.ChainReferenceID), consensus.WithQueueTypeName(queue), consensus.WithStaticTypeCheck(queueInfo.msgType), - consensus.WithBytesToSignCalc( - consensustypes.BytesToSignFunc(func(msg consensustypes.ConsensusMsg, salt consensustypes.Salt) []byte { - k := msg.(interface { - Keccak256(uint64) []byte - }) - return k.Keccak256(salt.Nonce) - }), - ), consensus.WithVerifySignature(func(bz []byte, sig []byte, address []byte) bool { receivedAddr := common.BytesToAddress(address) @@ -400,6 +432,11 @@ func (k Keeper) ActivateChainReferenceID( k.Logger(sdkCtx).Error("error while activating chain with a new smart contract", args...) } else { k.Logger(sdkCtx).Info("activated chain with a new smart contract", args...) + + eventbus.EVMActivatedChain().Publish(ctx, eventbus.EVMActivatedChainEvent{ + ChainReferenceID: chainReferenceID, + SmartContractUniqueID: smartContractUniqueID, + }) } }() chainInfo, err := k.GetChainInfo(ctx, chainReferenceID) @@ -515,12 +552,12 @@ func (k Keeper) justInTimeValsetUpdate(ctx context.Context, chain *types.ChainIn return nil } - assignee, err := k.PickValidatorForMessage(ctx, chain.GetChainReferenceID(), nil) + assignee, remoteAddr, err := k.PickValidatorForMessage(ctx, chain.GetChainReferenceID(), nil) if err != nil { return err } - err = k.msgSender.SendValsetMsgForChain(ctx, chain, latestValset, assignee) + err = k.msgSender.SendValsetMsgForChain(ctx, chain, latestValset, assignee, remoteAddr) if err != nil { k.Logger(sdkCtx).Error("unable to send valset message for chain", "chain", chain.GetChainReferenceID(), @@ -550,7 +587,7 @@ func (k Keeper) PublishValsetToChain(ctx context.Context, valset types.Valset, c return nil } - assignee, err := k.PickValidatorForMessage(ctx, chain.GetChainReferenceID(), nil) + assignee, remoteAddr, err := k.PickValidatorForMessage(ctx, chain.GetChainReferenceID(), nil) if err != nil { k.Logger(sdkCtx).Error("error picking a validator to run the message", "chain-reference-id", chain.GetChainReferenceID(), @@ -560,7 +597,7 @@ func (k Keeper) PublishValsetToChain(ctx context.Context, valset types.Valset, c return err } - err = k.msgSender.SendValsetMsgForChain(ctx, chain, valset, assignee) + err = k.msgSender.SendValsetMsgForChain(ctx, chain, valset, assignee, remoteAddr) if err != nil { k.Logger(sdkCtx).Error("unable to send valset message for chain", "chain", chain.GetChainReferenceID(), @@ -627,7 +664,7 @@ func (m msgSender) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (m msgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string) error { +func (m msgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee, remoteAddr string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) m.Logger(sdkCtx).Info("snapshot was built and a new update valset message is being sent over", @@ -652,11 +689,17 @@ func (m msgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.C } mmsg := cmsg.(*types.Message) - act := mmsg.GetAction() if mmsg.GetTurnstoneID() != string(chainInfo.GetSmartContractUniqueID()) { return nil } - if _, ok := act.(*types.Message_UpdateValset); ok { + + if action, ok := mmsg.GetAction().(*types.Message_UpdateValset); ok { + if action.UpdateValset.Valset.ValsetID == valset.ValsetID { + // We already have an update valset scheduled for the same ID + // so there's nothing we need to do + return nil + } + err := m.ConsensusKeeper.DeleteJob(ctx, queueName, msg.GetId()) if err != nil { m.Logger(sdkCtx).Error("unable to delete message", "err", err) @@ -678,8 +721,12 @@ func (m msgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.C }, }, Assignee: assignee, + AssigneeRemoteAddress: remoteAddr, AssignedAtBlockHeight: math.NewInt(sdkCtx.BlockHeight()), - }, nil, + }, &consensus.PutOptions{ + RequireGasEstimation: true, + RequireSignatures: true, + }, ) if err != nil { m.Logger(sdkCtx).Error("unable to put message in the queue", "err", err) diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index 213f9368..8c4413d1 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -8,8 +8,12 @@ import ( "time" sdkmath "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" + consensustypes "github.com/palomachain/paloma/x/consensus/types" + "github.com/palomachain/paloma/x/evm/types" + evmtypes "github.com/palomachain/paloma/x/evm/types" "github.com/palomachain/paloma/x/evm/types/mocks" metrixtypes "github.com/palomachain/paloma/x/metrix/types" schedulertypes "github.com/palomachain/paloma/x/scheduler/types" @@ -54,6 +58,7 @@ func getValidators(num int, chains []validatorChainInfo) []valsettypes.Validator chainInfos[i] = &valsettypes.ExternalChainInfo{ ChainType: chain.chainType, ChainReferenceID: chain.chainReferenceID, + Address: fmt.Sprintf("0x%02d", i), } } validators[i] = valsettypes.Validator{ @@ -85,7 +90,6 @@ func buildKeeper(t *testing.T) (*Keeper, sdk.Context, mockedServices) { // test-chain mocks mockServices.ValsetKeeper.On("GetCurrentSnapshot", mock.Anything).Return(unpublishedSnapshot, nil) mockServices.ConsensusKeeper.On("PutMessageInQueue", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil) - mockServices.SkywayKeeper.On("GetLastObservedSkywayNonce", mock.Anything, mock.Anything).Return(uint64(100), nil) mockServices.MetrixKeeper.On("Validators", mock.Anything, mock.Anything).Return(&metrixtypes.QueryValidatorsResponse{ ValMetrics: getMetrics(3), }, nil) @@ -94,7 +98,6 @@ func buildKeeper(t *testing.T) (*Keeper, sdk.Context, mockedServices) { // invalid-test-chain mocks mockServices.ValsetKeeper.On("GetCurrentSnapshot", mock.Anything).Return(unpublishedSnapshot, nil) mockServices.ConsensusKeeper.On("PutMessageInQueue", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), nil) - mockServices.SkywayKeeper.On("GetLastObservedSkywayNonce", mock.Anything, mock.Anything).Return(uint64(100), nil) mockServices.MetrixKeeper.On("Validators", mock.Anything, mock.Anything).Return(&metrixtypes.QueryValidatorsResponse{ ValMetrics: getMetrics(3), }, nil) @@ -110,6 +113,8 @@ func buildKeeper(t *testing.T) (*Keeper, sdk.Context, mockedServices) { big.NewInt(55), ) require.NoError(t, err) + err = k.SetFeeManagerAddress(ctx, "test-chain", cDummyFeeMgrAddress) + require.NoError(t, err) sc, err := k.SaveNewSmartContract(ctx, contractAbi, common.FromHex(contractBytecodeStr)) require.NoError(t, err) @@ -137,6 +142,8 @@ func buildKeeper(t *testing.T) (*Keeper, sdk.Context, mockedServices) { big.NewInt(55), ) require.NoError(t, err) + err = k.SetFeeManagerAddress(ctx, "inactive-test-chain", cDummyFeeMgrAddress) + require.NoError(t, err) sc, err = k.SaveNewSmartContract(ctx, contractAbi, common.FromHex(contractBytecodeStr)) require.NoError(t, err) @@ -178,32 +185,38 @@ func TestKeeper_PreJobExecution(t *testing.T) { TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { + Address: sdk.ValAddress("validator-0"), State: valsettypes.ValidatorState_ACTIVE, ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", ChainReferenceID: "test-chain", + Address: "0x00", }, }, }, { + Address: sdk.ValAddress("validator-1"), State: valsettypes.ValidatorState_ACTIVE, ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", ChainReferenceID: "test-chain", + Address: "0x01", }, }, }, { + Address: sdk.ValAddress("validator-2"), State: valsettypes.ValidatorState_ACTIVE, ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", ChainReferenceID: "test-chain", + Address: "0x02", }, }, }, @@ -223,6 +236,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { mock.Anything, mock.Anything, mock.Anything, + mock.Anything, ).Return(nil) k.Valset = valsetKeeperMock @@ -508,7 +522,7 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { setup: func(ctx sdk.Context, k *Keeper, ms mockedServices) { ms.ValsetKeeper.On("GetLatestSnapshotOnChain", mock.Anything, mock.Anything).Return(nil, nil) // SendValsetMsgForChain indicates a publish - ms.MsgSender.On("SendValsetMsgForChain", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + ms.MsgSender.On("SendValsetMsgForChain", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) }, }, { @@ -565,7 +579,7 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { ms.ValsetKeeper.On("GetLatestSnapshotOnChain", mock.Anything, mock.Anything).Return(publishedSnapshot, nil) // SendValsetMsgForChain indicates a publish - ms.MsgSender.On("SendValsetMsgForChain", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + ms.MsgSender.On("SendValsetMsgForChain", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) }, forcePublish: true, }, @@ -597,3 +611,95 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { }) } } + +func TestKeeper_SendValsetMsgForChain(t *testing.T) { + k, ms, ctx := NewEvmKeeper(t) + mSender := msgSender{ + ConsensusKeeper: k.ConsensusKeeper, + cdc: k.cdc, + } + valset := types.Valset{ + ValsetID: 2, + Validators: []string{"addr1", "addr2"}, + Powers: []uint64{15, 5}, + } + chainInfo := &types.ChainInfo{ + ChainID: 100, + ChainReferenceID: "test-chain", + ReferenceBlockHeight: 1000, + ReferenceBlockHash: "0x00", + MinOnChainBalance: "100", + SmartContractUniqueID: []byte("abc"), + RelayWeights: &types.RelayWeights{ + Fee: "1.0", + Uptime: "1.0", + SuccessRate: "1.0", + ExecutionTime: "1.0", + FeatureSet: "1.0", + }, + } + + t.Run("Should do nothing if valset update is already scheduled", func(t *testing.T) { + qMsg, _ := codectypes.NewAnyWithValue(&evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: "test-chain", + Assignee: "addr4", + Action: &evmtypes.Message_UpdateValset{ + UpdateValset: &evmtypes.UpdateValset{ + Valset: &evmtypes.Valset{ + ValsetID: 2, + }, + }, + }, + }) + + msgs := []consensustypes.QueuedSignedMessageI{ + &consensustypes.QueuedSignedMessage{ + Id: 1, + Msg: qMsg, + }, + } + + ms.ConsensusKeeper.On("GetMessagesFromQueue", mock.Anything, mock.Anything, mock.Anything). + Return(msgs, nil). + Once() + + err := mSender.SendValsetMsgForChain(ctx, chainInfo, valset, "addr3", "0x03") + assert.NoError(t, err) + }) + + t.Run("Should add valset update to queue", func(t *testing.T) { + qMsg, _ := codectypes.NewAnyWithValue(&evmtypes.Message{ + TurnstoneID: "abc", + ChainReferenceID: "test-chain", + Assignee: "addr4", + Action: &evmtypes.Message_UpdateValset{ + UpdateValset: &evmtypes.UpdateValset{ + Valset: &evmtypes.Valset{ + ValsetID: 1, + }, + }, + }, + }) + + msgs := []consensustypes.QueuedSignedMessageI{ + &consensustypes.QueuedSignedMessage{ + Id: 1, + Msg: qMsg, + }, + } + + ms.ConsensusKeeper.On("GetMessagesFromQueue", mock.Anything, mock.Anything, mock.Anything). + Return(msgs, nil). + Once() + ms.ConsensusKeeper.On("DeleteJob", mock.Anything, mock.Anything, mock.Anything). + Return(nil). + Once() + ms.ConsensusKeeper.On("PutMessageInQueue", mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(uint64(1), nil). + Once() + + err := mSender.SendValsetMsgForChain(ctx, chainInfo, valset, "addr3", "0x03") + assert.NoError(t, err) + }) +} diff --git a/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go b/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go index 25ccdb55..e64d5ad6 100644 --- a/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go +++ b/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/require" ) +const cDummyFeeMgrAddress = "0xb794f5ea0ba39494ce839613fffba74279579268" + func addDeploymentToKeeper(t *testing.T, ctx sdk.Context, k *Keeper, mockServices mockedServices) { unpublishedSnapshot := &valsettypes.Snapshot{ Id: 1, @@ -31,7 +33,6 @@ func addDeploymentToKeeper(t *testing.T, ctx sdk.Context, k *Keeper, mockService // test-chain mocks mockServices.ValsetKeeper.On("GetCurrentSnapshot", mock.Anything).Return(unpublishedSnapshot, nil) mockServices.ConsensusKeeper.On("PutMessageInQueue", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uint64(10), nil) - mockServices.SkywayKeeper.On("GetLastObservedSkywayNonce", mock.Anything, mock.Anything).Return(uint64(100), nil) mockServices.MetrixKeeper.On("Validators", mock.Anything, mock.Anything).Return(&metrixtypes.QueryValidatorsResponse{ ValMetrics: getMetrics(3), }, nil) @@ -47,6 +48,8 @@ func addDeploymentToKeeper(t *testing.T, ctx sdk.Context, k *Keeper, mockService big.NewInt(55), ) require.NoError(t, err) + err = k.SetFeeManagerAddress(ctx, "test-chain", cDummyFeeMgrAddress) + require.NoError(t, err) sc, err := k.SaveNewSmartContract(ctx, contractAbi, common.FromHex(contractBytecodeStr)) require.NoError(t, err) diff --git a/x/evm/keeper/smart_contract_deployment.go b/x/evm/keeper/smart_contract_deployment.go index 0625ca70..658d876a 100644 --- a/x/evm/keeper/smart_contract_deployment.go +++ b/x/evm/keeper/smart_contract_deployment.go @@ -14,9 +14,11 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" xchain "github.com/palomachain/paloma/internal/x-chain" keeperutil "github.com/palomachain/paloma/util/keeper" "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/x/consensus/keeper/consensus" consensustypes "github.com/palomachain/paloma/x/consensus/types" "github.com/palomachain/paloma/x/evm/keeper/deployment" "github.com/palomachain/paloma/x/evm/types" @@ -116,9 +118,10 @@ func (k Keeper) SetAsCompassContract(ctx context.Context, smartContract *types.S err = k.tryDeployingSmartContractToAllChains(ctx, smartContract) if err != nil { // that's ok. it will try to deploy it on every end blocker - if !errors.Is(err, ErrConsensusNotAchieved) { - return fmt.Errorf("failed to deploy smart contract to all chains: %w", err) + if errors.Is(err, ErrConsensusNotAchieved) || errors.Is(err, ErrFeeManagerNotPresent) { + return nil } + return fmt.Errorf("failed to deploy smart contract to all chains: %w", err) } return nil @@ -169,7 +172,7 @@ func (k Keeper) AddSmartContractExecutionToConsensus( requirements := &xchain.JobRequirements{ EnforceMEVRelay: logicCall.ExecutionRequirements.EnforceMEVRelay, } - assignee, err := k.PickValidatorForMessage(ctx, chainReferenceID, requirements) + assignee, remoteAddr, err := k.PickValidatorForMessage(ctx, chainReferenceID, requirements) if err != nil { return 0, err } @@ -188,8 +191,12 @@ func (k Keeper) AddSmartContractExecutionToConsensus( SubmitLogicCall: logicCall, }, Assignee: assignee, + AssigneeRemoteAddress: remoteAddr, AssignedAtBlockHeight: sdkmath.NewInt(sdkCtx.BlockHeight()), - }, nil) + }, &consensus.PutOptions{ + RequireGasEstimation: true, + RequireSignatures: true, + }) } func (k Keeper) deploySmartContractToChain(ctx context.Context, chainInfo *types.ChainInfo, smartContract *types.SmartContract) (retErr error) { @@ -214,6 +221,13 @@ func (k Keeper) deploySmartContractToChain(ctx context.Context, chainInfo *types } }() logger := k.Logger(ctx) + if len(chainInfo.FeeManagerAddr) < 1 { + return ErrFeeManagerNotPresent + } + if !common.IsHexAddress(chainInfo.FeeManagerAddr) { + return fmt.Errorf("invalid feemanager address") + } + feeMgrAddr := common.HexToAddress(chainInfo.FeeManagerAddr) contractABI, err := abi.JSON(strings.NewReader(smartContract.GetAbiJSON())) if err != nil { return err @@ -260,10 +274,6 @@ func (k Keeper) deploySmartContractToChain(ctx context.Context, chainInfo *types } uniqueID := generateSmartContractID(ctx) k.createSmartContractDeployment(ctx, smartContract, chainInfo, uniqueID[:]) - lastSkywayNonce, err := k.Skyway.GetLastObservedSkywayNonce(ctx, chainInfo.GetChainReferenceID()) - if err != nil { - return fmt.Errorf("failed to get last observed skyway nonce: %w", err) - } // set the smart contract constructor arguments logger.Info( @@ -272,7 +282,7 @@ func (k Keeper) deploySmartContractToChain(ctx context.Context, chainInfo *types "validators-size", len(valset.GetValidators()), "power-size", len(valset.GetPowers()), ) - input, err := contractABI.Pack("", uniqueID, big.NewInt(0), (&big.Int{}).SetUint64(lastSkywayNonce), types.TransformValsetToCompassValset(&valset)) + input, err := contractABI.Pack("", uniqueID, big.NewInt(0), big.NewInt(0), types.TransformValsetToCompassValset(&valset), feeMgrAddr) if err != nil { return err } @@ -316,7 +326,7 @@ func (k Keeper) AddUploadSmartContractToConsensus( ) (uint64, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - assignee, err := k.PickValidatorForMessage(ctx, chainReferenceID, nil) + assignee, remoteAddr, err := k.PickValidatorForMessage(ctx, chainReferenceID, nil) if err != nil { return 0, err } @@ -334,6 +344,7 @@ func (k Keeper) AddUploadSmartContractToConsensus( UploadSmartContract: smartContract, }, Assignee: assignee, + AssigneeRemoteAddress: remoteAddr, AssignedAtBlockHeight: sdkmath.NewInt(sdkCtx.BlockHeight()), }, nil) } diff --git a/x/evm/keeper/testdata/sample-abi.json b/x/evm/keeper/testdata/sample-abi.json index bea4765a..44ac8fcd 100644 --- a/x/evm/keeper/testdata/sample-abi.json +++ b/x/evm/keeper/testdata/sample-abi.json @@ -64,7 +64,7 @@ { "indexed": false, "name": "receiver", - "type": "string" + "type": "bytes32" }, { "indexed": false, @@ -149,6 +149,104 @@ "name": "ERC20DeployedEvent", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "depositor_paloma_address", + "type": "bytes32" + }, + { + "indexed": false, + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "FundsDepositedEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "FundsWithdrawnEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "new_compass", + "type": "address" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "UpdateCompassAddressInFeeManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "contract_address", + "type": "address" + }, + { + "indexed": false, + "name": "buyer", + "type": "address" + }, + { + "indexed": false, + "name": "paloma", + "type": "bytes32" + }, + { + "indexed": false, + "name": "node_count", + "type": "uint256" + }, + { + "indexed": false, + "name": "grain_amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "NodeSaleEvent", + "type": "event" + }, { "inputs": [ { @@ -160,7 +258,7 @@ "type": "uint256" }, { - "name": "_skyway_nonce", + "name": "_gravity_nonce", "type": "uint256" }, { @@ -180,6 +278,10 @@ ], "name": "valset", "type": "tuple" + }, + { + "name": "fee_manager", + "type": "address" } ], "stateMutability": "nonpayable", @@ -246,6 +348,14 @@ ], "name": "new_valset", "type": "tuple" + }, + { + "name": "relayer", + "type": "address" + }, + { + "name": "gas_estimate", + "type": "uint256" } ], "name": "update_valset", @@ -311,6 +421,28 @@ "name": "args", "type": "tuple" }, + { + "components": [ + { + "name": "relayer_fee", + "type": "uint256" + }, + { + "name": "community_fee", + "type": "uint256" + }, + { + "name": "security_fee", + "type": "uint256" + }, + { + "name": "fee_payer_paloma_address", + "type": "bytes32" + } + ], + "name": "fee_args", + "type": "tuple" + }, { "name": "message_id", "type": "uint256" @@ -318,6 +450,10 @@ { "name": "deadline", "type": "uint256" + }, + { + "name": "relayer", + "type": "address" } ], "name": "submit_logic_call", @@ -333,7 +469,7 @@ }, { "name": "receiver", - "type": "string" + "type": "bytes32" }, { "name": "amount", @@ -414,6 +550,14 @@ { "name": "deadline", "type": "uint256" + }, + { + "name": "relayer", + "type": "address" + }, + { + "name": "gas_estimate", + "type": "uint256" } ], "name": "submit_batch", @@ -421,6 +565,30 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "name": "buyer", + "type": "address" + }, + { + "name": "paloma", + "type": "bytes32" + }, + { + "name": "node_count", + "type": "uint256" + }, + { + "name": "grain_amount", + "type": "uint256" + } + ], + "name": "emit_nodesale_event", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -449,6 +617,231 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "name": "contract_address", + "type": "address" + }, + { + "name": "payload", + "type": "bytes" + } + ], + "name": "arbitrary_view", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "depositor_paloma_address", + "type": "bytes32" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "name": "amount", + "type": "uint256" + }, + { + "name": "dex", + "type": "address" + }, + { + "name": "payload", + "type": "bytes" + }, + { + "name": "min_grain", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "amount", + "type": "uint256" + } + ], + "name": "security_fee_topup", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + }, + { + "components": [ + { + "name": "v", + "type": "uint256" + }, + { + "name": "r", + "type": "uint256" + }, + { + "name": "s", + "type": "uint256" + } + ], + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "consensus", + "type": "tuple" + }, + { + "name": "message_id", + "type": "uint256" + }, + { + "name": "deadline", + "type": "uint256" + }, + { + "name": "receiver", + "type": "bytes32" + }, + { + "name": "relayer", + "type": "address" + }, + { + "name": "gas_estimate", + "type": "uint256" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "dex", + "type": "address" + }, + { + "name": "payload", + "type": "bytes" + }, + { + "name": "min_grain", + "type": "uint256" + } + ], + "name": "bridge_community_tax_to_paloma", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + }, + { + "components": [ + { + "name": "v", + "type": "uint256" + }, + { + "name": "r", + "type": "uint256" + }, + { + "name": "s", + "type": "uint256" + } + ], + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "consensus", + "type": "tuple" + }, + { + "name": "deadline", + "type": "uint256" + }, + { + "name": "gas_estimate", + "type": "uint256" + }, + { + "name": "_new_compass", + "type": "address" + }, + { + "name": "relayer", + "type": "address" + } + ], + "name": "update_compass_address_in_fee_manager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "compass_id", @@ -499,7 +892,7 @@ }, { "inputs": [], - "name": "last_skyway_nonce", + "name": "last_gravity_nonce", "outputs": [ { "name": "", @@ -542,5 +935,29 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [], + "name": "slc_switch", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FEE_MANAGER", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] diff --git a/x/evm/keeper/testdata/sample-bytecode.out b/x/evm/keeper/testdata/sample-bytecode.out index 859f5ee8..90349f07 100644 --- a/x/evm/keeper/testdata/sample-bytecode.out +++ b/x/evm/keeper/testdata/sample-bytecode.out @@ -1 +1 @@ -0x60206110e16000396000516020816110c10160003960005181016101406020826110c101600039600051116110bc576020816110c1016000396000518060405260008161014081116110bc57801561008357905b60206020820260208601016110c1016000396000518060a01c6110bc576020820260600152600101818118610053575b505050506020602082016110c10160003960005181016101406020826110c101600039600051116110bc576020816110c1016000396000518061286052602082016020820280826110c10161288039505050506020604082016110c101600039600051615080525060206110c1600039600051630000f300526040366150a037600060405161014081116110bc57801561018c57905b60208102606001516150e0526150a05160206150c051612860518110156110bc5702612880015181818301106110bc57808201905090506150a05263aaaaaaaa6150a051106101675761018c565b6150c051600181818301106110bc57808201905090506150c052600101818118610119575b505063aaaaaaaa6150a05110156102035760126150e0527f496e73756666696369656e7420506f7765720000000000000000000000000000615100526150e0506150e051806151000181600003601f1636823750506308c379a06150a05260206150c052601f19601f6150e05101166044016150bcfd5b63299018c261a20452600460808061a224528061a2240160006040518083526020810260008261014081116110bc57801561025757905b60208102606001516020820260208801015260010181811861023a575b505082016020019150509050810190508061a244528061a224016000612860518083526020810260008261014081116110bc5780156102b057905b60208102612880015160208202602088010152600101818118610292575b505082016020019150509050810190506150805161a2645260206110c160003960005161a284520161a2005261a2008051602082012090506150e0526150e0516000557f09d40458cf931745f8d532ef13fa9c74bfb7fe0edcee88e0a677b0cbef88f0f96150e0516151005261508051615120526040615100a1610d78610343630000e58839610d78602001630000e588f3600436101561000d57610a07565b60003560e01c34610d735763f0f405048118610037576020610d7860003960005160405260206040f35b63eadf4af78118610513576004356004018035810180358101610140813511610d735780358061f2a0526000816101408111610d7357801561009b57905b602081026020850101358060a01c610d73576020820261f2c00152600101818118610075575b5050505060208101358101610140813511610d735780358062011ac0526020820160208202808262011ae037505050506040810135620142e0525060208101358101610140813511610d73578035806201430052602082016060820280826201432037505050505060243560040180358101610140813511610d73578035806201bb20526000816101408111610d7357801561015a57905b602081026020850101358060a01c610d7357602082026201bb400152600101818118610133575b5050505060208101358101610140813511610d73578035806201e34052602082016020820280826201e3603750505050604081013562020b605250620142e05162020b60511161021357601162020b80527f496e76616c69642056616c73657420494400000000000000000000000000000062020ba05262020b805062020b80518062020ba00181600003601f1636823750506308c379a062020b4052602062020b6052601f19601f62020b8051011660440162020b5cfd5b60403662020b803760006201bb20516101408111610d735780156102b157905b602081026201bb40015162020bc05262020b8051602062020ba0516201e34051811015610d7357026201e36001518181830110610d73578082019050905062020b805263aaaaaaaa62020b80511061028a576102b1565b62020ba05160018181830110610d73578082019050905062020ba052600101818118610233575b505063aaaaaaaa62020b8051101561033257601262020bc0527f496e73756666696369656e7420506f776572000000000000000000000000000062020be05262020bc05062020bc0518062020be00181600003601f1636823750506308c379a062020b8052602062020ba052601f19601f62020bc051011660440162020b9cfd5b61f2a05180604052602081028060608261f2c060045afa9050505062011ac051806128605260208102806128808262011ae060045afa90505050620142e0516150805261038162020bc0610c89565b62020bc051600054146103fd57601462020be0527f496e636f727265637420436865636b706f696e7400000000000000000000000062020c005262020be05062020be0518062020c000181600003601f1636823750506308c379a062020ba052602062020bc052601f19601f62020be051011660440162020bbcfd5b6201bb20518060405260208102806060826201bb4060045afa905050506201e3405180612860526020810280612880826201e36060045afa9050505062020b60516150805261044e62020be0610c89565b62020be05162020bc05261f2a051806102405260208102806102608261f2c060045afa9050505062011ac05180612a60526020810280612a808262011ae060045afa90505050620142e051615280526201430051806152a05260608102806152c0826201432060045afa9050505062020bc05161cac0526104cd610ab0565b62020bc0516000557f09d40458cf931745f8d532ef13fa9c74bfb7fe0edcee88e0a677b0cbef88f0f962020bc05162020be05262020b605162020c0052604062020be0a1005b631029ae6f81186109c9576004356004018035810180358101610140813511610d735780358061f2a0526000816101408111610d7357801561057757905b602081026020850101358060a01c610d73576020820261f2c00152600101818118610551575b5050505060208101358101610140813511610d735780358062011ac0526020820160208202808262011ae037505050506040810135620142e0525060208101358101610140813511610d73578035806201430052602082016060820280826201432037505050505060243560040180358060a01c610d73576201bb205260208101358101615000813511610d73578035806201bb40526020820181816201bb60375050505060643542111561069557600762020b60527f54696d656f75740000000000000000000000000000000000000000000000000062020b805262020b605062020b60518062020b800181600003601f1636823750506308c379a062020b2052602062020b4052601f19601f62020b6051011660440162020b3cfd5b60016044356020526000526040600020541561071a57600f62020b60527f55736564204d6573736167655f4944000000000000000000000000000000000062020b805262020b605062020b60518062020b800181600003601f1636823750506308c379a062020b2052602062020b4052601f19601f62020b6051011660440162020b3cfd5b6001600160443560205260005260406000205561f2a05180604052602081028060608261f2c060045afa9050505062011ac051806128605260208102806128808262011ae060045afa90505050620142e0516150805261077c62020b60610c89565b62020b6051600054146107f857601462020b80527f496e636f727265637420436865636b706f696e7400000000000000000000000062020ba05262020b805062020b80518062020ba00181600003601f1636823750506308c379a062020b4052602062020b6052601f19601f62020b8051011660440162020b5cfd5b63980721b262025ca452600460808062025cc4528062025cc40160406201bb205182528060208301528082016201bb4051808252602082018181836201bb6060045afa90505050805180602083010181600003601f163682375050601f19601f8251602001011690508101905090508101905060443562025ce4526020610d7860003960005162025d045260643562025d24520162025ca05262025ca080516020820120905062020b605261f2a051806102405260208102806102608261f2c060045afa9050505062011ac05180612a60526020810280612a808262011ae060045afa90505050620142e051615280526201430051806152a05260608102806152c0826201432060045afa9050505062020b605161cac052610918610ab0565b6201bb406000600082516020840160006201bb20515af19050610940573d600060003e3d6000fd5b7f0d2bd340033bb64fd086788e6685b480a9bf10b98d63e9b8073eb5d0bd6c6ee960606201bb205162020b80528062020ba0528062020b80016201bb4051808252602082018181836201bb6060045afa90505050805180602083010181600003601f163682375050601f19601f8251602001011690508101905060443562020bc05262020b80a1005b63a9a4a98381186109e05760005460405260206040f35b6338d6172d8118610a0557600160043560205260005260406000205460405260206040f35b505b60006000fd5b6000601c6101a0527f19457468657265756d205369676e6564204d6573736167653a0a3332000000006101c0526101a0805160208201836102000181518152505080830192505050606051816102000152602081019050806101e0526101e0905080516020820120905060e05260e051610100526080516101205260a0516101405260c0516101605260206000608061010060015afa5060005160405114815250565b60403661cae03760006152a0516101408111610d73578015610c1057905b606081026152c001805161cb2052602081015161cb4052604081015161cb605250600061cb205114610beb57602061cae05161024051811015610d735702610260015160405261cac05160605261cb205160805261cb405160a05261cb605160c052610b3b61cb80610a0d565b61cb8051610ba957601161cba0527f496e76616c6964205369676e617475726500000000000000000000000000000061cbc05261cba05061cba0518061cbc00181600003601f1636823750506308c379a061cb6052602061cb8052601f19601f61cba051011660440161cb7cfd5b61cb0051602061cae051612a6051811015610d735702612a8001518181830110610d73578082019050905061cb005263aaaaaaaa61cb005110610beb57610c10565b61cae05160018181830110610d73578082019050905061cae052600101818118610ace575b505063aaaaaaaa61cb00511015610c8757601261cb20527f496e73756666696369656e7420506f776572000000000000000000000000000061cb405261cb205061cb20518061cb400181600003601f1636823750506308c379a061cae052602061cb0052601f19601f61cb2051011660440161cafcfd5b565b63299018c261a1a452600460808061a1c4528061a1c4016000604051808352602081026000826101408111610d73578015610cdd57905b602081026060015160208202602088010152600101818118610cc0575b505082016020019150509050810190508061a1e4528061a1c401600061286051808352602081026000826101408111610d73578015610d3657905b60208102612880015160208202602088010152600101818118610d18575b505082016020019150509050810190506150805161a204526020610d7860003960005161a224520161a1a05261a1a0805160208201209050815250565b600080fd005b600080fd31373737000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000590000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e4ab6f4d62ba7e0bbc4cf6c5e8153e105108fba900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000100000000 \ No newline at end of file +0x6166a051503461034c5760206127465f395f516020816126e6015f395f51810160c86020826126e6015f395f511161034c576020816126e6015f395f515f8160c8811161034c57801561007c57905b60208160051b60208601016126e6015f395f518060a01c61034c578160051b60c0015260010181811861004e575b50508060a05250506020602082016126e6015f395f51810160c86020826126e6015f395f511161034c576020816126e6015f395f5160208160051b0180836126e6016119c0395050506020604082016126e6016132e0395060206127665f395f518060a01c61034c576133005260206126e65f395f5161668052604036613320375f60a05160c8811161034c57801561017357905b8060051b60c001516133605261332051613340516119c05181101561034c5760051b6119e0015180820182811061034c57905090506133205263aaaaaaaa613320511061015d57610173565b6001613340510161334052600101818118610111575b5050613320516040526101846102e0565b63299018c26133845260046080806133a452806133a4015f60a0518083528060051b5f8260c8811161034c5780156101d557905b8060051b60c001518160051b6020880101526001018181186101b8575b50508201602001915050905081019050806133c452806133a4015f6119c0518083528060051b5f8260c8811161034c57801561022b57905b8060051b6119e001518160051b60208801015260010181811861020d575b505082016020019150509050810190506132e0516133e4526166805161340452016133805261338080516020820120905061336052613360516001556132e05160025560206127065f395f5160035560206127265f395f51600455613300516166a0527fb7ca5e46e360950244488bf096bf742a1f63183cf1ee5b3b0c53045b6247bf5b61336051613380526132e0516133a05260206127066133c0396060613380a1612380610350614300396123c0614300f35b63aaaaaaaa604051101561034a5760126060527f496e73756666696369656e7420506f776572000000000000000000000000000060805260605060605180608001601f825f031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b565b5f80fd5f3560e01c60026015820660011b61235601601e395f51565b6384d38f2c8118610036573461235257602061238060403960206040f35b6308a92ad78118611de25761010436103417612352576004356004016040813511612352576020813501808260403750506024356004016040813511612352576020813501808260a0375050604435600401602081351161235257602081350180826101003750506064358060081c61235257610140526084358060a01c612352576101605230331815610129576007610180527f496e76616c6964000000000000000000000000000000000000000000000000006101a0526101805061018051806101a001601f825f031636823750506308c379a061014052602061016052601f19601f61018051011660440161015cfd5b610160516080306101a0526101a0516101e0528061020052806101e001602060a0510180828260a060045afa50508051806020830101601f825f03163682375050601f19601f825160200101169050810190508061022052806101e0016101005181526101205160208201528051806020830101601f825f03163682375050601f19601f82516020010116905081019050610140516101c0526101c051610240526003823b0359600182126123525781600382863c8181018381856101e060045afa5050828201815ff08015612352579050905090509050610180526001600354016101a0526101a0516003557f82fe3a4fa49c6382d0c085746698ddbbafe6c2bf61285b19410644b5b26287c760c0806101c052806101c001602060405101808282604060045afa50508051806020830101601f825f03163682375050601f19601f82516020010116905081019050610180516101e0528061020052806101c001602060a0510180828260a060045afa50508051806020830101601f825f03163682375050601f19601f825160200101169050810190508061022052806101c0016101005181526101205160208201528051806020830101601f825f03163682375050601f19601f8251602001011690508101905061014051610240526101a051610260526101c0a100611de2565b63a9a4a9838118611de257346123525760015460405260206040f3611de2565b634da6ecc98118611de257346123525760025460405260206040f3611de2565b6319429b8d8118611de257346123525760035460405260206040f3611de2565b630cb39e968118611de257346123525760045460405260206040f3611de2565b63fa82256781186103d457602436103417612352576004358060a01c6123525760405260056040516020525f5260405f205460605260206060f35b63120e8ddd8118611de2576101a43610341761235257600435600401803581018035810160c88135116123525780355f8160c8811161235257801561043b57905b8060051b6020850101358060a01c612352578160051b6180600152600101818118610415575b5050806180405250506020810135810160c881351161235257803560208160051b01808361996037505050604081013561b28052506020810135810160c881351161235257803560206060820201808361b2a037505050506064358060a01c6123525761fdc0526084358060a01c6123525761fde05261fde05160c05260443560e0526104c661222a565b6024356040526104d46121c2565b613260604061326061804060045afa506104ef61fe00612058565b61fe005161fe205261fe205160405261050661227b565b63ec633b6b61fe2452600460243561fe445261fde05161fe645260443561fe845261fdc05161fea45260800161fe205261fe2080516020820120905061fe0052617d806101a0617d8061804060045afa5061fe0051617f2052610567611efb565b60206123a05f395f5161fdc05163ea26266c61fe2052602061fe20600461fe3c845afa610596573d5f5f3e3d5ffd5b60203d106123525761fe20518060a01c6123525761fe605261fe60905051181561061f57601961fe80527f57726f6e67206e657720636f6d7061737320616464726573730000000000000061fea05261fe805061fe80518061fea001601f825f031636823750506308c379a061fe4052602061fe6052601f19601f61fe8051011660440161fe5cfd5b60206123a05f395f51636974af6961fe205261fdc05161fe4052803b15612352575f61fe20602461fe3c5f855af1610659573d5f5f3e3d5ffd5b5060016003540161fe205261fe20516003557f0662fa994447aee93c78fd46a6801f664461ecbba2af6c5a0a6aecbc955835fc61fdc05161fe405261fe205161fe6052604061fe40a100611de2565b6338d6172d81186106d5576024361034176123525760066004356020525f5260405f205460405260206040f35b63a0dd2e498118611de2576102643610341761235257600435600401803581018035810160c88135116123525780355f8160c8811161235257801561073c57905b8060051b6020850101358060a01c612352578160051b6180600152600101818118610716575b5050806180405250506020810135810160c881351161235257803560208160051b01808361996037505050604081013561b28052506020810135810160c881351161235257803560206060820201808361b2a037505050506084358060a01c6123525761fdc05260e4358060a01c6123525761fde05261010435600401610404813511612352576020813501808261fe003750505f546002146123525760025f5561fdc05160c05260a43560e0526107f261222a565b6044356040526108006121c2565b60066024356020525f5260405f20541561088257600f62010240527f55736564204d6573736167655f49440000000000000000000000000000000000620102605262010240506201024051806201026001601f825f031636823750506308c379a0620102005260206201022052601f19601f620102405101166044016201021cfd5b600160066024356020525f5260405f2055613260604061326061804060045afa506108af62010240612058565b6201024051620102605262010260516040526108c961227b565b636c5023876201026452600461012060606024620102843761fdc051620102e452604060a4620103043761fde0516201034452806201036452806201028401602061fe00510180828261fe0060045afa50508051806020830101601f825f03163682375050601f19601f82516020010116905081019050610124356201038452016201026052620102608051602082012090506201024052617d806101a0617d8061804060045afa506201024051617f2052610983611efb565b604036620102603760206123a05f395f516306c9624d620102a052608060c435620102c05261fde051620102e05280620103005280620102c001602061fe00510180828261fe0060045afa50508051806020830101601f825f03163682375050601f19601f82516020010116905081019050610124356201032052506040620102a06104c4620102bc5f855af1610a1c573d5f5f3e3d5ffd5b60403d1061235257620102a0518060a01c612352576201078052620102c051620107a05262010780905080516201026052602081015162010280525062010260516040526064356060526201028051608052610a766122e5565b60035f5500611de2565b63844105e18118610a9c57346123525760075460405260206040f35b63ea26266c8118611de257346123525760206123a060403960206040f3611de2565b63f064acb28118611de2576102243610341761235257600435600401803581018035810160c88135116123525780355f8160c88111612352578015610b2557905b8060051b6020850101358060a01c612352578160051b6180600152600101818118610aff575b5050806180405250506020810135810160c881351161235257803560208160051b01808361996037505050604081013561b28052506020810135810160c881351161235257803560206060820201808361b2a037505050506024356004018035810160c88135116123525780355f8160c88111612352578015610bca57905b8060051b6020850101358060a01c612352578160051b61fde00152600101818118610ba4575b50508061fdc05250506020810135810160c881351161235257803560208160051b018083620116e03750505060408101356201300052506044358060a01c612352576201302052620130205160c05260643560e052610c2761222a565b61b28051620130005111610ca357601162013040527f496e76616c69642056616c736574204944000000000000000000000000000000620130605262013040506201304051806201306001601f825f031636823750506308c379a0620130005260206201302052601f19601f620130405101166044016201301cfd5b60403662013040375f61fdc05160c88111612352578015610d2c57905b8060051b61fde00151620130805262013040516201306051620116e0518110156123525760051b6201170001518082018281106123525790509050620130405263aaaaaaaa620130405110610d1457610d2c565b60016201306051016201306052600101818118610cc0575b50506201304051604052610d3e611de6565b613260604061326061804060045afa50610d5a62013080612058565b6201308051620130a052620130a051604052610d7461227b565b613260604061326061fdc060045afa50610d90620130a0612058565b620130a0516201308052639af2b8d2620130c45260046201308051620130e452620130205162013104526064356201312452606001620130c052620130c0805160208201209050620130a052617d806101a0617d8061804060045afa50620130a051617f2052610dfe611efb565b62013080516001556201300051600255600160035401620130c052620130c0516003557fb7ca5e46e360950244488bf096bf742a1f63183cf1ee5b3b0c53045b6247bf5b6201308051620130e05262013000516201310052620130c05162013120526060620130e0a100611de2565b63a930e8dc8118611de2576102843610341761235257600435600401803581018035810160c88135116123525780355f8160c88111612352578015610ed457905b8060051b6020850101358060a01c612352578160051b6180600152600101818118610eae575b5050806180405250506020810135810160c881351161235257803560208160051b01808361996037505050604081013561b28052506020810135810160c881351161235257803560206060820201808361b2a0375050505060243560040180358060a01c6123525761fdc05260208101358101612800813511612352576020813501808261fde037505050610104358060a01c61235257620126005260206123a05f395f5163ffd8d4aa62012620526080604462012640376201260051620126c052803b15612352575f6201262060a46201263c5f855af1610fb8573d5f5f3e3d5ffd5b5060e435604052610fc76121c2565b600660c4356020525f5260405f20541561104957600f62012620527f55736564204d6573736167655f49440000000000000000000000000000000000620126405262012620506201262051806201264001601f825f031636823750506308c379a0620125e05260206201260052601f19601f62012620510116604401620125fcfd5b6001600660c4356020525f5260405f2055613260604061326061804060045afa5061107662012620612058565b62012620516201264052620126405160405261109061227b565b638046d1e762012644526004610120806201266452806201266401604061fdc0518252806020830152808201602061fde0510180828261fde060045afa50508051806020830101601f825f03163682375050601f19601f8251602001011690508101905090508101905060806044620126843760c43562012704526020612380620127243960e435620127445262012600516201276452016201264052620126408051602082012090506201262052617d806101a0617d8061804060045afa506201262051617f2052611161611efb565b600160075561fdc0515a61fde05f5f8251602084015f8787f190509050905061118c573d5f5f3e3d5ffd5b5f600755600160035401620126405262012640516003557f0594b174e11e17c2cb4d0d303c2125060bea4f4da113a4e79edce87465592d00608061fdc0516201266052806201268052806201266001602061fde0510180828261fde060045afa50508051806020830101601f825f03163682375050601f19601f8251602001011690508101905060c435620126a0526201264051620126c05262012660a100611de2565b63f650f6e981186113d557606436103417612352576004358060a01c612352576101a0526101a0516370a082316101e052306102005260206101e060246101fc845afa61127f573d5f5f3e3d5ffd5b60203d10612352576101e09050516101c0526101a0516323b872dd6101e052336102005230610220526044356102405260206101e060646101fc5f855af16112c9573d5f5f3e3d5ffd5b3d6112e057803b15612352576001610260526112f9565b60203d10612352576101e0518060011c61235257610260525b610260905051611368576013610280527f6661696c6564205472616e7366657246726f6d000000000000000000000000006102a0526102805061028051806102a001601f825f031636823750506308c379a061024052602061026052601f19601f61028051011660440161025cfd5b6101a0516370a082316101e052306102005260206101e060246101fc845afa611393573d5f5f3e3d5ffd5b60203d10612352576101e09050516101c05180820382811161235257905090506101c0526101a0516040526024356060526101c0516080526113d36122e5565b005b63048a245d8118611de25760a436103417612352576024358060a01c612352576040526044356004016104048135116123525760208135018082606037505060206123a05f395f5163d07e9fa06104a05260a0336104c0526004356104e052604051610500528061052052806104c001602060605101808282606060045afa50508051806020830101601f825f03163682375050601f19601f825160200101169050810190506064356105405250803b15612352575f6104a06104e46104bc5f855af16114a4573d5f5f3e3d5ffd5b507fbcd7c5f94d828115734ea3d51400c2e1ad93894d1a5099a1808794a924f71f24336104a0526004356104c05260406104a0a100611de2565b6314fe978f8118611a9d576102643610341761235257600435600401803581018035810160c88135116123525780355f8160c8811161235257801561154557905b8060051b6020850101358060a01c612352578160051b618060015260010181811861151f575b5050806180405250506020810135810160c881351161235257803560208160051b01808361996037505050604081013561b28052506020810135810160c881351161235257803560206060820201808361b2a037505050506024358060a01c6123525761fdc0526044356004018035810160408135116123525780355f81604081116123525780156115f957905b8060051b6020850101358060a01c612352578160051b61fe0001526001018181186115d3575b50508061fde052505060208101358101604081351161235257803560208160051b01808362010600375050505060a4358060a01c6123525762010e205262010e205160c05260c43560e05261164c61222a565b60843560405261165a6121c2565b606435600561fdc0516020525f5260405f2054106116e057600e62010e40527f57726f6e6720626174636820696400000000000000000000000000000000000062010e605262010e405062010e40518062010e6001601f825f031636823750506308c379a062010e0052602062010e2052601f19601f62010e4051011660440162010e1cfd5b61fde05162010e4052620106005162010e4051181561176757601062010e60527f556e6d61746368656420506172616d730000000000000000000000000000000062010e805262010e605062010e60518062010e8001601f825f031636823750506308c379a062010e2052602062010e4052601f19601f62010e6051011660440162010e3cfd5b613260604061326061804060045afa5061178362010e60612058565b62010e605162010e805262010e805160405261179d61227b565b636f7be45762010e8452600460e061fdc05162010ea4528062010ec4528062010ea40160408082528082015f61fde0518083528060051b5f826040811161235257801561180457905b8060051b61fe0001518160051b6020880101526001018181186117e6575b505082016020019150509050810190508060208301528082015f62010600518083528060051b5f826040811161235257801561185b57905b8060051b6201062001518160051b60208801015260010181811861183c575b5050820160200191505090508101905090508101905060643562010ee452602061238062010f043960843562010f245262010e205162010f445260c43562010f64520162010e805262010e8080516020820120905062010e6052617d806101a0617d8061804060045afa5062010e6051617f20526118d7611efb565b5f6040905b8062010e805262010e405162010e8051106118f657611a13565b61fdc05163a9059cbb62010ea05262010e805161fde0518110156123525760051b61fe00015162010ec05262010e805162010600518110156123525760051b62010620015162010ee052602062010ea0604462010ebc5f855af161195c573d5f5f3e3d5ffd5b3d61197457803b1561235257600162010f005261198f565b60203d106123525762010ea0518060011c6123525762010f00525b62010f00905051611a0857600f62010f20527f6661696c6564207472616e73666572000000000000000000000000000000000062010f405262010f205062010f20518062010f4001601f825f031636823750506308c379a062010ee052602062010f0052601f19601f62010f2051011660440162010efcfd5b6001018181186118dc575b505060016004540162010e805262010e805160045560016003540162010ea05262010ea051600355606435600561fdc0516020525f5260405f20557f0ba40544a53f11e70bd7e03a4cfeec841fc3566e81dfbef26f669358a705ad2c61fdc05162010ec05260643562010ee05262010e805162010f005262010ea05162010f2052608062010ec0a1005b63da29a8c68118611de2576023361115612352575f546002146123525760025f556004353411611b3057346004351815611b425760146040527f496e73756666696369656e74206465706f73697400000000000000000000000060605260405060405180606001601f825f031636823750506308c379a05f526020602052601f19601f6040510116604401601cfd611b42565b5f5f5f5f6004353403335ff115612352575b60206123a05f395f51631d046325604052803b15612352575f60406004605c600435855af1611b73573d5f5f3e3d5ffd5b5060035f5500611de2565b63a32997718118611de257608436103417612352576004358060a01c612352576040526001600354016060526060516003556001600454016080526080516004557fc72b917679ae2dea3062a0a355d542c92296f3e5c39cfcb0db7c30e28c8163493360a05260405160c0526060602460e037608051610140526060516101605260e060a0a100611de2565b630b14c5458118611cc957606436103417612352576004358060a01c61235257604052602435600401610400813511612352576020813501808260603750506020806108a0526040515a6060506104006104a060605160808585fa90509050611c75573d5f5f3e3d5ffd5b3d61040081183d61040010021861048052610480816108a00160208251018082828560045afa50508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506108a0f35b631de26e168118611de2576043361115612352575f546002146123525760025f553460243511611d5c57346024351815611d6e5760146040527f496e73756666696369656e74206465706f73697400000000000000000000000060605260405060405180606001601f825f031636823750506308c379a05f526020602052601f19601f6040510116604401601cfd611d6e565b5f5f5f5f3460243503335ff115612352575b60206123a05f395f5163b214faa5604052600435606052803b15612352575f60406024605c602435855af1611da5573d5f5f3e3d5ffd5b507f4f78bbd9a86543dc57c484da46f56d43190ac1148b43565fa8d522b1d4fe52986004356040523360605260243560805260606040a160035f55005b5f5ffd5b63aaaaaaaa6040511015611e505760126060527f496e73756666696369656e7420506f776572000000000000000000000000000060805260605060605180608001601f825f031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b565b5f601c610100527f19457468657265756d205369676e6564204d6573736167653a0a333200000000610120526101008051602082018361016001815181525050808301925050506060518161016001526020810190508061014052610140905080516020820120905060e0525f6101805260e051610100526080516101205260a0516101405260c051610160526020610180608061010060015afa506101805160405114815250565b604036617f40375f6134005160c8811161235257801561204557905b60608102613420018051617f80526020810151617fa0526040810151617fc05250617f80511561202f57617f40516101a0518110156123525760051b6101c00151604052617f2051606052617f8051608052617fa05160a052617fc05160c052611f82617fe0611e52565b617fe051611fef576011618000527f496e76616c6964205369676e61747572650000000000000000000000000000006180205261800050618000518061802001601f825f031636823750506308c379a0617fc0526020617fe052601f19601f618000510116604401617fdcfd5b617f6051617f4051611ac0518110156123525760051b611ae001518082018281106123525790509050617f605263aaaaaaaa617f60511061202f57612045565b6001617f405101617f4052600101818118611f17575b5050617f6051604052612056611de6565b565b63299018c26132a45260046080806132c452806132c4015f6040518083528060051b5f8260c881116123525780156120a957905b8060051b606001518160051b60208801015260010181811861208c575b50508201602001915050905081019050806132e452806132c4015f611960518083528060051b5f8260c881116123525780156120ff57905b8060051b61198001518160051b6020880101526001018181186120e1575b505082016020019150509050810190506132805161330452602061238061332439016132a0526132a0805160208201209050815250565b6040515a10156121c05760286060527f496e73756666696369656e742066756e647320746f20636f76657220676173206080527f657374696d61746500000000000000000000000000000000000000000000000060a05260605060605180608001601f825f031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b565b6040514211156122285760076060527f54696d656f75740000000000000000000000000000000000000000000000000060805260605060605180608001601f825f031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b565b60e051604052612238612136565b60206123a05f395f5163d4bbab4f6101005260c0516101205260e05161014052803b15612352575f610100604461011c5f855af1612278573d5f5f3e3d5ffd5b50565b60405160015418156122e35760146060527f496e636f727265637420436865636b706f696e7400000000000000000000000060805260605060605180608001601f825f031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b565b60016004540160a05260a05160045560016003540160c05260c0516003557fc5bdbcfcfae5c5b84c56bbf0860c4286d627aefaf28ce4011ba4fcb9b5aadf0860405160e0523361010052606051610120526080516101405260a0516101605260c0516101805260c060e0a1565b5f80fd1de214de1de21b7e037906a80e6d1de2001803190a801de21c0a1230033903591de21de20abe03991de28419238081182a1840a16576797065728300030a0016 \ No newline at end of file diff --git a/x/evm/keeper/testdata/slc-tx-data.hex b/x/evm/keeper/testdata/slc-tx-data.hex index 61dd4bee..482367f0 100644 --- a/x/evm/keeper/testdata/slc-tx-data.hex +++ b/x/evm/keeper/testdata/slc-tx-data.hex @@ -1 +1 @@ -1029ae6f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000007b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051eca2efb15afacc612278c71f5edb35986f172f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001aa00000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file +a930e8dc000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028e9e9bfeded29747fcc33cca25b4b75f05e434b00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051eca2efb15afacc612278c71f5edb35986f172f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001aa00000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/x/evm/keeper/testdata/usc-abi.json b/x/evm/keeper/testdata/usc-abi.json new file mode 100644 index 00000000..bea4765a --- /dev/null +++ b/x/evm/keeper/testdata/usc-abi.json @@ -0,0 +1,546 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "checkpoint", + "type": "bytes32" + }, + { + "indexed": false, + "name": "valset_id", + "type": "uint256" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "ValsetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "logic_contract_address", + "type": "address" + }, + { + "indexed": false, + "name": "payload", + "type": "bytes" + }, + { + "indexed": false, + "name": "message_id", + "type": "uint256" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "LogicCallEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "token", + "type": "address" + }, + { + "indexed": false, + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "name": "receiver", + "type": "string" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "SendToPalomaEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "token", + "type": "address" + }, + { + "indexed": false, + "name": "batch_id", + "type": "uint256" + }, + { + "indexed": false, + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "BatchSendEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "paloma_denom", + "type": "string" + }, + { + "indexed": false, + "name": "token_contract", + "type": "address" + }, + { + "indexed": false, + "name": "name", + "type": "string" + }, + { + "indexed": false, + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "name": "decimals", + "type": "uint8" + }, + { + "indexed": false, + "name": "event_id", + "type": "uint256" + } + ], + "name": "ERC20DeployedEvent", + "type": "event" + }, + { + "inputs": [ + { + "name": "_compass_id", + "type": "bytes32" + }, + { + "name": "_event_id", + "type": "uint256" + }, + { + "name": "_skyway_nonce", + "type": "uint256" + }, + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + }, + { + "components": [ + { + "name": "v", + "type": "uint256" + }, + { + "name": "r", + "type": "uint256" + }, + { + "name": "s", + "type": "uint256" + } + ], + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "consensus", + "type": "tuple" + }, + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "new_valset", + "type": "tuple" + } + ], + "name": "update_valset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + }, + { + "components": [ + { + "name": "v", + "type": "uint256" + }, + { + "name": "r", + "type": "uint256" + }, + { + "name": "s", + "type": "uint256" + } + ], + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "consensus", + "type": "tuple" + }, + { + "components": [ + { + "name": "logic_contract_address", + "type": "address" + }, + { + "name": "payload", + "type": "bytes" + } + ], + "name": "args", + "type": "tuple" + }, + { + "name": "message_id", + "type": "uint256" + }, + { + "name": "deadline", + "type": "uint256" + } + ], + "name": "submit_logic_call", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "token", + "type": "address" + }, + { + "name": "receiver", + "type": "string" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "send_token_to_paloma", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "name": "validators", + "type": "address[]" + }, + { + "name": "powers", + "type": "uint256[]" + }, + { + "name": "valset_id", + "type": "uint256" + } + ], + "name": "valset", + "type": "tuple" + }, + { + "components": [ + { + "name": "v", + "type": "uint256" + }, + { + "name": "r", + "type": "uint256" + }, + { + "name": "s", + "type": "uint256" + } + ], + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "consensus", + "type": "tuple" + }, + { + "name": "token", + "type": "address" + }, + { + "components": [ + { + "name": "receiver", + "type": "address[]" + }, + { + "name": "amount", + "type": "uint256[]" + } + ], + "name": "args", + "type": "tuple" + }, + { + "name": "batch_id", + "type": "uint256" + }, + { + "name": "deadline", + "type": "uint256" + } + ], + "name": "submit_batch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "_paloma_denom", + "type": "string" + }, + { + "name": "_name", + "type": "string" + }, + { + "name": "_symbol", + "type": "string" + }, + { + "name": "_decimals", + "type": "uint8" + }, + { + "name": "_blueprint", + "type": "address" + } + ], + "name": "deploy_erc20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "compass_id", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last_checkpoint", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last_valset_id", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last_event_id", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last_skyway_nonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "name": "last_batch_id", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "name": "message_id_used", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/x/evm/keeper/testdata/usc-bytecode.out b/x/evm/keeper/testdata/usc-bytecode.out new file mode 100644 index 00000000..859f5ee8 --- /dev/null +++ b/x/evm/keeper/testdata/usc-bytecode.out @@ -0,0 +1 @@ +0x60206110e16000396000516020816110c10160003960005181016101406020826110c101600039600051116110bc576020816110c1016000396000518060405260008161014081116110bc57801561008357905b60206020820260208601016110c1016000396000518060a01c6110bc576020820260600152600101818118610053575b505050506020602082016110c10160003960005181016101406020826110c101600039600051116110bc576020816110c1016000396000518061286052602082016020820280826110c10161288039505050506020604082016110c101600039600051615080525060206110c1600039600051630000f300526040366150a037600060405161014081116110bc57801561018c57905b60208102606001516150e0526150a05160206150c051612860518110156110bc5702612880015181818301106110bc57808201905090506150a05263aaaaaaaa6150a051106101675761018c565b6150c051600181818301106110bc57808201905090506150c052600101818118610119575b505063aaaaaaaa6150a05110156102035760126150e0527f496e73756666696369656e7420506f7765720000000000000000000000000000615100526150e0506150e051806151000181600003601f1636823750506308c379a06150a05260206150c052601f19601f6150e05101166044016150bcfd5b63299018c261a20452600460808061a224528061a2240160006040518083526020810260008261014081116110bc57801561025757905b60208102606001516020820260208801015260010181811861023a575b505082016020019150509050810190508061a244528061a224016000612860518083526020810260008261014081116110bc5780156102b057905b60208102612880015160208202602088010152600101818118610292575b505082016020019150509050810190506150805161a2645260206110c160003960005161a284520161a2005261a2008051602082012090506150e0526150e0516000557f09d40458cf931745f8d532ef13fa9c74bfb7fe0edcee88e0a677b0cbef88f0f96150e0516151005261508051615120526040615100a1610d78610343630000e58839610d78602001630000e588f3600436101561000d57610a07565b60003560e01c34610d735763f0f405048118610037576020610d7860003960005160405260206040f35b63eadf4af78118610513576004356004018035810180358101610140813511610d735780358061f2a0526000816101408111610d7357801561009b57905b602081026020850101358060a01c610d73576020820261f2c00152600101818118610075575b5050505060208101358101610140813511610d735780358062011ac0526020820160208202808262011ae037505050506040810135620142e0525060208101358101610140813511610d73578035806201430052602082016060820280826201432037505050505060243560040180358101610140813511610d73578035806201bb20526000816101408111610d7357801561015a57905b602081026020850101358060a01c610d7357602082026201bb400152600101818118610133575b5050505060208101358101610140813511610d73578035806201e34052602082016020820280826201e3603750505050604081013562020b605250620142e05162020b60511161021357601162020b80527f496e76616c69642056616c73657420494400000000000000000000000000000062020ba05262020b805062020b80518062020ba00181600003601f1636823750506308c379a062020b4052602062020b6052601f19601f62020b8051011660440162020b5cfd5b60403662020b803760006201bb20516101408111610d735780156102b157905b602081026201bb40015162020bc05262020b8051602062020ba0516201e34051811015610d7357026201e36001518181830110610d73578082019050905062020b805263aaaaaaaa62020b80511061028a576102b1565b62020ba05160018181830110610d73578082019050905062020ba052600101818118610233575b505063aaaaaaaa62020b8051101561033257601262020bc0527f496e73756666696369656e7420506f776572000000000000000000000000000062020be05262020bc05062020bc0518062020be00181600003601f1636823750506308c379a062020b8052602062020ba052601f19601f62020bc051011660440162020b9cfd5b61f2a05180604052602081028060608261f2c060045afa9050505062011ac051806128605260208102806128808262011ae060045afa90505050620142e0516150805261038162020bc0610c89565b62020bc051600054146103fd57601462020be0527f496e636f727265637420436865636b706f696e7400000000000000000000000062020c005262020be05062020be0518062020c000181600003601f1636823750506308c379a062020ba052602062020bc052601f19601f62020be051011660440162020bbcfd5b6201bb20518060405260208102806060826201bb4060045afa905050506201e3405180612860526020810280612880826201e36060045afa9050505062020b60516150805261044e62020be0610c89565b62020be05162020bc05261f2a051806102405260208102806102608261f2c060045afa9050505062011ac05180612a60526020810280612a808262011ae060045afa90505050620142e051615280526201430051806152a05260608102806152c0826201432060045afa9050505062020bc05161cac0526104cd610ab0565b62020bc0516000557f09d40458cf931745f8d532ef13fa9c74bfb7fe0edcee88e0a677b0cbef88f0f962020bc05162020be05262020b605162020c0052604062020be0a1005b631029ae6f81186109c9576004356004018035810180358101610140813511610d735780358061f2a0526000816101408111610d7357801561057757905b602081026020850101358060a01c610d73576020820261f2c00152600101818118610551575b5050505060208101358101610140813511610d735780358062011ac0526020820160208202808262011ae037505050506040810135620142e0525060208101358101610140813511610d73578035806201430052602082016060820280826201432037505050505060243560040180358060a01c610d73576201bb205260208101358101615000813511610d73578035806201bb40526020820181816201bb60375050505060643542111561069557600762020b60527f54696d656f75740000000000000000000000000000000000000000000000000062020b805262020b605062020b60518062020b800181600003601f1636823750506308c379a062020b2052602062020b4052601f19601f62020b6051011660440162020b3cfd5b60016044356020526000526040600020541561071a57600f62020b60527f55736564204d6573736167655f4944000000000000000000000000000000000062020b805262020b605062020b60518062020b800181600003601f1636823750506308c379a062020b2052602062020b4052601f19601f62020b6051011660440162020b3cfd5b6001600160443560205260005260406000205561f2a05180604052602081028060608261f2c060045afa9050505062011ac051806128605260208102806128808262011ae060045afa90505050620142e0516150805261077c62020b60610c89565b62020b6051600054146107f857601462020b80527f496e636f727265637420436865636b706f696e7400000000000000000000000062020ba05262020b805062020b80518062020ba00181600003601f1636823750506308c379a062020b4052602062020b6052601f19601f62020b8051011660440162020b5cfd5b63980721b262025ca452600460808062025cc4528062025cc40160406201bb205182528060208301528082016201bb4051808252602082018181836201bb6060045afa90505050805180602083010181600003601f163682375050601f19601f8251602001011690508101905090508101905060443562025ce4526020610d7860003960005162025d045260643562025d24520162025ca05262025ca080516020820120905062020b605261f2a051806102405260208102806102608261f2c060045afa9050505062011ac05180612a60526020810280612a808262011ae060045afa90505050620142e051615280526201430051806152a05260608102806152c0826201432060045afa9050505062020b605161cac052610918610ab0565b6201bb406000600082516020840160006201bb20515af19050610940573d600060003e3d6000fd5b7f0d2bd340033bb64fd086788e6685b480a9bf10b98d63e9b8073eb5d0bd6c6ee960606201bb205162020b80528062020ba0528062020b80016201bb4051808252602082018181836201bb6060045afa90505050805180602083010181600003601f163682375050601f19601f8251602001011690508101905060443562020bc05262020b80a1005b63a9a4a98381186109e05760005460405260206040f35b6338d6172d8118610a0557600160043560205260005260406000205460405260206040f35b505b60006000fd5b6000601c6101a0527f19457468657265756d205369676e6564204d6573736167653a0a3332000000006101c0526101a0805160208201836102000181518152505080830192505050606051816102000152602081019050806101e0526101e0905080516020820120905060e05260e051610100526080516101205260a0516101405260c0516101605260206000608061010060015afa5060005160405114815250565b60403661cae03760006152a0516101408111610d73578015610c1057905b606081026152c001805161cb2052602081015161cb4052604081015161cb605250600061cb205114610beb57602061cae05161024051811015610d735702610260015160405261cac05160605261cb205160805261cb405160a05261cb605160c052610b3b61cb80610a0d565b61cb8051610ba957601161cba0527f496e76616c6964205369676e617475726500000000000000000000000000000061cbc05261cba05061cba0518061cbc00181600003601f1636823750506308c379a061cb6052602061cb8052601f19601f61cba051011660440161cb7cfd5b61cb0051602061cae051612a6051811015610d735702612a8001518181830110610d73578082019050905061cb005263aaaaaaaa61cb005110610beb57610c10565b61cae05160018181830110610d73578082019050905061cae052600101818118610ace575b505063aaaaaaaa61cb00511015610c8757601261cb20527f496e73756666696369656e7420506f776572000000000000000000000000000061cb405261cb205061cb20518061cb400181600003601f1636823750506308c379a061cae052602061cb0052601f19601f61cb2051011660440161cafcfd5b565b63299018c261a1a452600460808061a1c4528061a1c4016000604051808352602081026000826101408111610d73578015610cdd57905b602081026060015160208202602088010152600101818118610cc0575b505082016020019150509050810190508061a1e4528061a1c401600061286051808352602081026000826101408111610d73578015610d3657905b60208102612880015160208202602088010152600101818118610d18575b505082016020019150509050810190506150805161a204526020610d7860003960005161a224520161a1a05261a1a0805160208201209050815250565b600080fd005b600080fd31373737000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000590000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e4ab6f4d62ba7e0bbc4cf6c5e8153e105108fba900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000100000000 \ No newline at end of file diff --git a/x/evm/keeper/testdata/sample-tx-raw.hex b/x/evm/keeper/testdata/usc-tx-raw.hex similarity index 100% rename from x/evm/keeper/testdata/sample-tx-raw.hex rename to x/evm/keeper/testdata/usc-tx-raw.hex diff --git a/x/evm/keeper/testdata/valset-tx-data.hex b/x/evm/keeper/testdata/valset-tx-data.hex index 30eeab25..a93cd20c 100644 --- a/x/evm/keeper/testdata/valset-tx-data.hex +++ b/x/evm/keeper/testdata/valset-tx-data.hex @@ -1 +1 @@ -eadf4af70000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000005 \ No newline at end of file +f064acb2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000028e9e9bfeded29747fcc33cca25b4b75f05e434b00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000add0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000005 \ No newline at end of file diff --git a/x/evm/types/chain_info.pb.go b/x/evm/types/chain_info.pb.go index f2ad2838..ac8b971d 100644 --- a/x/evm/types/chain_info.pb.go +++ b/x/evm/types/chain_info.pb.go @@ -5,17 +5,20 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -132,6 +135,7 @@ type ChainInfo struct { ActiveSmartContractID uint64 `protobuf:"varint,11,opt,name=activeSmartContractID,proto3" json:"activeSmartContractID,omitempty"` MinOnChainBalance string `protobuf:"bytes,12,opt,name=minOnChainBalance,proto3" json:"minOnChainBalance,omitempty"` RelayWeights *RelayWeights `protobuf:"bytes,13,opt,name=relayWeights,proto3" json:"relayWeights,omitempty"` + FeeManagerAddr string `protobuf:"bytes,14,opt,name=feeManagerAddr,proto3" json:"feeManagerAddr,omitempty"` } func (m *ChainInfo) Reset() { *m = ChainInfo{} } @@ -140,9 +144,11 @@ func (*ChainInfo) ProtoMessage() {} func (*ChainInfo) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{0} } + func (m *ChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ChainInfo.Marshal(b, m, deterministic) @@ -155,12 +161,15 @@ func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } + func (m *ChainInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_ChainInfo.Merge(m, src) } + func (m *ChainInfo) XXX_Size() int { return m.Size() } + func (m *ChainInfo) XXX_DiscardUnknown() { xxx_messageInfo_ChainInfo.DiscardUnknown(m) } @@ -265,6 +274,13 @@ func (m *ChainInfo) GetRelayWeights() *RelayWeights { return nil } +func (m *ChainInfo) GetFeeManagerAddr() string { + if m != nil { + return m.FeeManagerAddr + } + return "" +} + type SmartContract struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AbiJSON string `protobuf:"bytes,2,opt,name=abiJSON,proto3" json:"abiJSON,omitempty"` @@ -277,9 +293,11 @@ func (*SmartContract) ProtoMessage() {} func (*SmartContract) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{1} } + func (m *SmartContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *SmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContract.Marshal(b, m, deterministic) @@ -292,12 +310,15 @@ func (m *SmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } + func (m *SmartContract) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContract.Merge(m, src) } + func (m *SmartContract) XXX_Size() int { return m.Size() } + func (m *SmartContract) XXX_DiscardUnknown() { xxx_messageInfo_SmartContract.DiscardUnknown(m) } @@ -352,9 +373,11 @@ func (*SmartContractDeployment) ProtoMessage() {} func (*SmartContractDeployment) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{2} } + func (m *SmartContractDeployment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *SmartContractDeployment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContractDeployment.Marshal(b, m, deterministic) @@ -367,12 +390,15 @@ func (m *SmartContractDeployment) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } + func (m *SmartContractDeployment) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContractDeployment.Merge(m, src) } + func (m *SmartContractDeployment) XXX_Size() int { return m.Size() } + func (m *SmartContractDeployment) XXX_DiscardUnknown() { xxx_messageInfo_SmartContractDeployment.DiscardUnknown(m) } @@ -439,9 +465,11 @@ func (*SmartContractDeployment_ERC20Transfer) ProtoMessage() {} func (*SmartContractDeployment_ERC20Transfer) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{2, 0} } + func (m *SmartContractDeployment_ERC20Transfer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *SmartContractDeployment_ERC20Transfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContractDeployment_ERC20Transfer.Marshal(b, m, deterministic) @@ -454,12 +482,15 @@ func (m *SmartContractDeployment_ERC20Transfer) XXX_Marshal(b []byte, determinis return b[:n], nil } } + func (m *SmartContractDeployment_ERC20Transfer) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContractDeployment_ERC20Transfer.Merge(m, src) } + func (m *SmartContractDeployment_ERC20Transfer) XXX_Size() int { return m.Size() } + func (m *SmartContractDeployment_ERC20Transfer) XXX_DiscardUnknown() { xxx_messageInfo_SmartContractDeployment_ERC20Transfer.DiscardUnknown(m) } @@ -509,55 +540,57 @@ func init() { } var fileDescriptor_61bfdb7d30bf7e88 = []byte{ - // 765 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x8e, 0xe2, 0x46, - 0x14, 0xc5, 0xe6, 0x7d, 0x69, 0xba, 0x9d, 0x12, 0xc9, 0x94, 0x58, 0x10, 0x84, 0x46, 0x1a, 0x67, - 0x14, 0x99, 0x11, 0x89, 0xa2, 0x6c, 0xa2, 0x84, 0x87, 0x69, 0x9c, 0xb4, 0x0c, 0x2a, 0x98, 0x69, - 0x29, 0x8a, 0x64, 0x19, 0x53, 0x80, 0x35, 0xd8, 0x26, 0x76, 0xd1, 0x13, 0xbe, 0x22, 0xf9, 0x91, - 0x2c, 0xf3, 0x0f, 0xb3, 0x9c, 0xe5, 0xac, 0xa2, 0xa8, 0xfb, 0x47, 0x22, 0x97, 0x69, 0xd4, 0x36, - 0x66, 0x11, 0x65, 0x77, 0x5f, 0x3e, 0xf7, 0xd6, 0xa9, 0x73, 0x5d, 0xf0, 0x62, 0x6b, 0x6e, 0x3c, - 0xc7, 0xb4, 0xd6, 0xa6, 0xed, 0xb6, 0x23, 0xbb, 0x4d, 0xef, 0x9c, 0x36, 0x0f, 0x18, 0xb6, 0xbb, - 0xf4, 0x94, 0xad, 0xef, 0x31, 0x0f, 0x7d, 0xf6, 0xa4, 0x50, 0x89, 0x6c, 0x85, 0xde, 0x39, 0xf5, - 0x97, 0x67, 0x00, 0x7c, 0xba, 0x31, 0xf7, 0xc6, 0x3b, 0x6a, 0xaf, 0xd6, 0x2c, 0x88, 0x30, 0xea, - 0xb5, 0x95, 0xb7, 0xf2, 0xb8, 0xd9, 0x0e, 0xad, 0x28, 0xda, 0xfa, 0x2b, 0x0f, 0xe5, 0x7e, 0xf8, - 0xb9, 0xe6, 0x2e, 0x3d, 0x74, 0x05, 0xa2, 0xbd, 0xc0, 0xbf, 0xeb, 0x4d, 0x41, 0xce, 0x11, 0xd1, - 0x5e, 0xa0, 0x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 0xf3, 0xf3, 0x17, 0x2b, 0x9b, 0xad, 0x77, 0x73, 0xc5, 0xf2, 0x9c, 0x76, - 0xca, 0x2b, 0xf1, 0x1b, 0x7f, 0x27, 0xd8, 0x7e, 0x4b, 0x83, 0x79, 0x81, 0x3f, 0x05, 0x5f, 0xfd, - 0x1b, 0x00, 0x00, 0xff, 0xff, 0x30, 0x02, 0x23, 0x6c, 0x8f, 0x06, 0x00, 0x00, + // 785 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xd1, 0x6e, 0xe2, 0x46, + 0x14, 0xc5, 0x0e, 0x90, 0x70, 0x49, 0x88, 0x3b, 0x4a, 0xbb, 0x23, 0x1e, 0x28, 0x42, 0xab, 0xae, + 0xbb, 0xaa, 0xcc, 0x8a, 0x56, 0x55, 0x5f, 0xaa, 0x96, 0x80, 0x93, 0xb8, 0x4d, 0x4d, 0x34, 0xb0, + 0x1b, 0xa9, 0xaa, 0x64, 0x0d, 0x66, 0x20, 0xd6, 0xe2, 0x31, 0xb5, 0x87, 0x6c, 0xf9, 0x8a, 0xf6, + 0x47, 0xfa, 0x1f, 0xfb, 0xb8, 0x8f, 0x79, 0x69, 0x55, 0x25, 0x3f, 0x52, 0x79, 0x4c, 0x50, 0x6c, + 0xcc, 0x43, 0xd5, 0xb7, 0xb9, 0xe7, 0x5e, 0x9f, 0x3b, 0x73, 0xee, 0x19, 0x0f, 0xbc, 0x58, 0xd0, + 0x79, 0xe0, 0x53, 0xf7, 0x86, 0x7a, 0xbc, 0x9d, 0xac, 0xdb, 0xec, 0xd6, 0x6f, 0x4b, 0xc0, 0xf1, + 0xf8, 0x34, 0x30, 0x16, 0x61, 0x20, 0x02, 0xf4, 0xc9, 0x93, 0x42, 0x23, 0x59, 0x1b, 0xec, 0xd6, + 0xaf, 0xbf, 0xdc, 0x41, 0x10, 0xb2, 0x39, 0x5d, 0x39, 0xef, 0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08, 0x2a, 0x96, 0xed, + 0x9c, 0x5d, 0x5a, 0xe7, 0x17, 0x23, 0x4d, 0x41, 0x3a, 0x3c, 0x4f, 0xd9, 0x3e, 0x6e, 0xed, 0x0c, + 0xae, 0x6d, 0x93, 0x0c, 0x2f, 0xac, 0x2b, 0x67, 0x44, 0xba, 0xf6, 0xf0, 0xcc, 0x24, 0x9a, 0x7a, + 0xda, 0x7b, 0x7f, 0xdf, 0x50, 0x3e, 0xdc, 0x37, 0x94, 0x7f, 0xee, 0x1b, 0xca, 0x1f, 0x0f, 0x8d, + 0xc2, 0x87, 0x87, 0x46, 0xe1, 0xee, 0xa1, 0x51, 0xf8, 0xf9, 0xf3, 0x99, 0x27, 0x6e, 0x96, 0x63, + 0xc3, 0x0d, 0xfc, 0x76, 0xce, 0x6b, 0xf2, 0x9b, 0x7c, 0x4f, 0xc4, 0x6a, 0xc1, 0xa2, 0x71, 0x59, + 0x3e, 0x19, 0x5f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x33, 0x15, 0x21, 0x2e, 0xb7, 0x06, 0x00, + 0x00, } func (m *ChainInfo) Marshal() (dAtA []byte, err error) { @@ -589,6 +622,13 @@ func (m *ChainInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0xf8 } + if len(m.FeeManagerAddr) > 0 { + i -= len(m.FeeManagerAddr) + copy(dAtA[i:], m.FeeManagerAddr) + i = encodeVarintChainInfo(dAtA, i, uint64(len(m.FeeManagerAddr))) + i-- + dAtA[i] = 0x72 + } if m.RelayWeights != nil { { size, err := m.RelayWeights.MarshalToSizedBuffer(dAtA[:i]) @@ -848,6 +888,7 @@ func encodeVarintChainInfo(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *ChainInfo) Size() (n int) { if m == nil { return 0 @@ -902,6 +943,10 @@ func (m *ChainInfo) Size() (n int) { l = m.RelayWeights.Size() n += 1 + l + sovChainInfo(uint64(l)) } + l = len(m.FeeManagerAddr) + if l > 0 { + n += 1 + l + sovChainInfo(uint64(l)) + } if m.Id != 0 { n += 3 + sovChainInfo(uint64(m.Id)) } @@ -987,9 +1032,11 @@ func (m *SmartContractDeployment_ERC20Transfer) Size() (n int) { func sovChainInfo(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozChainInfo(x uint64) (n int) { return sovChainInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *ChainInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1393,6 +1440,38 @@ func (m *ChainInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeManagerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeManagerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 9999: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) @@ -1433,6 +1512,7 @@ func (m *ChainInfo) Unmarshal(dAtA []byte) error { } return nil } + func (m *SmartContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1568,6 +1648,7 @@ func (m *SmartContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *SmartContractDeployment) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1788,6 +1869,7 @@ func (m *SmartContractDeployment) Unmarshal(dAtA []byte) error { } return nil } + func (m *SmartContractDeployment_ERC20Transfer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1940,6 +2022,7 @@ func (m *SmartContractDeployment_ERC20Transfer) Unmarshal(dAtA []byte) error { } return nil } + func skipChainInfo(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/codec.go b/x/evm/types/codec.go index df5858b3..c85c369b 100644 --- a/x/evm/types/codec.go +++ b/x/evm/types/codec.go @@ -14,6 +14,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeployNewSmartContractRequest{}, "evm/DeployNewSmartContract", nil) cdc.RegisterConcrete(&MsgRemoveSmartContractDeploymentRequest{}, "evm/DeleteSmartContractDeployment", nil) cdc.RegisterConcrete(&RelayWeightsProposal{}, "evm/RelayWeightsProposal", nil) + cdc.RegisterConcrete(&SetFeeManagerAddressProposal{}, "evm/SetFeeManagerAddressProposal", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -29,6 +30,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &DeployNewSmartContractProposal{}, &ChangeMinOnChainBalanceProposal{}, &RelayWeightsProposal{}, + &SetFeeManagerAddressProposal{}, ) registry.RegisterImplementations( (*consensustypes.ConsensusMsg)(nil), diff --git a/x/evm/types/eth_txable.go b/x/evm/types/eth_txable.go index 4bd69751..5b85df16 100644 --- a/x/evm/types/eth_txable.go +++ b/x/evm/types/eth_txable.go @@ -15,12 +15,20 @@ import ( consensustypes "github.com/palomachain/paloma/x/consensus/types" ) +type FeeArgs struct { + RelayerFee *big.Int + CommunityFee *big.Int + SecurityFee *big.Int + FeePayerPalomaAddress [32]byte +} + func (m *UploadSmartContract) VerifyAgainstTX( ctx context.Context, tx *ethtypes.Transaction, _ consensustypes.QueuedSignedMessageI, _ *Valset, _ *SmartContract, + _ string, ) error { logger := liblog.FromSDKLogger(sdk.UnwrapSDKContext(ctx).Logger()). WithFields("tx_hash", tx.Hash().Hex(), "msg_id", m.Id) @@ -67,6 +75,7 @@ func (m *SubmitLogicCall) VerifyAgainstTX( msg consensustypes.QueuedSignedMessageI, valset *Valset, compass *SmartContract, + relayer string, ) error { logger := liblog.FromSDKLogger(sdk.UnwrapSDKContext(ctx).Logger()). WithFields("tx_hash", tx.Hash().Hex(), "valset_id", valset.ValsetID) @@ -85,6 +94,16 @@ func (m *SubmitLogicCall) VerifyAgainstTX( return err } + padding := bytes.Repeat([]byte{0}, 32-len(m.SenderAddress)) + paddedSenderAddress := [32]byte(append(padding, m.SenderAddress...)) + + feeArgs := FeeArgs{ + RelayerFee: big.NewInt(0).SetUint64(m.Fees.RelayerFee), + CommunityFee: big.NewInt(0).SetUint64(m.Fees.CommunityFee), + SecurityFee: big.NewInt(0).SetUint64(m.Fees.SecurityFee), + FeePayerPalomaAddress: paddedSenderAddress, + } + // Since some validators might have added their signature to the message // after a pigeon start relaying it, we iteratively remove the end signature // until we get a match, or there are no more signatures. @@ -95,8 +114,10 @@ func (m *SubmitLogicCall) VerifyAgainstTX( LogicContractAddress: common.HexToAddress(m.GetHexContractAddress()), Payload: m.GetPayload(), }, + feeArgs, new(big.Int).SetInt64(int64(msg.GetId())), new(big.Int).SetInt64(m.GetDeadline()), + common.HexToAddress(relayer), } input, err := contractABI.Pack("submit_logic_call", args...) @@ -121,6 +142,7 @@ func (m *UpdateValset) VerifyAgainstTX( msg consensustypes.QueuedSignedMessageI, valset *Valset, compass *SmartContract, + relayer string, ) error { logger := liblog.FromSDKLogger(sdk.UnwrapSDKContext(ctx).Logger()). WithFields("tx_hash", tx.Hash().Hex(), @@ -148,6 +170,8 @@ func (m *UpdateValset) VerifyAgainstTX( args := []any{ BuildCompassConsensus(valset, msg.GetSignData()[0:i]), TransformValsetToCompassValset(m.Valset), + common.HexToAddress(relayer), + big.NewInt(0).SetUint64(msg.GetGasEstimate()), } input, err := contractABI.Pack("update_valset", args...) diff --git a/x/evm/types/genesis.pb.go b/x/evm/types/genesis.pb.go index 9cbbef2b..827e7463 100644 --- a/x/evm/types/genesis.pb.go +++ b/x/evm/types/genesis.pb.go @@ -5,17 +5,20 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -36,9 +39,11 @@ func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_a36103825ee62903, []int{0} } + func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) @@ -51,12 +56,15 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *GenesisState) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisState.Merge(m, src) } + func (m *GenesisState) XXX_Size() int { return m.Size() } + func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } @@ -91,6 +99,7 @@ type GenesisChainInfo struct { BlockHashAtHeight string `protobuf:"bytes,4,opt,name=blockHashAtHeight,proto3" json:"blockHashAtHeight,omitempty"` MinOnChainBalance string `protobuf:"bytes,5,opt,name=minOnChainBalance,proto3" json:"minOnChainBalance,omitempty"` RelayWeights *RelayWeights `protobuf:"bytes,6,opt,name=relayWeights,proto3" json:"relayWeights,omitempty"` + FeeManagerAddr string `protobuf:"bytes,7,opt,name=feeManagerAddr,proto3" json:"feeManagerAddr,omitempty"` } func (m *GenesisChainInfo) Reset() { *m = GenesisChainInfo{} } @@ -99,9 +108,11 @@ func (*GenesisChainInfo) ProtoMessage() {} func (*GenesisChainInfo) Descriptor() ([]byte, []int) { return fileDescriptor_a36103825ee62903, []int{1} } + func (m *GenesisChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *GenesisChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisChainInfo.Marshal(b, m, deterministic) @@ -114,12 +125,15 @@ func (m *GenesisChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } + func (m *GenesisChainInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisChainInfo.Merge(m, src) } + func (m *GenesisChainInfo) XXX_Size() int { return m.Size() } + func (m *GenesisChainInfo) XXX_DiscardUnknown() { xxx_messageInfo_GenesisChainInfo.DiscardUnknown(m) } @@ -168,6 +182,13 @@ func (m *GenesisChainInfo) GetRelayWeights() *RelayWeights { return nil } +func (m *GenesisChainInfo) GetFeeManagerAddr() string { + if m != nil { + return m.FeeManagerAddr + } + return "" +} + type GenesisSmartContract struct { AbiJson string `protobuf:"bytes,1,opt,name=abiJson,proto3" json:"abiJson,omitempty"` BytecodeHex string `protobuf:"bytes,2,opt,name=bytecodeHex,proto3" json:"bytecodeHex,omitempty"` @@ -179,9 +200,11 @@ func (*GenesisSmartContract) ProtoMessage() {} func (*GenesisSmartContract) Descriptor() ([]byte, []int) { return fileDescriptor_a36103825ee62903, []int{2} } + func (m *GenesisSmartContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *GenesisSmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisSmartContract.Marshal(b, m, deterministic) @@ -194,12 +217,15 @@ func (m *GenesisSmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } + func (m *GenesisSmartContract) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisSmartContract.Merge(m, src) } + func (m *GenesisSmartContract) XXX_Size() int { return m.Size() } + func (m *GenesisSmartContract) XXX_DiscardUnknown() { xxx_messageInfo_GenesisSmartContract.DiscardUnknown(m) } @@ -231,34 +257,35 @@ func init() { } var fileDescriptor_a36103825ee62903 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0xaa, 0xd3, 0x40, - 0x14, 0xc7, 0x93, 0xdb, 0x1a, 0xb9, 0xd3, 0x2b, 0x5c, 0x87, 0x8b, 0x84, 0x2e, 0x62, 0xa9, 0x77, - 0x51, 0x2f, 0x97, 0x04, 0xea, 0xd6, 0x85, 0xb6, 0x05, 0x5b, 0x37, 0xca, 0xb8, 0x10, 0xdc, 0xc8, - 0x24, 0x9e, 0x26, 0xc1, 0x64, 0x26, 0x24, 0x63, 0x6d, 0xdf, 0xc2, 0x47, 0xf0, 0x71, 0xba, 0xec, - 0xd2, 0x95, 0x48, 0xfa, 0x22, 0x92, 0x33, 0x29, 0xa4, 0xb6, 0xc1, 0xdd, 0x9c, 0x73, 0x7e, 0xe7, - 0x3f, 0xe7, 0x8b, 0xdc, 0x66, 0x3c, 0x91, 0x29, 0x0f, 0x22, 0x1e, 0x0b, 0x4f, 0xbf, 0x3d, 0x58, - 0xa5, 0x5e, 0x08, 0x02, 0x8a, 0xb8, 0x70, 0xb3, 0x5c, 0x2a, 0x49, 0x9f, 0x34, 0x28, 0x57, 0xbf, - 0x5d, 0x58, 0xa5, 0xfd, 0x9b, 0x50, 0x86, 0x12, 0x11, 0xaf, 0x7a, 0x69, 0xba, 0xff, 0xac, 0x45, - 0x33, 0xe3, 0x39, 0x4f, 0x6b, 0xc9, 0xfe, 0x5d, 0x0b, 0x94, 0x43, 0xc2, 0x37, 0x9f, 0xbf, 0x43, - 0x1c, 0x46, 0xaa, 0x66, 0x87, 0xa5, 0x49, 0xae, 0xde, 0xe8, 0x82, 0x3e, 0x28, 0xae, 0x80, 0xbe, - 0x24, 0x96, 0x16, 0xb3, 0xcd, 0x81, 0x39, 0xea, 0x8d, 0x1d, 0xf7, 0x7c, 0x81, 0xee, 0x7b, 0xa4, - 0x26, 0xdd, 0xed, 0xef, 0xa7, 0x06, 0xab, 0x73, 0x28, 0x23, 0x8f, 0x8a, 0x94, 0xe7, 0x6a, 0x2a, - 0x85, 0xca, 0x79, 0xa0, 0xec, 0x0b, 0x14, 0xb9, 0x6f, 0x13, 0x39, 0x7c, 0xdd, 0xcc, 0x61, 0xc7, - 0x12, 0xf4, 0x15, 0xb1, 0x30, 0xaf, 0xb0, 0x3b, 0x83, 0xce, 0xa8, 0x37, 0x1e, 0xfd, 0x47, 0x6c, - 0x5a, 0xf9, 0x17, 0x62, 0x29, 0x59, 0x9d, 0x37, 0xfc, 0x79, 0x41, 0xae, 0xff, 0x0d, 0xd2, 0x3b, - 0x72, 0x8d, 0x61, 0x06, 0x4b, 0xc8, 0x41, 0x04, 0xb0, 0x98, 0x61, 0xcb, 0x97, 0xec, 0xc4, 0x4f, - 0x6d, 0xf2, 0x10, 0x7d, 0x8b, 0x19, 0x36, 0xd4, 0x65, 0x07, 0x93, 0x0e, 0x48, 0xcf, 0x4f, 0x64, - 0xf0, 0x75, 0x8e, 0x53, 0xb5, 0x3b, 0x18, 0x6d, 0xba, 0xe8, 0x3d, 0x79, 0xac, 0x4d, 0x5e, 0x44, - 0xaf, 0x55, 0xcd, 0x75, 0xf1, 0xa3, 0xd3, 0x40, 0x45, 0xa7, 0xb1, 0x78, 0x27, 0xb0, 0xce, 0x09, - 0x4f, 0xb8, 0x08, 0xc0, 0x7e, 0xa0, 0xe9, 0x93, 0x00, 0x9d, 0x93, 0x2b, 0x5c, 0xea, 0x47, 0xbd, - 0x53, 0xdb, 0xc2, 0x69, 0xdf, 0xb6, 0x0d, 0x88, 0x35, 0x58, 0x76, 0x94, 0x39, 0x64, 0xe4, 0xe6, - 0xdc, 0x2e, 0xaa, 0xce, 0xb9, 0x1f, 0xbf, 0x2d, 0xa4, 0xa8, 0x87, 0x73, 0x30, 0xb1, 0xf3, 0x8d, - 0x82, 0x40, 0x7e, 0x81, 0x39, 0xac, 0x71, 0x2e, 0x97, 0xac, 0xe9, 0x9a, 0x4c, 0xb7, 0xa5, 0x63, - 0xee, 0x4a, 0xc7, 0xfc, 0x53, 0x3a, 0xe6, 0x8f, 0xbd, 0x63, 0xec, 0xf6, 0x8e, 0xf1, 0x6b, 0xef, - 0x18, 0x9f, 0x9e, 0x87, 0xb1, 0x8a, 0xbe, 0xf9, 0x6e, 0x20, 0x53, 0xef, 0xcc, 0xb1, 0xae, 0xf1, - 0x5c, 0xd5, 0x26, 0x83, 0xc2, 0xb7, 0xf0, 0x4e, 0x5f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2f, - 0xa8, 0xd0, 0x2c, 0x4e, 0x03, 0x00, 0x00, + // 442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x9b, 0x90, 0xaa, 0x9b, 0x82, 0xca, 0xaa, 0x42, 0xab, 0x1c, 0x4c, 0x14, 0x2a, 0x14, + 0xaa, 0xca, 0x96, 0xca, 0x95, 0x03, 0x4d, 0x2a, 0x91, 0x20, 0x21, 0xd0, 0x72, 0x40, 0xe2, 0x82, + 0x36, 0xce, 0xc4, 0xb6, 0xb0, 0x77, 0xad, 0xf5, 0x52, 0x9a, 0xbf, 0xe0, 0xb3, 0x72, 0xec, 0x91, + 0x13, 0x42, 0xce, 0x8f, 0x20, 0xcf, 0x3a, 0x92, 0xdb, 0xc4, 0xe2, 0xb6, 0xf3, 0xe6, 0xcd, 0x9b, + 0xd9, 0x37, 0x43, 0xce, 0x32, 0x91, 0xa8, 0x54, 0x04, 0x91, 0x88, 0xa5, 0x6f, 0x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d, 0x8a, 0xae, 0xb2, 0x36, 0x66, 0xeb, 0x10, 0xbd, 0x20, 0x4f, 0x6d, 0x28, 0xf2, 0xe8, + 0xca, 0x54, 0xbc, 0x0e, 0x36, 0xda, 0x4d, 0x94, 0xec, 0x34, 0x96, 0x1f, 0x25, 0xce, 0x39, 0x16, + 0x89, 0x90, 0x01, 0xb0, 0x47, 0x96, 0xbd, 0x93, 0xa0, 0x53, 0x72, 0x8c, 0x4b, 0xfd, 0x62, 0x77, + 0xca, 0xba, 0xe8, 0xf6, 0x59, 0x93, 0x41, 0xbc, 0xc6, 0xe5, 0xf7, 0x2a, 0xe9, 0x4b, 0xf2, 0x64, + 0x09, 0xf0, 0x41, 0x48, 0x11, 0x82, 0xbe, 0x5a, 0x2c, 0x34, 0x3b, 0xc4, 0xa6, 0x0f, 0xd0, 0x21, + 0x27, 0xa7, 0xfb, 0x76, 0x56, 0x3a, 0x24, 0xe6, 0xf1, 0xfb, 0x5c, 0xc9, 0xca, 0xc4, 0x6d, 0x88, + 0x0e, 0xad, 0x0c, 0x04, 0x6a, 0x01, 0x53, 0xb8, 0x45, 0xff, 0x8e, 0x78, 0x1d, 0x1a, 0x4f, 0xd6, + 0x85, 0xeb, 0xdc, 0x15, 0xae, 0xf3, 0xb7, 0x70, 0x9d, 0x5f, 0x1b, 0xb7, 0x75, 0xb7, 0x71, 0x5b, + 0xbf, 0x37, 0x6e, 0xeb, 0xeb, 0xab, 0x30, 0x36, 0xd1, 0x8f, 0xb9, 0x17, 0xa8, 0xd4, 0xdf, 0x73, + 0xd4, 0xb7, 0x78, 0xd6, 0x66, 0x95, 0x41, 0x3e, 0xef, 0xe2, 0x3d, 0xbf, 0xfe, 0x17, 0x00, 0x00, + 0xff, 0xff, 0x38, 0x2a, 0x4f, 0x3c, 0x76, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -340,6 +367,13 @@ func (m *GenesisChainInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FeeManagerAddr) > 0 { + i -= len(m.FeeManagerAddr) + copy(dAtA[i:], m.FeeManagerAddr) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.FeeManagerAddr))) + i-- + dAtA[i] = 0x3a + } if m.RelayWeights != nil { { size, err := m.RelayWeights.MarshalToSizedBuffer(dAtA[:i]) @@ -434,6 +468,7 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *GenesisState) Size() (n int) { if m == nil { return 0 @@ -483,6 +518,10 @@ func (m *GenesisChainInfo) Size() (n int) { l = m.RelayWeights.Size() n += 1 + l + sovGenesis(uint64(l)) } + l = len(m.FeeManagerAddr) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -506,9 +545,11 @@ func (m *GenesisSmartContract) Size() (n int) { func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -662,6 +703,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } + func (m *GenesisChainInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -861,6 +903,38 @@ func (m *GenesisChainInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeManagerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeManagerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -882,6 +956,7 @@ func (m *GenesisChainInfo) Unmarshal(dAtA []byte) error { } return nil } + func (m *GenesisSmartContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -996,6 +1071,7 @@ func (m *GenesisSmartContract) Unmarshal(dAtA []byte) error { } return nil } + func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/gov_proposals.go b/x/evm/types/gov_proposals.go index f50012dd..348fa289 100644 --- a/x/evm/types/gov_proposals.go +++ b/x/evm/types/gov_proposals.go @@ -14,6 +14,7 @@ const ( ProposalDeployNewSmartContract = "EVMDeployNewSmartContract" ProposalTypeChangeMinOnChainBalance = "EVMProposalChangeMinOnChainBalance" ProposalTypeRelayWeights = "EVMProposalRelayWeights" + ProposalTypeSetFeeManagerAddress = "EVMProposalSetFeeManagerAddress" ) var ( @@ -21,6 +22,7 @@ var ( _ govv1beta1types.Content = &RemoveChainProposal{} _ govv1beta1types.Content = &DeployNewSmartContractProposal{} _ govv1beta1types.Content = &RelayWeightsProposal{} + _ govv1beta1types.Content = &SetFeeManagerAddressProposal{} ) func init() { @@ -29,6 +31,7 @@ func init() { govv1beta1types.RegisterProposalType(ProposalDeployNewSmartContract) govv1beta1types.RegisterProposalType(ProposalTypeChangeMinOnChainBalance) govv1beta1types.RegisterProposalType(ProposalTypeRelayWeights) + govv1beta1types.RegisterProposalType(ProposalTypeSetFeeManagerAddress) } func (a *AddChainProposal) ProposalRoute() string { return RouterKey } @@ -90,3 +93,14 @@ func (a *RelayWeightsProposal) ValidateBasic() error { return nil } + +func (a *SetFeeManagerAddressProposal) ProposalRoute() string { return RouterKey } +func (a *SetFeeManagerAddressProposal) ProposalType() string { return ProposalTypeSetFeeManagerAddress } +func (a *SetFeeManagerAddressProposal) GetDescription() string { return a.Summary } +func (a *SetFeeManagerAddressProposal) ValidateBasic() error { + if err := govv1beta1types.ValidateAbstract(a); err != nil { + return err + } + + return nil +} diff --git a/x/evm/types/mocks/MsgSender.go b/x/evm/types/mocks/MsgSender.go index 1c8478f6..19ee9a81 100644 --- a/x/evm/types/mocks/MsgSender.go +++ b/x/evm/types/mocks/MsgSender.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -14,17 +14,17 @@ type MsgSender struct { mock.Mock } -// SendValsetMsgForChain provides a mock function with given fields: ctx, chainInfo, valset, assignee -func (_m *MsgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string) error { - ret := _m.Called(ctx, chainInfo, valset, assignee) +// SendValsetMsgForChain provides a mock function with given fields: ctx, chainInfo, valset, assignee, remoteAddr +func (_m *MsgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string, remoteAddr string) error { + ret := _m.Called(ctx, chainInfo, valset, assignee, remoteAddr) if len(ret) == 0 { panic("no return value specified for SendValsetMsgForChain") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *types.ChainInfo, types.Valset, string) error); ok { - r0 = rf(ctx, chainInfo, valset, assignee) + if rf, ok := ret.Get(0).(func(context.Context, *types.ChainInfo, types.Valset, string, string) error); ok { + r0 = rf(ctx, chainInfo, valset, assignee, remoteAddr) } else { r0 = ret.Error(0) } diff --git a/x/evm/types/msg_sender.go b/x/evm/types/msg_sender.go index 15bf9e35..cfbbc603 100644 --- a/x/evm/types/msg_sender.go +++ b/x/evm/types/msg_sender.go @@ -5,5 +5,5 @@ import "context" //go:generate mockery --name=MsgSender type MsgSender interface { - SendValsetMsgForChain(ctx context.Context, chainInfo *ChainInfo, valset Valset, assignee string) error + SendValsetMsgForChain(ctx context.Context, chainInfo *ChainInfo, valset Valset, assignee, remoteAddr string) error } diff --git a/x/evm/types/set_fee_mgr_proposal.pb.go b/x/evm/types/set_fee_mgr_proposal.pb.go new file mode 100644 index 00000000..b977f4c8 --- /dev/null +++ b/x/evm/types/set_fee_mgr_proposal.pb.go @@ -0,0 +1,486 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: palomachain/paloma/evm/set_fee_mgr_proposal.proto + +package types + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + proto "github.com/cosmos/gogoproto/proto" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type SetFeeManagerAddressProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` + ChainReferenceID string `protobuf:"bytes,3,opt,name=chainReferenceID,proto3" json:"chainReferenceID,omitempty"` + FeeManagerAddress string `protobuf:"bytes,4,opt,name=feeManagerAddress,proto3" json:"feeManagerAddress,omitempty"` +} + +func (m *SetFeeManagerAddressProposal) Reset() { *m = SetFeeManagerAddressProposal{} } +func (m *SetFeeManagerAddressProposal) String() string { return proto.CompactTextString(m) } +func (*SetFeeManagerAddressProposal) ProtoMessage() {} +func (*SetFeeManagerAddressProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_b189b7cf6349646e, []int{0} +} + +func (m *SetFeeManagerAddressProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *SetFeeManagerAddressProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetFeeManagerAddressProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *SetFeeManagerAddressProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFeeManagerAddressProposal.Merge(m, src) +} + +func (m *SetFeeManagerAddressProposal) XXX_Size() int { + return m.Size() +} + +func (m *SetFeeManagerAddressProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SetFeeManagerAddressProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SetFeeManagerAddressProposal proto.InternalMessageInfo + +func (m *SetFeeManagerAddressProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *SetFeeManagerAddressProposal) GetSummary() string { + if m != nil { + return m.Summary + } + return "" +} + +func (m *SetFeeManagerAddressProposal) GetChainReferenceID() string { + if m != nil { + return m.ChainReferenceID + } + return "" +} + +func (m *SetFeeManagerAddressProposal) GetFeeManagerAddress() string { + if m != nil { + return m.FeeManagerAddress + } + return "" +} + +func init() { + proto.RegisterType((*SetFeeManagerAddressProposal)(nil), "palomachain.paloma.evm.SetFeeManagerAddressProposal") +} + +func init() { + proto.RegisterFile("palomachain/paloma/evm/set_fee_mgr_proposal.proto", fileDescriptor_b189b7cf6349646e) +} + +var fileDescriptor_b189b7cf6349646e = []byte{ + // 237 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x2c, 0x48, 0xcc, 0xc9, + 0xcf, 0x4d, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0xb0, 0xf5, 0x53, 0xcb, 0x72, 0xf5, 0x8b, + 0x53, 0x4b, 0xe2, 0xd3, 0x52, 0x53, 0xe3, 0x73, 0xd3, 0x8b, 0xe2, 0x0b, 0x8a, 0xf2, 0x0b, 0xf2, + 0x8b, 0x13, 0x73, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xc4, 0x90, 0xb4, 0xe8, 0x41, 0xd8, + 0x7a, 0xa9, 0x65, 0xb9, 0x4a, 0x2b, 0x18, 0xb9, 0x64, 0x82, 0x53, 0x4b, 0xdc, 0x52, 0x53, 0x7d, + 0x13, 0xf3, 0x12, 0xd3, 0x53, 0x8b, 0x1c, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x03, 0xa0, 0xda, + 0x85, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, + 0x20, 0x1c, 0x21, 0x09, 0x2e, 0xf6, 0xe2, 0xd2, 0xdc, 0xdc, 0xc4, 0xa2, 0x4a, 0x09, 0x26, 0xb0, + 0x38, 0x8c, 0x2b, 0xa4, 0xc5, 0x25, 0x00, 0xb6, 0x24, 0x28, 0x35, 0x2d, 0xb5, 0x28, 0x35, 0x2f, + 0x39, 0xd5, 0xd3, 0x45, 0x82, 0x19, 0xac, 0x04, 0x43, 0x5c, 0x48, 0x87, 0x4b, 0x30, 0x0d, 0xdd, + 0x62, 0x09, 0x16, 0xb0, 0x62, 0x4c, 0x09, 0x27, 0xe7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, + 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, + 0x96, 0x63, 0x88, 0xd2, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xc7, + 0x12, 0x34, 0x15, 0xe0, 0xc0, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x07, 0x87, 0x31, + 0x20, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x34, 0x13, 0x01, 0x43, 0x01, 0x00, 0x00, +} + +func (m *SetFeeManagerAddressProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SetFeeManagerAddressProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetFeeManagerAddressProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeManagerAddress) > 0 { + i -= len(m.FeeManagerAddress) + copy(dAtA[i:], m.FeeManagerAddress) + i = encodeVarintSetFeeMgrProposal(dAtA, i, uint64(len(m.FeeManagerAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.ChainReferenceID) > 0 { + i -= len(m.ChainReferenceID) + copy(dAtA[i:], m.ChainReferenceID) + i = encodeVarintSetFeeMgrProposal(dAtA, i, uint64(len(m.ChainReferenceID))) + i-- + dAtA[i] = 0x1a + } + if len(m.Summary) > 0 { + i -= len(m.Summary) + copy(dAtA[i:], m.Summary) + i = encodeVarintSetFeeMgrProposal(dAtA, i, uint64(len(m.Summary))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintSetFeeMgrProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSetFeeMgrProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovSetFeeMgrProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} + +func (m *SetFeeManagerAddressProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovSetFeeMgrProposal(uint64(l)) + } + l = len(m.Summary) + if l > 0 { + n += 1 + l + sovSetFeeMgrProposal(uint64(l)) + } + l = len(m.ChainReferenceID) + if l > 0 { + n += 1 + l + sovSetFeeMgrProposal(uint64(l)) + } + l = len(m.FeeManagerAddress) + if l > 0 { + n += 1 + l + sovSetFeeMgrProposal(uint64(l)) + } + return n +} + +func sovSetFeeMgrProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} + +func sozSetFeeMgrProposal(x uint64) (n int) { + return sovSetFeeMgrProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + +func (m *SetFeeManagerAddressProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SetFeeManagerAddressProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetFeeManagerAddressProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainReferenceID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainReferenceID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeManagerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeManagerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSetFeeMgrProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSetFeeMgrProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skipSetFeeMgrProposal(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSetFeeMgrProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSetFeeMgrProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSetFeeMgrProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSetFeeMgrProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSetFeeMgrProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSetFeeMgrProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSetFeeMgrProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/evm/types/turnstone.pb.go b/x/evm/types/turnstone.pb.go index 7a335491..a6399bd2 100644 --- a/x/evm/types/turnstone.pb.go +++ b/x/evm/types/turnstone.pb.go @@ -96,6 +96,7 @@ type SubmitLogicCall struct { ContractAddress []byte `protobuf:"bytes,6,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` ExecutionRequirements SubmitLogicCall_ExecutionRequirements `protobuf:"bytes,7,opt,name=executionRequirements,proto3" json:"executionRequirements"` Retries uint32 `protobuf:"varint,8,opt,name=retries,proto3" json:"retries,omitempty"` + Fees *SubmitLogicCall_Fees `protobuf:"bytes,10,opt,name=fees,proto3" json:"fees,omitempty"` } func (m *SubmitLogicCall) Reset() { *m = SubmitLogicCall{} } @@ -187,6 +188,13 @@ func (m *SubmitLogicCall) GetRetries() uint32 { return 0 } +func (m *SubmitLogicCall) GetFees() *SubmitLogicCall_Fees { + if m != nil { + return m.Fees + } + return nil +} + type SubmitLogicCall_ExecutionRequirements struct { EnforceMEVRelay bool `protobuf:"varint,1,opt,name=enforceMEVRelay,proto3" json:"enforceMEVRelay,omitempty"` } @@ -231,6 +239,66 @@ func (m *SubmitLogicCall_ExecutionRequirements) GetEnforceMEVRelay() bool { return false } +type SubmitLogicCall_Fees struct { + RelayerFee uint64 `protobuf:"varint,1,opt,name=relayerFee,proto3" json:"relayerFee,omitempty"` + CommunityFee uint64 `protobuf:"varint,2,opt,name=communityFee,proto3" json:"communityFee,omitempty"` + SecurityFee uint64 `protobuf:"varint,3,opt,name=securityFee,proto3" json:"securityFee,omitempty"` +} + +func (m *SubmitLogicCall_Fees) Reset() { *m = SubmitLogicCall_Fees{} } +func (m *SubmitLogicCall_Fees) String() string { return proto.CompactTextString(m) } +func (*SubmitLogicCall_Fees) ProtoMessage() {} +func (*SubmitLogicCall_Fees) Descriptor() ([]byte, []int) { + return fileDescriptor_86cc126a804337fd, []int{1, 1} +} +func (m *SubmitLogicCall_Fees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubmitLogicCall_Fees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubmitLogicCall_Fees.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubmitLogicCall_Fees) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubmitLogicCall_Fees.Merge(m, src) +} +func (m *SubmitLogicCall_Fees) XXX_Size() int { + return m.Size() +} +func (m *SubmitLogicCall_Fees) XXX_DiscardUnknown() { + xxx_messageInfo_SubmitLogicCall_Fees.DiscardUnknown(m) +} + +var xxx_messageInfo_SubmitLogicCall_Fees proto.InternalMessageInfo + +func (m *SubmitLogicCall_Fees) GetRelayerFee() uint64 { + if m != nil { + return m.RelayerFee + } + return 0 +} + +func (m *SubmitLogicCall_Fees) GetCommunityFee() uint64 { + if m != nil { + return m.CommunityFee + } + return 0 +} + +func (m *SubmitLogicCall_Fees) GetSecurityFee() uint64 { + if m != nil { + return m.SecurityFee + } + return 0 +} + type UpdateValset struct { Valset *Valset `protobuf:"bytes,1,opt,name=valset,proto3" json:"valset,omitempty"` } @@ -365,6 +433,7 @@ type Message struct { // block height at which the message was assinged to the // current relayer. Updated when message is reassigned. AssignedAtBlockHeight cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=assigned_at_block_height,json=assignedAtBlockHeight,proto3,customtype=cosmossdk.io/math.Int" json:"assigned_at_block_height"` + AssigneeRemoteAddress string `protobuf:"bytes,10,opt,name=assigneeRemoteAddress,proto3" json:"assigneeRemoteAddress,omitempty"` } func (m *Message) Reset() { *m = Message{} } @@ -476,6 +545,13 @@ func (m *Message) GetAssignee() string { return "" } +func (m *Message) GetAssigneeRemoteAddress() string { + if m != nil { + return m.AssigneeRemoteAddress + } + return "" +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Message) XXX_OneofWrappers() []interface{} { return []interface{}{ @@ -632,6 +708,7 @@ func init() { proto.RegisterType((*Valset)(nil), "palomachain.paloma.evm.Valset") proto.RegisterType((*SubmitLogicCall)(nil), "palomachain.paloma.evm.SubmitLogicCall") proto.RegisterType((*SubmitLogicCall_ExecutionRequirements)(nil), "palomachain.paloma.evm.SubmitLogicCall.ExecutionRequirements") + proto.RegisterType((*SubmitLogicCall_Fees)(nil), "palomachain.paloma.evm.SubmitLogicCall.Fees") proto.RegisterType((*UpdateValset)(nil), "palomachain.paloma.evm.UpdateValset") proto.RegisterType((*UploadSmartContract)(nil), "palomachain.paloma.evm.UploadSmartContract") proto.RegisterType((*Message)(nil), "palomachain.paloma.evm.Message") @@ -645,62 +722,66 @@ func init() { } var fileDescriptor_86cc126a804337fd = []byte{ - // 867 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdf, 0x6e, 0x1b, 0xc5, - 0x17, 0xf6, 0xda, 0xae, 0x63, 0x8f, 0xdd, 0x5f, 0xd2, 0xe9, 0x2f, 0xd1, 0x92, 0x0b, 0xd7, 0xb2, - 0x2a, 0x58, 0x0a, 0xac, 0x2b, 0x23, 0xb8, 0x40, 0xe2, 0x22, 0x76, 0x53, 0xc5, 0x15, 0x15, 0x68, - 0x92, 0x56, 0x08, 0x21, 0x59, 0xe3, 0xdd, 0x13, 0x7b, 0xd4, 0xdd, 0x99, 0x65, 0x66, 0x36, 0x89, - 0x79, 0x0a, 0x6e, 0x79, 0x03, 0xc4, 0x15, 0x48, 0x3c, 0x44, 0x2f, 0x2b, 0xae, 0x10, 0x17, 0x15, - 0x4a, 0x2e, 0x78, 0x0d, 0x34, 0xb3, 0x6b, 0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- 0x6e, 0xda, 0xa5, 0x37, 0x37, 0xed, 0xd2, 0x1f, 0x37, 0xed, 0xd2, 0x37, 0xef, 0x4f, 0x99, 0x9e, - 0xa5, 0x13, 0x3f, 0x10, 0x71, 0x6f, 0xcb, 0x0f, 0xec, 0x2a, 0xfb, 0x85, 0xcd, 0x13, 0x50, 0x93, - 0x9a, 0xfd, 0xc7, 0x7c, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0x9b, 0xd5, 0xdb, 0xe9, - 0x06, 0x00, 0x00, + // 942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6e, 0x1b, 0x37, + 0x10, 0xd6, 0xca, 0x1b, 0x45, 0xa2, 0x94, 0xda, 0x61, 0x6a, 0x63, 0xeb, 0x83, 0x22, 0x08, 0x41, + 0xab, 0xa6, 0xe9, 0x2a, 0x50, 0x7f, 0x0e, 0x05, 0x7a, 0xb0, 0x1d, 0x0b, 0x56, 0xd0, 0xa0, 0x05, + 0xed, 0x04, 0x45, 0x51, 0x40, 0xa0, 0x76, 0x47, 0x12, 0x91, 0x5d, 0x72, 0x4b, 0x72, 0x6d, 0xab, + 0x4f, 0xd1, 0x6b, 0xdf, 0xa0, 0xc7, 0x1e, 0xfa, 0x10, 0x39, 0x06, 0x3d, 0x15, 0x3d, 0x04, 0x81, + 0x7d, 0xc8, 0x6b, 0x14, 0xe4, 0xae, 0xd4, 0xd5, 0x8f, 0x81, 0x5c, 0x16, 0x9c, 0x8f, 0x1f, 0x67, + 0x66, 0x67, 0xbe, 0x21, 0xd1, 0xc7, 0x09, 0x8d, 0x44, 0x4c, 0x83, 0x29, 0x65, 0xbc, 0x9b, 0xad, + 0xbb, 0x70, 0x1e, 0x77, 0x75, 0x2a, 0xb9, 0xd2, 0x82, 0x83, 0x9f, 0x48, 0xa1, 0x05, 0xde, 0x2b, + 0xf0,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x23, 0x74, 0x97, 0xc3, 0xc5, + 0xd1, 0xff, 0x9d, 0x33, 0xc5, 0xc9, 0x5e, 0x8f, 0xf5, 0x8d, 0x6f, 0xca, 0x9e, 0x73, 0x78, 0xf4, + 0xea, 0xaa, 0xe9, 0xbc, 0xbe, 0x6a, 0x3a, 0x6f, 0xaf, 0x9a, 0xce, 0x6f, 0xd7, 0xcd, 0xd2, 0xeb, + 0xeb, 0x66, 0xe9, 0x9f, 0xeb, 0x66, 0xe9, 0xa7, 0x4f, 0x27, 0x4c, 0x4f, 0xd3, 0x91, 0x1f, 0x88, + 0xb8, 0xbb, 0xe1, 0xb1, 0xbe, 0xcc, 0x9e, 0xeb, 0x59, 0x02, 0x6a, 0x54, 0xb1, 0xef, 0xe9, 0x17, + 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x54, 0xbd, 0xb7, 0xd5, 0x07, 0x00, 0x00, } func (m *Valset) Marshal() (dAtA []byte, err error) { @@ -778,6 +859,18 @@ func (m *SubmitLogicCall) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Fees != nil { + { + size, err := m.Fees.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTurnstone(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } if m.Retries != 0 { i = encodeVarintTurnstone(dAtA, i, uint64(m.Retries)) i-- @@ -869,6 +962,44 @@ func (m *SubmitLogicCall_ExecutionRequirements) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } +func (m *SubmitLogicCall_Fees) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SubmitLogicCall_Fees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubmitLogicCall_Fees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SecurityFee != 0 { + i = encodeVarintTurnstone(dAtA, i, uint64(m.SecurityFee)) + i-- + dAtA[i] = 0x18 + } + if m.CommunityFee != 0 { + i = encodeVarintTurnstone(dAtA, i, uint64(m.CommunityFee)) + i-- + dAtA[i] = 0x10 + } + if m.RelayerFee != 0 { + i = encodeVarintTurnstone(dAtA, i, uint64(m.RelayerFee)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *UpdateValset) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -978,6 +1109,13 @@ func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AssigneeRemoteAddress) > 0 { + i -= len(m.AssigneeRemoteAddress) + copy(dAtA[i:], m.AssigneeRemoteAddress) + i = encodeVarintTurnstone(dAtA, i, uint64(len(m.AssigneeRemoteAddress))) + i-- + dAtA[i] = 0x52 + } { size := m.AssignedAtBlockHeight.Size() i -= size @@ -1256,6 +1394,10 @@ func (m *SubmitLogicCall) Size() (n int) { if m.Retries != 0 { n += 1 + sovTurnstone(uint64(m.Retries)) } + if m.Fees != nil { + l = m.Fees.Size() + n += 1 + l + sovTurnstone(uint64(l)) + } return n } @@ -1271,6 +1413,24 @@ func (m *SubmitLogicCall_ExecutionRequirements) Size() (n int) { return n } +func (m *SubmitLogicCall_Fees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RelayerFee != 0 { + n += 1 + sovTurnstone(uint64(m.RelayerFee)) + } + if m.CommunityFee != 0 { + n += 1 + sovTurnstone(uint64(m.CommunityFee)) + } + if m.SecurityFee != 0 { + n += 1 + sovTurnstone(uint64(m.SecurityFee)) + } + return n +} + func (m *UpdateValset) Size() (n int) { if m == nil { return 0 @@ -1338,6 +1498,10 @@ func (m *Message) Size() (n int) { } l = m.AssignedAtBlockHeight.Size() n += 1 + l + sovTurnstone(uint64(l)) + l = len(m.AssigneeRemoteAddress) + if l > 0 { + n += 1 + l + sovTurnstone(uint64(l)) + } return n } @@ -1870,6 +2034,42 @@ func (m *SubmitLogicCall) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTurnstone + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTurnstone + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fees == nil { + m.Fees = &SubmitLogicCall_Fees{} + } + if err := m.Fees.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTurnstone(dAtA[iNdEx:]) @@ -1961,6 +2161,113 @@ func (m *SubmitLogicCall_ExecutionRequirements) Unmarshal(dAtA []byte) error { } return nil } +func (m *SubmitLogicCall_Fees) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Fees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Fees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayerFee", wireType) + } + m.RelayerFee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RelayerFee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityFee", wireType) + } + m.CommunityFee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommunityFee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityFee", wireType) + } + m.SecurityFee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SecurityFee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTurnstone(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTurnstone + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *UpdateValset) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2531,6 +2838,38 @@ func (m *Message) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssigneeRemoteAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTurnstone + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTurnstone + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssigneeRemoteAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTurnstone(dAtA[iNdEx:]) diff --git a/x/evm/types/turnstone_abi.go b/x/evm/types/turnstone_abi.go index 1805aea3..6dc93f8f 100644 --- a/x/evm/types/turnstone_abi.go +++ b/x/evm/types/turnstone_abi.go @@ -1,7 +1,9 @@ package types import ( + "bytes" "encoding/binary" + "errors" "math/big" "strings" @@ -39,10 +41,19 @@ type CompassLogicCallArgs struct { LogicContractAddress common.Address } -func (_m *Message_UpdateValset) keccak256(orig *Message, _ uint64) []byte { +var ( + _ consensustypes.MessageHasher = (*Message)(nil) + _ consensustypes.MessageHasher = (*ValidatorBalancesAttestation)(nil) + _ consensustypes.MessageHasher = (*ReferenceBlockAttestation)(nil) +) + +func (_m *Message_UpdateValset) keccak256( + orig *Message, + _, gasEstimate uint64, +) ([]byte, error) { m := _m.UpdateValset // checkpoint(address[],uint256[],uint256,bytes32) - arguments := abi.Arguments{ + checkpointArgs := abi.Arguments{ // addresses {Type: whoops.Must(abi.NewType("address[]", "", nil))}, // powers @@ -52,13 +63,13 @@ func (_m *Message_UpdateValset) keccak256(orig *Message, _ uint64) []byte { // turnstone id {Type: whoops.Must(abi.NewType("bytes32", "", nil))}, } - method := abi.NewMethod("checkpoint", "checkpoint", abi.Function, "", false, false, arguments, abi.Arguments{}) + checkpointMethod := abi.NewMethod("checkpoint", "checkpoint", abi.Function, "", false, false, checkpointArgs, abi.Arguments{}) var bytes32 [32]byte copy(bytes32[:], orig.GetTurnstoneID()) - bytes, err := arguments.Pack( + checkpointBytes, err := checkpointArgs.Pack( slice.Map(m.GetValset().GetValidators(), func(s string) common.Address { return common.HexToAddress(s) }), @@ -68,13 +79,46 @@ func (_m *Message_UpdateValset) keccak256(orig *Message, _ uint64) []byte { big.NewInt(int64(m.GetValset().GetValsetID())), bytes32, ) - bytes = append(method.ID[:], bytes...) + if err != nil { + return nil, err + } + + checkpointBytes = append(checkpointMethod.ID[:], checkpointBytes...) + checkpointHash := crypto.Keccak256(checkpointBytes) + var hash32 [32]byte + copy(hash32[:], checkpointHash) + + // update_valset(bytes32,address,uint256) + arguments := abi.Arguments{ + // checkpoint + {Type: whoops.Must(abi.NewType("bytes32", "", nil))}, + // relayer + {Type: whoops.Must(abi.NewType("address", "", nil))}, + // gas estimate + {Type: whoops.Must(abi.NewType("uint256", "", nil))}, + } + + method := abi.NewMethod("update_valset", "update_valset", abi.Function, "", false, false, arguments, abi.Arguments{}) + + estimate := gasEstimate + if estimate == 0 { + // If there's no estimate, we use the same default as pigeon + estimate = 300_000 + } + + bytes, err := arguments.Pack( + hash32, + common.HexToAddress(orig.AssigneeRemoteAddress), + big.NewInt(0).SetUint64(estimate), + ) if err != nil { - panic(err) + return nil, err } - return crypto.Keccak256(bytes) + bytes = append(method.ID[:], bytes...) + + return crypto.Keccak256(bytes), nil } func uint64ToByte(n uint64) []byte { @@ -83,13 +127,19 @@ func uint64ToByte(n uint64) []byte { return b } -func (_m *Message_UploadSmartContract) keccak256(orig *Message, nonce uint64) []byte { +func (_m *Message_UploadSmartContract) keccak256( + _ *Message, + nonce, _ uint64, +) ([]byte, error) { m := _m.UploadSmartContract - return crypto.Keccak256(append(m.GetBytecode()[:], uint64ToByte(nonce)...)) + return crypto.Keccak256(append(m.GetBytecode()[:], uint64ToByte(nonce)...)), nil } -func (_m *Message_SubmitLogicCall) keccak256(orig *Message, nonce uint64) []byte { +func (_m *Message_SubmitLogicCall) keccak256( + orig *Message, + nonce, _ uint64, +) ([]byte, error) { m := _m.SubmitLogicCall // logic_call((address,bytes),uint256,uint256) arguments := abi.Arguments{ @@ -98,12 +148,21 @@ func (_m *Message_SubmitLogicCall) keccak256(orig *Message, nonce uint64) []byte {Name: "address", Type: "address"}, {Name: "payload", Type: "bytes"}, }))}, + // fee arguments + {Type: whoops.Must(abi.NewType("tuple", "", []abi.ArgumentMarshaling{ + {Name: "relayer_fee", Type: "uint256"}, + {Name: "community_fee", Type: "uint256"}, + {Name: "security_fee", Type: "uint256"}, + {Name: "fee_payer_paloma_address", Type: "bytes32"}, + }))}, // message id {Type: whoops.Must(abi.NewType("uint256", "", nil))}, // turnstone id {Type: whoops.Must(abi.NewType("bytes32", "", nil))}, // deadline {Type: whoops.Must(abi.NewType("uint256", "", nil))}, + // relayer + {Type: whoops.Must(abi.NewType("address", "", nil))}, } method := abi.NewMethod("logic_call", "logic_call", abi.Function, "", false, false, arguments, abi.Arguments{}) @@ -111,6 +170,23 @@ func (_m *Message_SubmitLogicCall) keccak256(orig *Message, nonce uint64) []byte copy(bytes32[:], orig.GetTurnstoneID()) + var fees *SubmitLogicCall_Fees + if m.Fees == nil { + // If we have no fees set in the message, we use the same defaults as + // pigeon + fees = &SubmitLogicCall_Fees{ + RelayerFee: 100_000, + CommunityFee: 100_000, + SecurityFee: 100_000, + } + } else { + fees = m.Fees + } + + // Left-pad the address with zeroes + padding := bytes.Repeat([]byte{0}, 32-len(m.SenderAddress)) + senderAddress := [32]byte(append(padding, m.SenderAddress...)) + bytes, err := arguments.Pack( struct { Address common.Address @@ -119,36 +195,50 @@ func (_m *Message_SubmitLogicCall) keccak256(orig *Message, nonce uint64) []byte common.HexToAddress(m.GetHexContractAddress()), m.GetPayload(), }, + struct { + RelayerFee *big.Int + CommunityFee *big.Int + SecurityFee *big.Int + FeePayerPalomaAddress [32]byte + }{ + new(big.Int).SetUint64(fees.RelayerFee), + new(big.Int).SetUint64(fees.CommunityFee), + new(big.Int).SetUint64(fees.SecurityFee), + senderAddress, + }, new(big.Int).SetInt64(int64(nonce)), bytes32, big.NewInt(m.GetDeadline()), + common.HexToAddress(orig.AssigneeRemoteAddress), ) if err != nil { - panic(err) + return nil, err } bytes = append(method.ID[:], bytes...) - return crypto.Keccak256(bytes) + return crypto.Keccak256(bytes), nil } -func (m *Message) SetAssignee(ctx sdk.Context, val string) { +func (m *Message) SetAssignee(ctx sdk.Context, val, remoteAddr string) { m.Assignee = val + m.AssigneeRemoteAddress = remoteAddr m.AssignedAtBlockHeight = math.NewInt(ctx.BlockHeight()) } -func (m *Message) Keccak256(nonce uint64) []byte { +func (m *Message) Keccak256WithSignedMessage(q *consensustypes.QueuedSignedMessage) ([]byte, error) { type keccak256able interface { - keccak256(*Message, uint64) []byte + keccak256(*Message, uint64, uint64) ([]byte, error) } k, ok := m.GetAction().(keccak256able) if !ok { - panic("message's action is not hashable") + return nil, errors.New("message's action is not hashable") } - return k.keccak256(m, nonce) + + return k.keccak256(m, q.GetId(), q.GasEstimate) } -func (m *ValidatorBalancesAttestation) Keccak256(nonce uint64) []byte { +func (m *ValidatorBalancesAttestation) Keccak256WithSignedMessage(_ *consensustypes.QueuedSignedMessage) ([]byte, error) { var sb strings.Builder sb.WriteString(m.FromBlockTime.String()) sb.WriteRune('\n') @@ -159,11 +249,11 @@ func (m *ValidatorBalancesAttestation) Keccak256(nonce uint64) []byte { sb.WriteRune('\n') } - return crypto.Keccak256([]byte(sb.String())) + return crypto.Keccak256([]byte(sb.String())), nil } -func (m *ReferenceBlockAttestation) Keccak256(nonce uint64) []byte { - return crypto.Keccak256([]byte(m.FromBlockTime.String())) +func (m *ReferenceBlockAttestation) Keccak256WithSignedMessage(_ *consensustypes.QueuedSignedMessage) ([]byte, error) { + return crypto.Keccak256([]byte(m.FromBlockTime.String())), nil } func BuildCompassConsensus( diff --git a/x/metrix/types/mocks/SlashingKeeper.go b/x/metrix/types/mocks/SlashingKeeper.go new file mode 100644 index 00000000..fb01aa0f --- /dev/null +++ b/x/metrix/types/mocks/SlashingKeeper.go @@ -0,0 +1,79 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// SlashingKeeper is an autogenerated mock type for the SlashingKeeper type +type SlashingKeeper struct { + mock.Mock +} + +// IterateValidatorSigningInfos provides a mock function with given fields: _a0, _a1 +func (_m *SlashingKeeper) IterateValidatorSigningInfos(_a0 context.Context, _a1 func(types.ConsAddress, slashingtypes.ValidatorSigningInfo) bool) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IterateValidatorSigningInfos") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, func(types.ConsAddress, slashingtypes.ValidatorSigningInfo) bool) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SignedBlocksWindow provides a mock function with given fields: _a0 +func (_m *SlashingKeeper) SignedBlocksWindow(_a0 context.Context) (int64, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SignedBlocksWindow") + } + + var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (int64, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(context.Context) int64); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(int64) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewSlashingKeeper creates a new instance of SlashingKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSlashingKeeper(t interface { + mock.TestingT + Cleanup(func()) +}, +) *SlashingKeeper { + mock := &SlashingKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/metrix/types/mocks/StakingKeeper.go b/x/metrix/types/mocks/StakingKeeper.go new file mode 100644 index 00000000..aafd2873 --- /dev/null +++ b/x/metrix/types/mocks/StakingKeeper.go @@ -0,0 +1,107 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// StakingKeeper is an autogenerated mock type for the StakingKeeper type +type StakingKeeper struct { + mock.Mock +} + +// GetValidator provides a mock function with given fields: _a0, _a1 +func (_m *StakingKeeper) GetValidator(_a0 context.Context, _a1 types.ValAddress) (stakingtypes.Validator, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetValidator") + } + + var r0 stakingtypes.Validator + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.ValAddress) (stakingtypes.Validator, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, types.ValAddress) stakingtypes.Validator); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Get(0).(stakingtypes.Validator) + } + + if rf, ok := ret.Get(1).(func(context.Context, types.ValAddress) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetValidatorByConsAddr provides a mock function with given fields: _a0, _a1 +func (_m *StakingKeeper) GetValidatorByConsAddr(_a0 context.Context, _a1 types.ConsAddress) (stakingtypes.Validator, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetValidatorByConsAddr") + } + + var r0 stakingtypes.Validator + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.ConsAddress) (stakingtypes.Validator, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, types.ConsAddress) stakingtypes.Validator); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Get(0).(stakingtypes.Validator) + } + + if rf, ok := ret.Get(1).(func(context.Context, types.ConsAddress) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// IterateValidators provides a mock function with given fields: _a0, _a1 +func (_m *StakingKeeper) IterateValidators(_a0 context.Context, _a1 func(int64, stakingtypes.ValidatorI) bool) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IterateValidators") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, func(int64, stakingtypes.ValidatorI) bool) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewStakingKeeper creates a new instance of StakingKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStakingKeeper(t interface { + mock.TestingT + Cleanup(func()) +}, +) *StakingKeeper { + mock := &StakingKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/scheduler/types/expected_keepers.go b/x/scheduler/types/expected_keepers.go index 6eb37a46..2238cfa6 100644 --- a/x/scheduler/types/expected_keepers.go +++ b/x/scheduler/types/expected_keepers.go @@ -31,7 +31,7 @@ type BankKeeper interface { //go:generate mockery --name=EvmKeeper type EvmKeeper interface { PreJobExecution(ctx context.Context, job *Job) error - PickValidatorForMessage(ctx context.Context, chainReferenceID string, req *xchain.JobRequirements) (string, error) + PickValidatorForMessage(ctx context.Context, chainReferenceID string, req *xchain.JobRequirements) (string, string, error) } // ValsetKeeper defines the expected interface for interacting with the valset module diff --git a/x/scheduler/types/mocks/AccountKeeper.go b/x/scheduler/types/mocks/AccountKeeper.go index e69f7608..5f515e36 100644 --- a/x/scheduler/types/mocks/AccountKeeper.go +++ b/x/scheduler/types/mocks/AccountKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -83,7 +83,8 @@ func (_m *AccountKeeper) SetAccount(ctx context.Context, acc types.AccountI) { func NewAccountKeeper(t interface { mock.TestingT Cleanup(func()) -}) *AccountKeeper { +}, +) *AccountKeeper { mock := &AccountKeeper{} mock.Mock.Test(t) diff --git a/x/scheduler/types/mocks/BankKeeper.go b/x/scheduler/types/mocks/BankKeeper.go new file mode 100644 index 00000000..4438ce4c --- /dev/null +++ b/x/scheduler/types/mocks/BankKeeper.go @@ -0,0 +1,51 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper is an autogenerated mock type for the BankKeeper type +type BankKeeper struct { + mock.Mock +} + +// SpendableCoins provides a mock function with given fields: ctx, addr +func (_m *BankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins { + ret := _m.Called(ctx, addr) + + if len(ret) == 0 { + panic("no return value specified for SpendableCoins") + } + + var r0 types.Coins + if rf, ok := ret.Get(0).(func(context.Context, types.AccAddress) types.Coins); ok { + r0 = rf(ctx, addr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.Coins) + } + } + + return r0 +} + +// NewBankKeeper creates a new instance of BankKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBankKeeper(t interface { + mock.TestingT + Cleanup(func()) +}, +) *BankKeeper { + mock := &BankKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/scheduler/types/mocks/EvmKeeper.go b/x/scheduler/types/mocks/EvmKeeper.go index 9243b969..40af53bf 100644 --- a/x/scheduler/types/mocks/EvmKeeper.go +++ b/x/scheduler/types/mocks/EvmKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -17,7 +17,7 @@ type EvmKeeper struct { } // PickValidatorForMessage provides a mock function with given fields: ctx, chainReferenceID, req -func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, req *xchain.JobRequirements) (string, error) { +func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, req *xchain.JobRequirements) (string, string, error) { ret := _m.Called(ctx, chainReferenceID, req) if len(ret) == 0 { @@ -25,8 +25,9 @@ func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReference } var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) (string, error)); ok { + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) (string, string, error)); ok { return rf(ctx, chainReferenceID, req) } if rf, ok := ret.Get(0).(func(context.Context, string, *xchain.JobRequirements) string); ok { @@ -35,13 +36,19 @@ func (_m *EvmKeeper) PickValidatorForMessage(ctx context.Context, chainReference r0 = ret.Get(0).(string) } - if rf, ok := ret.Get(1).(func(context.Context, string, *xchain.JobRequirements) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, string, *xchain.JobRequirements) string); ok { r1 = rf(ctx, chainReferenceID, req) } else { - r1 = ret.Error(1) + r1 = ret.Get(1).(string) } - return r0, r1 + if rf, ok := ret.Get(2).(func(context.Context, string, *xchain.JobRequirements) error); ok { + r2 = rf(ctx, chainReferenceID, req) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 } // PreJobExecution provides a mock function with given fields: ctx, job diff --git a/x/scheduler/types/mocks/Keeper.go b/x/scheduler/types/mocks/Keeper.go index 4f5f4952..bec67723 100644 --- a/x/scheduler/types/mocks/Keeper.go +++ b/x/scheduler/types/mocks/Keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -188,7 +188,8 @@ func (_m *Keeper) ScheduleNow(ctx context.Context, jobID string, in []byte, send func NewKeeper(t interface { mock.TestingT Cleanup(func()) -}) *Keeper { +}, +) *Keeper { mock := &Keeper{} mock.Mock.Test(t) diff --git a/x/scheduler/types/mocks/ValsetKeeper.go b/x/scheduler/types/mocks/ValsetKeeper.go new file mode 100644 index 00000000..e3ef8d8d --- /dev/null +++ b/x/scheduler/types/mocks/ValsetKeeper.go @@ -0,0 +1,61 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/palomachain/paloma/x/valset/types" +) + +// ValsetKeeper is an autogenerated mock type for the ValsetKeeper type +type ValsetKeeper struct { + mock.Mock +} + +// GetCurrentSnapshot provides a mock function with given fields: ctx +func (_m *ValsetKeeper) GetCurrentSnapshot(ctx context.Context) (*types.Snapshot, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetCurrentSnapshot") + } + + var r0 *types.Snapshot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*types.Snapshot, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *types.Snapshot); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Snapshot) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewValsetKeeper creates a new instance of ValsetKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewValsetKeeper(t interface { + mock.TestingT + Cleanup(func()) +}, +) *ValsetKeeper { + mock := &ValsetKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/skyway/abci.go b/x/skyway/abci.go index 5b884b79..a2c5accf 100644 --- a/x/skyway/abci.go +++ b/x/skyway/abci.go @@ -2,15 +2,20 @@ package skyway import ( "context" + "errors" + "fmt" sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/util/libcons" "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/util/slice" "github.com/palomachain/paloma/x/skyway/keeper" + "github.com/palomachain/paloma/x/skyway/types" ) // EndBlocker is called at the end of every block -func EndBlocker(ctx context.Context, k keeper.Keeper) { +func EndBlocker(ctx context.Context, k keeper.Keeper, cc *libcons.ConsensusChecker) { logger := liblog.FromKeeper(ctx, k).WithComponent("skyway-endblocker") defer func() { if r := recover(); r != nil { @@ -39,12 +44,93 @@ func EndBlocker(ctx context.Context, k keeper.Keeper) { } } + err = processGasEstimates(ctx, k, cc) + if err != nil { + logger.WithError(err).Warn("Failed to process gas estimates.") + } + err = cleanupTimedOutBatches(ctx, k) if err != nil { logger.WithError(err).Warn("Failed to cleanup timed out batches.") } } +// lce is a light data structure to +// implementing libcons.Estimate +type lce struct { + addr sdk.ValAddress + v uint64 +} + +func (l lce) GetValAddress() sdk.ValAddress { return l.addr } +func (l lce) GetValue() uint64 { return l.v } + +// Iterates over all outgoing batches and builds a gas estimate for each one +// if enough estimates have been collected. +func processGasEstimates(ctx context.Context, k keeper.Keeper, cc *libcons.ConsensusChecker) error { + err := k.IterateOutgoingTxBatches(ctx, func(key []byte, batch types.InternalOutgoingTxBatch) bool { + // Skip batches that already have a gas estimate + if batch.GasEstimate > 0 { + return false + } + logger := liblog.FromKeeper(ctx, k). + WithComponent("skyway-process-gas-estimates"). + WithFields( + "batch-nonce", batch.BatchNonce, + "token-contract", batch.TokenContract, + "chain-reference-id", batch.ChainReferenceID, + ) + logger.Debug("Processing gas estimates for batch") + batchEstimates, err := k.GetBatchGasEstimateByNonceAndTokenContract(ctx, batch.BatchNonce, batch.TokenContract) + if err != nil { + logger.WithError(err).Warn("Failed to get gas estimates") + return false + } + if len(batchEstimates) < 1 { + logger.Debug("Skipping batch, not enough gas estimates") + return false + } + + lc := make([]lce, len(batchEstimates)) + for i, estimate := range batchEstimates { + addr, err := sdk.AccAddressFromBech32(estimate.Metadata.Creator) + if err != nil { + logger.WithFields( + "validator", estimate.Metadata.Creator, + ).WithError(err). + Warn("Failed to get validator address from estimate") + return false + } + lc[i] = lce{sdk.ValAddress(addr), estimate.Estimate} + } + + // Try to get consensus on the gas estimate + estimate, err := cc.VerifyGasEstimates(ctx, k, + slice.Map(lc, func(ge lce) libcons.GasEstimate { + return ge + })) + if err != nil { + if errors.Is(err, libcons.ErrConsensusNotAchieved) { + logger.WithError(err).Debug("Consensus not achieved for gas estimates") + return false + } + err = fmt.Errorf("failed to verify gas estimates: %w", err) + logger.WithError(err).Warn("Failed to verify gas estimates") + return false + } + + if err := k.UpdateBatchGasEstimate(ctx, batch, estimate); err != nil { + logger.WithError(err).Warn("Failed to set gas estimate") + } + + return false + }) + if err != nil { + return fmt.Errorf("failed to iterate outgoing tx batches: %w", err) + } + return nil +} + // Create a batch of transactions for each token func createBatch(ctx context.Context, k keeper.Keeper) error { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/skyway/abci_test.go b/x/skyway/abci_test.go index 5537401c..d54d36c8 100644 --- a/x/skyway/abci_test.go +++ b/x/skyway/abci_test.go @@ -11,8 +11,10 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/palomachain/paloma/util/libcons" "github.com/palomachain/paloma/x/skyway/keeper" "github.com/palomachain/paloma/x/skyway/types" + valsettypes "github.com/palomachain/paloma/x/valset/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -23,6 +25,7 @@ func TestNonValidatorBatchConfirm(t *testing.T) { input, ctx := keeper.SetupFiveValChain(t) sdkCtx := sdk.UnwrapSDKContext(ctx) defer func() { sdkCtx.Logger().Info("Asserting invariants at test end"); input.AssertInvariants() }() + cc := libcons.New(input.ValsetKeeper.GetCurrentSnapshot, input.Marshaler) pk := input.SkywayKeeper @@ -77,6 +80,7 @@ func TestNonValidatorBatchConfirm(t *testing.T) { Transactions: []types.OutgoingTransferTx{}, TokenContract: keeper.TokenContractAddrs[0], PalomaBlockCreated: uint64(sdkCtx.BlockHeight() - 1), + ChainReferenceId: "test-chain", }) require.NoError(t, err) pk.StoreBatch(ctx, *batch) @@ -108,7 +112,7 @@ func TestNonValidatorBatchConfirm(t *testing.T) { _, err = stakingMsgSvr.Undelegate(input.Context, keeper.NewTestMsgUnDelegateValidator(valAddr, math.NewIntFromUint64(1))) require.NoError(t, err) - EndBlocker(ctx, pk) + EndBlocker(ctx, pk, cc) } // Test batch timeout @@ -116,6 +120,7 @@ func TestBatchTimeout(t *testing.T) { input, ctx := keeper.SetupFiveValChain(t) sdkCtx := sdk.UnwrapSDKContext(ctx) defer func() { sdkCtx.Logger().Info("Asserting invariants at test end"); input.AssertInvariants() }() + cc := libcons.New(input.ValsetKeeper.GetCurrentSnapshot, input.Marshaler) pk := input.SkywayKeeper var ( @@ -198,7 +203,7 @@ func TestBatchTimeout(t *testing.T) { // when, beyond the timeout ctx = sdkCtx.WithBlockTime(testTime.Add(20 * time.Minute)) - EndBlocker(ctx, pk) + EndBlocker(ctx, pk, cc) // this had a timeout of zero should be deleted. gotFirstBatch, err = input.SkywayKeeper.GetOutgoingTXBatch(ctx, b1.TokenContract, b1.BatchNonce) @@ -215,3 +220,156 @@ func TestBatchTimeout(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, len(secondBatchConfirms)) } + +func TestGasEstimation(t *testing.T) { + input, ctx := keeper.SetupFiveValChain(t) + sdkCtx := sdk.UnwrapSDKContext(ctx) + defer func() { sdkCtx.Logger().Info("Asserting invariants at test end"); input.AssertInvariants() }() + cc := libcons.New(input.ValsetKeeper.GetCurrentSnapshot, input.Marshaler) + + pk := input.SkywayKeeper + var ( + mySender, e1 = sdk.AccAddressFromBech32("paloma1ahx7f8wyertuus9r20284ej0asrs085c945jyk") + myReceiver = "0xd041c41EA1bf0F006ADBb6d2c9ef9D425dE5eaD7" + testERC20Address = "0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e" + testDenom = "ugrain" + token, e2 = types.NewInternalERC20Token(math.NewInt(99999), testERC20Address, "test-chain") + allVouchers = sdk.NewCoins(sdk.NewCoin(testDenom, token.Amount)) + estimates = []uint64{ + 21_000, + 25_000, + 19_000, + 21_000, + 25_000, + } + ) + require.NoError(t, e1) + require.NoError(t, e2) + receiver, err := types.NewEthAddress(myReceiver) + require.NoError(t, err) + tokenContract, err := types.NewEthAddress(testERC20Address) + require.NoError(t, err) + + // mint some vouchers first + require.NoError(t, input.BankKeeper.MintCoins(ctx, types.ModuleName, allVouchers)) + // set senders balance + input.AccountKeeper.NewAccountWithAddress(ctx, mySender) + require.NoError(t, input.BankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, mySender, allVouchers)) + + // add some TX to the pool + for i := 0; i < 6; i++ { + amountToken, err := types.NewInternalERC20Token(math.NewInt(int64(i+100)), testERC20Address, "test-chain") + require.NoError(t, err) + amount := sdk.NewCoin(testDenom, amountToken.Amount) + + _, err = input.SkywayKeeper.AddToOutgoingPool(ctx, mySender, *receiver, amount, "test-chain") + require.NoError(t, err) + } + + // check that we can make a batch without first setting an ethereum block height + b, err := pk.BuildOutgoingTXBatch(ctx, "test-chain", *tokenContract, 1) + require.NoError(t, err) + + // make sure the batches got stored in the first place + gotBatch, err := input.SkywayKeeper.GetOutgoingTXBatch(ctx, b.TokenContract, b.BatchNonce) + require.NoError(t, err) + require.NotNil(t, gotBatch) + + for i, val := range keeper.AccAddrs { + ethAddr, err := types.NewEthAddress(keeper.EthAddrs[i].String()) + require.NoError(t, err) + + conf := &types.MsgConfirmBatch{ + Nonce: b.BatchNonce, + TokenContract: b.TokenContract.GetAddress().Hex(), + EthSigner: ethAddr.GetAddress().Hex(), + Orchestrator: val.String(), + Signature: "dummysig", + Metadata: valsettypes.MsgMetadata{ + Creator: val.String(), + Signers: []string{ + val.String(), + }, + }, + } + + input.SkywayKeeper.SetBatchConfirm(ctx, conf) + } + + // verify that confirms are persisted + batchConfirms, err := input.SkywayKeeper.GetBatchConfirmByNonceAndTokenContract(ctx, b.BatchNonce, b.TokenContract) + require.NoError(t, err) + require.Equal(t, len(keeper.OrchAddrs), len(batchConfirms)) + + // verify that no estimates persent yet + batchEstimates, err := input.SkywayKeeper.GetBatchGasEstimateByNonceAndTokenContract(ctx, b.BatchNonce, b.TokenContract) + require.NoError(t, err) + require.Len(t, batchEstimates, 0) + + for i, val := range keeper.AccAddrs[:2] { + ethAddr, err := types.NewEthAddress(keeper.EthAddrs[i].String()) + require.NoError(t, err) + estimate := &types.MsgEstimateBatchGas{ + Nonce: b.BatchNonce, + TokenContract: b.TokenContract.GetAddress().Hex(), + EthSigner: ethAddr.GetAddress().Hex(), + Estimate: estimates[i], + Metadata: valsettypes.MsgMetadata{ + Creator: val.String(), + Signers: []string{ + val.String(), + }, + }, + } + + _, err = input.SkywayKeeper.SetBatchGasEstimate(ctx, estimate) + require.NoError(t, err) + } + + batchEstimates, err = input.SkywayKeeper.GetBatchGasEstimateByNonceAndTokenContract(ctx, b.BatchNonce, b.TokenContract) + require.NoError(t, err) + require.Len(t, batchEstimates, 2) + gotBatch, err = input.SkywayKeeper.GetOutgoingTXBatch(ctx, b.TokenContract, b.BatchNonce) + require.NoError(t, err) + require.Equal(t, uint64(0), gotBatch.GasEstimate) + + EndBlocker(ctx, pk, cc) + + gotBatch, err = input.SkywayKeeper.GetOutgoingTXBatch(ctx, b.TokenContract, b.BatchNonce) + require.NoError(t, err) + require.Equal(t, uint64(0), gotBatch.GasEstimate) + + for i, val := range keeper.AccAddrs[2:] { + ethAddr, err := types.NewEthAddress(keeper.EthAddrs[i].String()) + require.NoError(t, err) + estimate := &types.MsgEstimateBatchGas{ + Nonce: b.BatchNonce, + TokenContract: b.TokenContract.GetAddress().Hex(), + EthSigner: ethAddr.GetAddress().Hex(), + Estimate: estimates[i], + Metadata: valsettypes.MsgMetadata{ + Creator: val.String(), + Signers: []string{ + val.String(), + }, + }, + } + + _, err = input.SkywayKeeper.SetBatchGasEstimate(ctx, estimate) + require.NoError(t, err) + } + + batchEstimates, err = input.SkywayKeeper.GetBatchGasEstimateByNonceAndTokenContract(ctx, b.BatchNonce, b.TokenContract) + require.NoError(t, err) + require.Len(t, batchEstimates, 5) + + EndBlocker(ctx, pk, cc) + + gotBatch, err = input.SkywayKeeper.GetOutgoingTXBatch(ctx, b.TokenContract, b.BatchNonce) + require.NoError(t, err) + require.Equal(t, uint64(25200), gotBatch.GasEstimate) + + // Removing those again to avoid invariant issues due to dummy signatures + err = input.SkywayKeeper.CancelOutgoingTXBatch(ctx, gotBatch.TokenContract, gotBatch.BatchNonce) + require.NoError(t, err) +} diff --git a/x/skyway/keeper/attestation.go b/x/skyway/keeper/attestation.go index e46f0a13..2a78b04f 100644 --- a/x/skyway/keeper/attestation.go +++ b/x/skyway/keeper/attestation.go @@ -267,6 +267,9 @@ func (k Keeper) DeleteAttestation(ctx context.Context, chainReferenceID string, func (k Keeper) GetAttestationMapping(ctx context.Context, chainReferenceID string) (attestationMapping map[uint64][]types.Attestation, orderedKeys []uint64, err error) { attestationMapping = make(map[uint64][]types.Attestation) var g whoops.Group + + lastCompassID := k.GetLatestCompassID(ctx, chainReferenceID) + g.Add( k.IterateAttestations(ctx, chainReferenceID, false, func(_ []byte, att types.Attestation) bool { claim, err := k.UnpackAttestationClaim(&att) @@ -275,6 +278,13 @@ func (k Keeper) GetAttestationMapping(ctx context.Context, chainReferenceID stri return true } + // Do not include claims originating from the other compass + // versions, since we won't be able to attest them anyway. They may + // also repeat the nonce, so we can't list them here. + if lastCompassID != "" && claim.GetCompassID() != lastCompassID { + return false + } + if val, ok := attestationMapping[claim.GetSkywayNonce()]; !ok { attestationMapping[claim.GetSkywayNonce()] = []types.Attestation{att} } else { @@ -454,12 +464,13 @@ func (k Keeper) setLastObservedSkywayNonce(ctx context.Context, chainReferenceID if err != nil { return err } + // event nonce must increase, unless it's zero at which point allow zero to be set // as many times as needed (genesis test setup etc) - zeroCase := last == 0 && nonce == 0 - if last >= nonce && !zeroCase { + if nonce != 0 && nonce < last { return fmt.Errorf("event nonce going backwards or replay") } + store.Set(types.LastObservedEventNonceKey, types.UInt64Bytes(nonce)) return nil } @@ -528,3 +539,25 @@ func (k Keeper) IterateValidatorLastEventNonces(ctx context.Context, chainRefere } return nil } + +// GetLatestCompassID returns the latest compass ID on record after +// message attestation +func (k Keeper) GetLatestCompassID( + ctx context.Context, + chainReferenceID string, +) string { + store := k.GetStore(ctx, chainReferenceID) + bytes := store.Get(types.LatestCompassIDKey) + + return string(bytes) +} + +// setLatestCompassID stores the latest compass ID received +func (k Keeper) setLatestCompassID( + ctx context.Context, + chainReferenceID string, + compassID string, +) { + store := k.GetStore(ctx, chainReferenceID) + store.Set(types.LatestCompassIDKey, []byte(compassID)) +} diff --git a/x/skyway/keeper/batch.go b/x/skyway/keeper/batch.go index 6a386179..6a75ccf0 100644 --- a/x/skyway/keeper/batch.go +++ b/x/skyway/keeper/batch.go @@ -51,12 +51,24 @@ func (k Keeper) BuildOutgoingTXBatch( return nil, err } - assignee, err := k.EVMKeeper.PickValidatorForMessage(ctx, chainReferenceID, nil) + assignee, _, err := k.EVMKeeper.PickValidatorForMessage(ctx, chainReferenceID, nil) if err != nil { return nil, err } - batch, err := types.NewInternalOutgingTxBatch(nextID, k.getBatchTimeoutHeight(ctx), selectedTxs, contract, 0, chainReferenceID, turnstoneID, assignee) + assigneeValAddr, err := sdk.ValAddressFromBech32(assignee) + if err != nil { + return nil, fmt.Errorf("invalid validator address: %w", err) + } + assigneeRemoteAddress, found, err := k.GetEthAddressByValidator(ctx, assigneeValAddr, chainReferenceID) + if err != nil { + return nil, fmt.Errorf("failed to get remote address by validator: %w", err) + } + if !found { + return nil, fmt.Errorf("no remote address found for validator %s", assignee) + } + + batch, err := types.NewInternalOutgingTxBatch(nextID, k.getBatchTimeoutHeight(ctx), selectedTxs, contract, 0, chainReferenceID, turnstoneID, assignee, assigneeRemoteAddress, 0) if err != nil { return nil, sdkerrors.Wrap(err, "unable to create batch") } @@ -95,7 +107,15 @@ func (k Keeper) getBatchTimeoutHeight(ctx context.Context) uint64 { // OutgoingTxBatchExecuted is run when the Cosmos chain detects that a batch has been executed on Ethereum // It frees all the transactions in the batch -func (k Keeper) OutgoingTxBatchExecuted(ctx context.Context, tokenContract types.EthAddress, claim types.MsgBatchSendToRemoteClaim) error { +func (k Keeper) OutgoingTxBatchExecuted(c context.Context, tokenContract types.EthAddress, claim types.MsgBatchSendToRemoteClaim) (err error) { + ctx, commit := sdk.UnwrapSDKContext(c).CacheContext() + defer func() { + // Make sure all changes succeed before committing + if err == nil { + commit() + } + }() + b, err := k.GetOutgoingTXBatch(ctx, tokenContract, claim.BatchNonce) if err != nil { return err @@ -104,7 +124,7 @@ func (k Keeper) OutgoingTxBatchExecuted(ctx context.Context, tokenContract types return fmt.Errorf("unknown batch nonce for outgoing tx batch %s %d", tokenContract.GetAddress().Hex(), claim.BatchNonce) } if b.BatchTimeout <= claim.EthBlockHeight { - return fmt.Errorf("Batch with nonce %d submitted after it timed out (submission %d >= timeout %d)?", claim.BatchNonce, claim.EthBlockHeight, b.BatchTimeout) + return fmt.Errorf("batch with nonce %d submitted after it timed out (submission %d >= timeout %d)?", claim.BatchNonce, claim.EthBlockHeight, b.BatchTimeout) } totalToBurn := math.NewInt(0) @@ -130,7 +150,12 @@ func (k Keeper) OutgoingTxBatchExecuted(ctx context.Context, tokenContract types return err } - return k.DeleteBatchConfirms(ctx, *b) + err = k.DeleteBatchConfirms(ctx, *b) + if err != nil { + return err + } + + return k.DeleteBatchGasEstimates(ctx, *b) } // StoreBatch stores a transaction batch, it will refuse to overwrite an existing @@ -150,6 +175,50 @@ func (k Keeper) StoreBatch(ctx context.Context, batch types.InternalOutgoingTxBa return nil } +// UpdateBatchGasEstimate updates the gas estimate for a batch +func (k Keeper) UpdateBatchGasEstimate(c context.Context, batch types.InternalOutgoingTxBatch, estimate uint64) (err error) { + ctx, commit := sdk.UnwrapSDKContext(c).CacheContext() + defer func() { + // Make sure all changes succeed before committing + // Only set gas value if batch confirms successfully remove + if err == nil { + commit() + } + }() + if err := batch.ValidateBasic(); err != nil { + return sdkerrors.Wrap(err, "attempted to update invalid batch") + } + entity, err := k.GetOutgoingTXBatch(ctx, batch.TokenContract, batch.BatchNonce) + if err != nil { + return fmt.Errorf("failed to get batch from store: %w", err) + } + if entity == nil { + return fmt.Errorf("batch not found") + } + if entity.GasEstimate > 0 { + return fmt.Errorf("batch gas estimate already set") + } + // Update estimate + entity.GasEstimate = estimate + + // Recalculate the checkpoint and store on batch + ci, err := k.EVMKeeper.GetChainInfo(ctx, batch.ChainReferenceID) + if err != nil { + return fmt.Errorf("failed to get chain info: %w", err) + } + bts, err := entity.GetCheckpoint(string(ci.SmartContractUniqueID)) + if err != nil { + return fmt.Errorf("failed to get checkpoint: %w", err) + } + entity.BytesToSign = bts + + store := k.GetStore(ctx, types.StoreModulePrefix) + key := types.GetOutgoingTxBatchKey(batch.TokenContract, batch.BatchNonce) + externalBatch := entity.ToExternal() + store.Set(key, k.cdc.MustMarshal(&externalBatch)) + return k.DeleteBatchConfirms(ctx, batch) +} + // DeleteBatch deletes an outgoing transaction batch func (k Keeper) DeleteBatch(ctx context.Context, batch types.InternalOutgoingTxBatch) error { if err := batch.ValidateBasic(); err != nil { @@ -220,7 +289,14 @@ func (k Keeper) GetOutgoingTXBatch(ctx context.Context, tokenContract types.EthA } // CancelOutgoingTXBatch releases all TX in the batch and deletes the batch -func (k Keeper) CancelOutgoingTXBatch(ctx context.Context, tokenContract types.EthAddress, nonce uint64) error { +func (k Keeper) CancelOutgoingTXBatch(c context.Context, tokenContract types.EthAddress, nonce uint64) (err error) { + ctx, commit := sdk.UnwrapSDKContext(c).CacheContext() + defer func() { + // Make sure all changes succeed before committing + if err == nil { + commit() + } + }() batch, err := k.GetOutgoingTXBatch(ctx, tokenContract, nonce) if err != nil { return err @@ -247,6 +323,12 @@ func (k Keeper) CancelOutgoingTXBatch(ctx context.Context, tokenContract types.E return err } + // Delete its gas estimates as well + err = k.DeleteBatchGasEstimates(ctx, *batch) + if err != nil { + return err + } + ci, err := k.EVMKeeper.GetChainInfo(ctx, batch.ChainReferenceID) if err != nil { return err diff --git a/x/skyway/keeper/genesis.go b/x/skyway/keeper/genesis.go index f86e1ae8..ea4d43d1 100644 --- a/x/skyway/keeper/genesis.go +++ b/x/skyway/keeper/genesis.go @@ -33,6 +33,14 @@ func initBridgeDataFromGenesis(ctx context.Context, k Keeper, data types.Genesis panic(err) } } + + // reset batch gas estimates in state + for _, estimate := range data.BatchGasEstimates { + _, err := k.SetBatchGasEstimate(ctx, &estimate) + if err != nil { + panic(err) + } + } } // InitGenesis starts a chain from a genesis state @@ -176,11 +184,12 @@ func ExportGenesis(ctx context.Context, k Keeper) types.GenesisState { } var ( - p = k.GetParams(ctx) - batchconfs = []types.MsgConfirmBatch{} - attestations = []types.Attestation{} - erc20ToDenoms = []types.ERC20ToDenom{} - nonces = []types.SkywayNonces{} + p = k.GetParams(ctx) + batchconfs = []types.MsgConfirmBatch{} + batchestimates = []types.MsgEstimateBatchGas{} + attestations = []types.Attestation{} + erc20ToDenoms = []types.ERC20ToDenom{} + nonces = []types.SkywayNonces{} ) lastSlashedBlock, err := k.GetLastSlashedBatchBlock(ctx) @@ -230,8 +239,13 @@ func ExportGenesis(ctx context.Context, k Keeper) types.GenesisState { if err != nil { panic(err) } - batchconfs = append(batchconfs, - batchConfirms...) + estimates, err := k.GetBatchGasEstimateByNonceAndTokenContract(ctx, batch.BatchNonce, batch.TokenContract) + if err != nil { + panic(err) + } + batchconfs = append(batchconfs, batchConfirms...) + batchestimates = append(batchestimates, estimates...) + extBatches[i] = batch.ToExternal() } @@ -265,6 +279,7 @@ func ExportGenesis(ctx context.Context, k Keeper) types.GenesisState { SkywayNonces: nonces, Batches: extBatches, BatchConfirms: batchconfs, + BatchGasEstimates: batchestimates, Attestations: attestations, Erc20ToDenoms: erc20ToDenoms, UnbatchedTransfers: unbatchedTxs, diff --git a/x/skyway/keeper/grpc_query.go b/x/skyway/keeper/grpc_query.go index 62367cef..04686402 100644 --- a/x/skyway/keeper/grpc_query.go +++ b/x/skyway/keeper/grpc_query.go @@ -101,9 +101,15 @@ func (k Keeper) OutgoingTxBatches( reqChainReferenceID := req.ChainReferenceId batchAssignee := batch.Assignee reqAssignee := req.Assignee + // Skip batches with no gas estimate + if batch.GasEstimate < 1 { + return false + } + // Skip batches with mismatching chain reference ID if reqChainReferenceID != "" && batchChainReferenceID != reqChainReferenceID { return false } + // Skip batches with mismatching assignee if reqAssignee != "" && batchAssignee != reqAssignee { return false } @@ -387,3 +393,38 @@ func (k Keeper) GetPendingSendToRemote( return &res, nil } + +func (k Keeper) LastPendingBatchForGasEstimation(ctx context.Context, req *types.QueryLastPendingBatchForGasEstimationRequest) (*types.QueryLastPendingBatchForGasEstimationResponse, error) { + var pendingBatchReq types.InternalOutgoingTxBatches + + found := false + err := k.IterateOutgoingTxBatches(sdk.UnwrapSDKContext(ctx), func(_ []byte, batch types.InternalOutgoingTxBatch) bool { + // Filter out batches that don't match the chain reference ID + if batch.ChainReferenceID != req.ChainReferenceId { + return false + } + + estimate, err := k.GetBatchGasEstimate(sdk.UnwrapSDKContext(ctx), batch.BatchNonce, batch.TokenContract, req.Address) + if err != nil { + return false + } + foundConfirm := estimate != nil + if !foundConfirm { + pendingBatchReq = append(pendingBatchReq, batch) + found = true + + return true + } + + return false + }) + if err != nil { + return nil, err + } + if found { + ref := pendingBatchReq.ToExternalArray() + return &types.QueryLastPendingBatchForGasEstimationResponse{Batch: ref}, nil + } + + return &types.QueryLastPendingBatchForGasEstimationResponse{Batch: nil}, nil +} diff --git a/x/skyway/keeper/grpc_query_test.go b/x/skyway/keeper/grpc_query_test.go index 60f81c93..b9682d5f 100644 --- a/x/skyway/keeper/grpc_query_test.go +++ b/x/skyway/keeper/grpc_query_test.go @@ -77,6 +77,7 @@ func TestLastPendingBatchRequest(t *testing.T) { got.Batch[0].BatchTimeout = 0 got.Batch[0].BytesToSign = nil got.Batch[0].Assignee = "" + got.Batch[0].AssigneeRemoteAddress = nil assert.Equal(t, &spec.expResp, got, got) }) @@ -231,6 +232,7 @@ func TestQueryBatch(t *testing.T) { batch.Batch.BatchTimeout = 0 batch.Batch.BytesToSign = nil batch.Batch.Assignee = "" + batch.Batch.AssigneeRemoteAddress = nil assert.Equal(t, &expectedRes, batch, batch) } @@ -256,9 +258,31 @@ func TestLastBatchesRequest(t *testing.T) { }) require.NoError(t, err) + // Should have no batches, since no gas estimates are set + require.Len(t, lastBatches.Batches, 0) + + // Make sure gas is set, otherwise we don't hand it out for relaying + oldCheckpoints := make(map[uint64][]byte) + k.IterateOutgoingTxBatches(ctx, func(key []byte, batch types.InternalOutgoingTxBatch) bool { + oldCheckpoints[batch.BatchNonce] = batch.BytesToSign + k.UpdateBatchGasEstimate(ctx, batch, 21_000) + return false + }) + // Make sure the bytes to sign are changed after updating the gas estimate + k.IterateOutgoingTxBatches(ctx, func(key []byte, batch types.InternalOutgoingTxBatch) bool { + require.NotEqual(t, oldCheckpoints[batch.BatchNonce], batch.BytesToSign, "should have changed the bytes to sign") + return false + }) + + lastBatches, err = k.OutgoingTxBatches(ctx, &types.QueryOutgoingTxBatchesRequest{ + ChainReferenceId: "test-chain", + }) + require.NoError(t, err) + expectedRes := types.QueryOutgoingTxBatchesResponse{ Batches: []types.OutgoingTxBatch{ { + GasEstimate: 21_000, Transactions: []types.OutgoingTransferTx{ { DestAddress: "0x320915BD0F1bad11cBf06e85D5199DBcAC4E9934", @@ -300,6 +324,7 @@ func TestLastBatchesRequest(t *testing.T) { ChainReferenceId: "test-chain", }, { + GasEstimate: 21_000, Transactions: []types.OutgoingTransferTx{ { DestAddress: "0x320915BD0F1bad11cBf06e85D5199DBcAC4E9934", @@ -336,9 +361,11 @@ func TestLastBatchesRequest(t *testing.T) { lastBatches.Batches[0].BatchTimeout = 0 lastBatches.Batches[0].BytesToSign = nil lastBatches.Batches[0].Assignee = "" + lastBatches.Batches[0].AssigneeRemoteAddress = nil lastBatches.Batches[1].BatchTimeout = 0 lastBatches.Batches[1].BytesToSign = nil lastBatches.Batches[1].Assignee = "" + lastBatches.Batches[1].AssigneeRemoteAddress = nil assert.Equal(t, &expectedRes, lastBatches, "json is equal") } diff --git a/x/skyway/keeper/invariants.go b/x/skyway/keeper/invariants.go index 8e36014e..b8d9982a 100644 --- a/x/skyway/keeper/invariants.go +++ b/x/skyway/keeper/invariants.go @@ -275,7 +275,7 @@ func ValidateStore(ctx sdk.Context, k Keeper) error { k.IterateBatchConfirms(ctx, func(key []byte, confirm types.MsgConfirmBatch) (stop bool) { err = confirm.ValidateBasic() if err != nil { - err = fmt.Errorf("invalid batch confirm %v under key %v in IterateBatchConfirms: %v", confirm, key, err) + err = fmt.Errorf("invalid batch confirm %+v under key %v in IterateBatchConfirms: %w", confirm, key, err) return true } return false @@ -284,6 +284,19 @@ func ValidateStore(ctx sdk.Context, k Keeper) error { return err } // SequenceKeyPrefix HAS BEEN REMOVED + // + // BatchGasEstimateKey + k.IterateBatchGasEstimates(ctx, func(key []byte, estimate types.MsgEstimateBatchGas) (stop bool) { + err = estimate.ValidateBasic() + if err != nil { + err = fmt.Errorf("invalid gas estimate %+v under key %v in IterateBatchGasEstimates: %w", estimate, key, err) + return true + } + return false + }) + if err != nil { + return err + } // KeyLastTXPoolID (type checked when fetching) _, err = k.getID(ctx, types.KeyLastTXPoolID) diff --git a/x/skyway/keeper/keeper.go b/x/skyway/keeper/keeper.go index b6ca0631..716543a4 100644 --- a/x/skyway/keeper/keeper.go +++ b/x/skyway/keeper/keeper.go @@ -20,6 +20,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + "github.com/palomachain/paloma/util/eventbus" keeperutil "github.com/palomachain/paloma/util/keeper" "github.com/palomachain/paloma/util/liblog" "github.com/palomachain/paloma/x/skyway/types" @@ -88,6 +89,39 @@ func NewKeeper( attestationHandler.ValidateMembers() k.AttestationHandler = attestationHandler k.authority = authority + + eventbus.EVMActivatedChain().Subscribe( + "skyway-keeper", + func(ctx context.Context, e eventbus.EVMActivatedChainEvent) error { + logger := liblog.FromKeeper(ctx, k). + WithComponent("skyway-activated-chain-callback"). + WithFields( + "chain_reference_id", e.ChainReferenceID, + "smart_contract_unique_id", string(e.SmartContractUniqueID), + ) + + k.setLatestCompassID(ctx, e.ChainReferenceID, string(e.SmartContractUniqueID)) + + err := k.setLastObservedSkywayNonce(ctx, e.ChainReferenceID, 0) + if err != nil { + logger.WithError(err).Warn("Failed to reset skyway nonce") + return err + } + + err = k.IterateValidatorLastEventNonces(ctx, e.ChainReferenceID, func(key []byte, _ uint64) bool { + store := k.GetStore(ctx, e.ChainReferenceID) + store.Delete(key) + return false + }) + if err != nil { + logger.WithError(err).Warn("Failed to reset validator skyway nonces") + return err + } + + logger.Info("Updated last observed nonce successfully") + return nil + }) + return k } diff --git a/x/skyway/keeper/keeper_estimates.go b/x/skyway/keeper/keeper_estimates.go new file mode 100644 index 00000000..fdeb510c --- /dev/null +++ b/x/skyway/keeper/keeper_estimates.go @@ -0,0 +1,133 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/util/liblog" + "github.com/palomachain/paloma/x/skyway/types" +) + +func (k Keeper) GetBatchGasEstimate(ctx context.Context, nonce uint64, tokenContract types.EthAddress, validator sdk.ValAddress) (*types.MsgEstimateBatchGas, error) { + store := k.GetStore(ctx, types.StoreModulePrefix) + if err := sdk.VerifyAddressFormat(validator); err != nil { + liblog.FromKeeper(ctx, k).WithError(err).Error("invalid validator address") + return nil, nil + } + batchGasEstimateKey, err := types.GetBatchGasEstimateKey(tokenContract, nonce, validator) + if err != nil { + return nil, err + } + entity := store.Get(batchGasEstimateKey) + if entity == nil { + return nil, nil + } + estimate := types.MsgEstimateBatchGas{ + Nonce: nonce, + TokenContract: tokenContract.GetAddress().Hex(), + EthSigner: "", + Estimate: 0, + } + k.cdc.MustUnmarshal(entity, &estimate) + return &estimate, nil +} + +func (k Keeper) SetBatchGasEstimate(ctx context.Context, estimate *types.MsgEstimateBatchGas) ([]byte, error) { + store := k.GetStore(ctx, types.StoreModulePrefix) + addr, err := sdk.AccAddressFromBech32(estimate.Metadata.Creator) + if err != nil { + return nil, fmt.Errorf("invalid validator address: %s: %w", estimate.Metadata.Creator, err) + } + contract, err := types.NewEthAddress(estimate.TokenContract) + if err != nil { + return nil, fmt.Errorf("invalid token address: %s :%w", estimate.Metadata.Creator, err) + } + key, err := types.GetBatchGasEstimateKey(*contract, estimate.Nonce, sdk.ValAddress(addr)) + if err != nil { + return nil, err + } + entity := store.Get(key) + if entity != nil { + return nil, fmt.Errorf("estimate already exists: %s", key) + } + store.Set(key, k.cdc.MustMarshal(estimate)) + return key, nil +} + +func (k Keeper) DeleteBatchGasEstimates(ctx context.Context, batch types.InternalOutgoingTxBatch) error { + store := k.GetStore(ctx, types.StoreModulePrefix) + batchGasEstimates, err := k.GetBatchGasEstimateByNonceAndTokenContract(ctx, batch.BatchNonce, batch.TokenContract) + if err != nil { + return err + } + for _, confirm := range batchGasEstimates { + sender, err := sdk.AccAddressFromBech32(confirm.Metadata.Creator) + if err != nil { + return err + } + confirmKey, err := types.GetBatchGasEstimateKey(batch.TokenContract, batch.BatchNonce, sdk.ValAddress(sender)) + if err != nil { + return err + } + if store.Has(confirmKey) { + store.Delete(confirmKey) + } + } + return nil +} + +func (k Keeper) IterateBatchGasEstimateByNonceAndTokenContract(ctx context.Context, nonce uint64, tokenContract types.EthAddress, cb func([]byte, types.MsgEstimateBatchGas) bool) error { + store := k.GetStore(ctx, types.StoreModulePrefix) + prefix := types.GetBatchGasEstimateNonceContractPrefix(tokenContract, nonce) + start, end, err := prefixRange(prefix) + if err != nil { + return err + } + iter := store.Iterator(start, end) + + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + estimate := types.MsgEstimateBatchGas{ + Nonce: nonce, + TokenContract: tokenContract.GetAddress().Hex(), + EthSigner: "", + Estimate: 0, + } + k.cdc.MustUnmarshal(iter.Value(), &estimate) + // cb returns true to stop early + if cb(iter.Key(), estimate) { + break + } + } + return nil +} + +func (k Keeper) GetBatchGasEstimateByNonceAndTokenContract(ctx context.Context, nonce uint64, tokenContract types.EthAddress) (out []types.MsgEstimateBatchGas, err error) { + err = k.IterateBatchGasEstimateByNonceAndTokenContract(ctx, nonce, tokenContract, func(_ []byte, msg types.MsgEstimateBatchGas) bool { + out = append(out, msg) + return false + }) + return +} + +// TODO: NEEDED? +func (k Keeper) IterateBatchGasEstimates(ctx context.Context, cb func([]byte, types.MsgEstimateBatchGas) (stop bool)) { + store := k.GetStore(ctx, types.StoreModulePrefix) + prefixStore := prefix.NewStore(store, types.BatchGasEstimateKey) + iter := prefixStore.Iterator(nil, nil) + + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + var estimate types.MsgEstimateBatchGas + k.cdc.MustUnmarshal(iter.Value(), &estimate) + + // cb returns true to stop early + if cb(iter.Key(), estimate) { + break + } + } +} diff --git a/x/skyway/keeper/msg_server.go b/x/skyway/keeper/msg_server.go index 3e8e8d50..3f28811c 100644 --- a/x/skyway/keeper/msg_server.go +++ b/x/skyway/keeper/msg_server.go @@ -119,23 +119,12 @@ func (k msgServer) ConfirmBatch(c context.Context, msg *types.MsgConfirmBatch) ( // checkOrchestratorValidatorInSet checks that the orchestrator refers to a validator that is // currently in the set func (k msgServer) checkOrchestratorValidatorInSet(ctx context.Context, orchestrator string) error { - orchaddr, err := sdk.AccAddressFromBech32(orchestrator) - if err != nil { - return sdkerrors.Wrap(types.ErrInvalid, "acc address invalid") - } - validator, found, err := k.GetOrchestratorValidator(ctx, orchaddr) - if err != nil { - return err - } - if !found { - return sdkerrors.Wrap(types.ErrUnknown, "validator") - } - valAddress, err := utilkeeper.ValAddressFromBech32(k.AddressCodec, validator.GetOperator()) + valAddr, err := k.valAddressFromAccAddress(ctx, orchestrator) if err != nil { return err } // return an error if the validator isn't in the active set - val, err := k.StakingKeeper.Validator(ctx, valAddress) + val, err := k.StakingKeeper.Validator(ctx, valAddr) if err != nil { return err } @@ -146,6 +135,22 @@ func (k msgServer) checkOrchestratorValidatorInSet(ctx context.Context, orchestr return nil } +func (k msgServer) valAddressFromAccAddress(ctx context.Context, address string) (sdk.ValAddress, error) { + orchaddr, err := sdk.AccAddressFromBech32(address) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrInvalid, "acc address invalid") + } + validator, found, err := k.GetOrchestratorValidator(ctx, orchaddr) + if err != nil { + return nil, err + } + if !found { + return nil, sdkerrors.Wrap(types.ErrUnknown, "validator") + } + + return utilkeeper.ValAddressFromBech32(k.AddressCodec, validator.GetOperator()) +} + // claimHandlerCommon is an internal function that provides common code for processing claims once they are // translated from the message to the Ethereum claim interface func (k msgServer) claimHandlerCommon(ctx context.Context, msgAny *codectypes.Any, msg types.EthereumClaim) error { @@ -359,3 +364,55 @@ func (k msgServer) LightNodeSaleClaim( return &emptypb.Empty{}, nil } + +func (k msgServer) EstimateBatchGas( + c context.Context, + msg *types.MsgEstimateBatchGas, +) (*emptypb.Empty, error) { + ctx := sdk.UnwrapSDKContext(c) + valAddr, err := k.valAddressFromAccAddress(ctx, msg.Metadata.Creator) + if err != nil { + return nil, fmt.Errorf("invalid validator address: %w", err) + } + + if err := msg.ValidateBasic(); err != nil { + return nil, sdkerrors.Wrap(err, "invalid MsgConfirmBatch") + } + contract, err := types.NewEthAddress(msg.TokenContract) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrInvalid, "eth address invalid") + } + + if err := k.checkOrchestratorValidatorInSet(ctx, msg.Metadata.Creator); err != nil { + return nil, fmt.Errorf("cannot accept esimtate from inactive validator: %w", err) + } + + // fetch the outgoing batch given the nonce + batch, err := k.GetOutgoingTXBatch(ctx, *contract, msg.Nonce) + if err != nil { + return nil, err + } + if batch == nil { + return nil, sdkerrors.Wrap(types.ErrInvalid, "couldn't find batch") + } + + // check if we already have this estimate + estimate, err := k.GetBatchGasEstimate(ctx, msg.Nonce, *contract, valAddr) + if err != nil { + return nil, err + } + if estimate != nil { + return nil, sdkerrors.Wrap(types.ErrDuplicate, "gas estimate already received from sender") + } + key, err := k.SetBatchGasEstimate(ctx, msg) + if err != nil { + return nil, err + } + + return &emptypb.Empty{}, ctx.EventManager().EmitTypedEvent( + &types.EventBatchConfirmKey{ + Message: msg.Type(), + BatchConfirmKey: string(key), + }, + ) +} diff --git a/x/skyway/keeper/test_common.go b/x/skyway/keeper/test_common.go index a11409fc..996973a7 100644 --- a/x/skyway/keeper/test_common.go +++ b/x/skyway/keeper/test_common.go @@ -726,6 +726,7 @@ func CreateTestEnv(t *testing.T) TestInput { getSubspace(paramsKeeper, consensustypes.ModuleName), valsetKeeper, consensusRegistry, + nil, ) var evmKeeper *evmkeeper.Keeper = &evmkeeper.Keeper{} diff --git a/x/skyway/module.go b/x/skyway/module.go index f4af2b63..b18f129e 100644 --- a/x/skyway/module.go +++ b/x/skyway/module.go @@ -15,6 +15,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/palomachain/paloma/util/libcons" "github.com/palomachain/paloma/x/skyway/client/cli" "github.com/palomachain/paloma/x/skyway/exported" "github.com/palomachain/paloma/x/skyway/keeper" @@ -102,8 +103,9 @@ func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry // AppModule object for module implementation type AppModule struct { AppModuleBasic - keeper keeper.Keeper - bankKeeper bankkeeper.Keeper + keeper keeper.Keeper + bankKeeper bankkeeper.Keeper + consensusChecker *libcons.ConsensusChecker // legacySubspace is used solely for migration of x/skyway managed parameters legacySubspace exported.Subspace @@ -121,12 +123,14 @@ func NewAppModule( k keeper.Keeper, bankKeeper bankkeeper.Keeper, ss exported.Subspace, + consensusChecker *libcons.ConsensusChecker, ) AppModule { return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: k, - bankKeeper: bankKeeper, - legacySubspace: ss, + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: k, + bankKeeper: bankKeeper, + legacySubspace: ss, + consensusChecker: consensusChecker, } } @@ -172,8 +176,13 @@ func (am AppModule) BeginBlock(ctx context.Context) error { // EndBlock implements app module func (am AppModule) EndBlock(ctx context.Context) error { + defer func() { + if r := recover(); r != nil { + am.keeper.Logger(ctx).Error(fmt.Sprintf("panic in EndBlock: %v", r)) + } + }() sdkCtx := sdk.UnwrapSDKContext(ctx) - EndBlocker(sdkCtx, am.keeper) + EndBlocker(sdkCtx, am.keeper, am.consensusChecker) return nil } diff --git a/x/skyway/types/batch.go b/x/skyway/types/batch.go index 70a912f5..a7ef1f7a 100644 --- a/x/skyway/types/batch.go +++ b/x/skyway/types/batch.go @@ -9,10 +9,14 @@ import ( "github.com/VolumeFi/whoops" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/accounts/abi" - gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" ) +const ( + cConservativeDummyGasEstimate = 300_000 +) + func (o OutgoingTransferTx) ToInternal() (*InternalOutgoingTransferTx, error) { return NewInternalOutgoingTransferTx(o.Id, o.Sender, o.DestAddress, o.Erc20Token, o.BridgeTaxAmount) @@ -83,14 +87,16 @@ type InternalOutgoingTxBatches []InternalOutgoingTxBatch // InternalOutgoingTxBatch is an internal duplicate of OutgoingTxBatch with validation type InternalOutgoingTxBatch struct { - BatchNonce uint64 - BatchTimeout uint64 - Transactions []*InternalOutgoingTransferTx - TokenContract EthAddress - PalomaBlockCreated uint64 - ChainReferenceID string - BytesToSign []byte - Assignee string + BatchNonce uint64 + BatchTimeout uint64 + Transactions []*InternalOutgoingTransferTx + TokenContract EthAddress + PalomaBlockCreated uint64 + ChainReferenceID string + BytesToSign []byte + Assignee string + GasEstimate uint64 + AssigneeRemoteAddress common.Address } func NewInternalOutgingTxBatch( @@ -102,15 +108,19 @@ func NewInternalOutgingTxBatch( chainReferenceID string, turnstoneID string, assignee string, + assigneeRemoteAddress *EthAddress, + gasEstimate uint64, ) (*InternalOutgoingTxBatch, error) { ret := &InternalOutgoingTxBatch{ - BatchNonce: nonce, - BatchTimeout: timeout, - Transactions: transactions, - TokenContract: contract, - PalomaBlockCreated: blockCreated, - ChainReferenceID: chainReferenceID, - Assignee: assignee, + BatchNonce: nonce, + BatchTimeout: timeout, + Transactions: transactions, + TokenContract: contract, + PalomaBlockCreated: blockCreated, + ChainReferenceID: chainReferenceID, + Assignee: assignee, + GasEstimate: gasEstimate, + AssigneeRemoteAddress: assigneeRemoteAddress.GetAddress(), } bytesToSign, err := ret.GetCheckpoint(turnstoneID) if err != nil { @@ -139,14 +149,16 @@ func NewInternalOutgingTxBatchFromExternalBatch(batch OutgoingTxBatch) (*Interna } intBatch := InternalOutgoingTxBatch{ - BatchNonce: batch.BatchNonce, - BatchTimeout: batch.BatchTimeout, - Transactions: txs, - TokenContract: *contractAddr, - PalomaBlockCreated: batch.PalomaBlockCreated, - ChainReferenceID: batch.ChainReferenceId, - BytesToSign: batch.BytesToSign, - Assignee: batch.Assignee, + BatchNonce: batch.BatchNonce, + BatchTimeout: batch.BatchTimeout, + Transactions: txs, + TokenContract: *contractAddr, + PalomaBlockCreated: batch.PalomaBlockCreated, + ChainReferenceID: batch.ChainReferenceId, + BytesToSign: batch.BytesToSign, + Assignee: batch.Assignee, + AssigneeRemoteAddress: common.BytesToAddress(batch.AssigneeRemoteAddress), + GasEstimate: batch.GasEstimate, } return &intBatch, nil } @@ -161,14 +173,16 @@ func (i *InternalOutgoingTxBatch) ToExternal() OutgoingTxBatch { txs[i] = tx.ToExternal() } return OutgoingTxBatch{ - BatchNonce: i.BatchNonce, - BatchTimeout: i.BatchTimeout, - Transactions: txs, - TokenContract: i.TokenContract.GetAddress().Hex(), - PalomaBlockCreated: i.PalomaBlockCreated, - ChainReferenceId: i.ChainReferenceID, - BytesToSign: i.BytesToSign, - Assignee: i.Assignee, + BatchNonce: i.BatchNonce, + BatchTimeout: i.BatchTimeout, + Transactions: txs, + TokenContract: i.TokenContract.GetAddress().Hex(), + PalomaBlockCreated: i.PalomaBlockCreated, + ChainReferenceId: i.ChainReferenceID, + BytesToSign: i.BytesToSign, + Assignee: i.Assignee, + GasEstimate: i.GasEstimate, + AssigneeRemoteAddress: i.AssigneeRemoteAddress.Bytes(), } } @@ -182,14 +196,16 @@ func (i *InternalOutgoingTxBatches) ToExternalArray() []OutgoingTxBatch { } arr = append(arr, OutgoingTxBatch{ - BatchNonce: val.BatchNonce, - BatchTimeout: val.BatchTimeout, - Transactions: txs, - TokenContract: val.TokenContract.GetAddress().Hex(), - PalomaBlockCreated: val.PalomaBlockCreated, - ChainReferenceId: val.ChainReferenceID, - BytesToSign: val.BytesToSign, - Assignee: val.Assignee, + BatchNonce: val.BatchNonce, + BatchTimeout: val.BatchTimeout, + Transactions: txs, + TokenContract: val.TokenContract.GetAddress().Hex(), + PalomaBlockCreated: val.PalomaBlockCreated, + ChainReferenceId: val.ChainReferenceID, + BytesToSign: val.BytesToSign, + Assignee: val.Assignee, + GasEstimate: val.GasEstimate, + AssigneeRemoteAddress: val.AssigneeRemoteAddress.Bytes(), }) } @@ -243,6 +259,10 @@ func (i InternalOutgoingTxBatch) GetCheckpoint(turnstoneID string) ([]byte, erro {Type: whoops.Must(abi.NewType("bytes32", "", nil))}, // deadline {Type: whoops.Must(abi.NewType("uint256", "", nil))}, + // relayer eth address + {Type: whoops.Must(abi.NewType("address", "", nil))}, + // gas estimate + {Type: whoops.Must(abi.NewType("uint256", "", nil))}, } var turnstoneBytes32 [32]byte @@ -256,26 +276,33 @@ func (i InternalOutgoingTxBatch) GetCheckpoint(turnstoneID string) ([]byte, erro // Run through the elements of the batch and serialize them txAmounts := make([]*big.Int, len(i.Transactions)) - txDestinations := make([]gethcommon.Address, len(i.Transactions)) + txDestinations := make([]common.Address, len(i.Transactions)) for j, tx := range i.Transactions { txAmounts[j] = tx.Erc20Token.Amount.BigInt() txDestinations[j] = tx.DestAddress.GetAddress() } args := struct { - Receiver []gethcommon.Address + Receiver []common.Address Amount []*big.Int }{ Receiver: txDestinations, Amount: txAmounts, } + estimate := big.NewInt(cConservativeDummyGasEstimate) + if i.GasEstimate != 0 { + estimate.SetUint64(i.GasEstimate) + } + abiEncodedBatch, err := arguments.Pack( i.TokenContract.GetAddress(), args, big.NewInt(int64(i.BatchNonce)), turnstoneBytes32, big.NewInt(int64(i.BatchTimeout)), + i.AssigneeRemoteAddress, + estimate, ) // this should never happen outside of test since any case that could crash on encoding // should be filtered above. diff --git a/x/skyway/types/batch.pb.go b/x/skyway/types/batch.pb.go index 82f0028a..275a003a 100644 --- a/x/skyway/types/batch.pb.go +++ b/x/skyway/types/batch.pb.go @@ -4,19 +4,22 @@ package types import ( - cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + cosmossdk_io_math "cosmossdk.io/math" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -24,16 +27,18 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// OutgoingTxBatch represents a batch of transactions going from skyway to ETH +// OutgoingTxBatch represents a batch of transactions going from Paloma to remote chain type OutgoingTxBatch struct { - BatchNonce uint64 `protobuf:"varint,1,opt,name=batch_nonce,json=batchNonce,proto3" json:"batch_nonce,omitempty"` - BatchTimeout uint64 `protobuf:"varint,2,opt,name=batch_timeout,json=batchTimeout,proto3" json:"batch_timeout,omitempty"` - Transactions []OutgoingTransferTx `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions"` - TokenContract string `protobuf:"bytes,4,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"` - PalomaBlockCreated uint64 `protobuf:"varint,5,opt,name=paloma_block_created,json=palomaBlockCreated,proto3" json:"paloma_block_created,omitempty"` - ChainReferenceId string `protobuf:"bytes,6,opt,name=chain_reference_id,json=chainReferenceId,proto3" json:"chain_reference_id,omitempty"` - BytesToSign []byte `protobuf:"bytes,7,opt,name=bytes_to_sign,json=bytesToSign,proto3" json:"bytes_to_sign,omitempty"` - Assignee string `protobuf:"bytes,8,opt,name=assignee,proto3" json:"assignee,omitempty"` + BatchNonce uint64 `protobuf:"varint,1,opt,name=batch_nonce,json=batchNonce,proto3" json:"batch_nonce,omitempty"` + BatchTimeout uint64 `protobuf:"varint,2,opt,name=batch_timeout,json=batchTimeout,proto3" json:"batch_timeout,omitempty"` + Transactions []OutgoingTransferTx `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions"` + TokenContract string `protobuf:"bytes,4,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"` + PalomaBlockCreated uint64 `protobuf:"varint,5,opt,name=paloma_block_created,json=palomaBlockCreated,proto3" json:"paloma_block_created,omitempty"` + ChainReferenceId string `protobuf:"bytes,6,opt,name=chain_reference_id,json=chainReferenceId,proto3" json:"chain_reference_id,omitempty"` + BytesToSign []byte `protobuf:"bytes,7,opt,name=bytes_to_sign,json=bytesToSign,proto3" json:"bytes_to_sign,omitempty"` + Assignee string `protobuf:"bytes,8,opt,name=assignee,proto3" json:"assignee,omitempty"` + GasEstimate uint64 `protobuf:"varint,9,opt,name=gas_estimate,json=gasEstimate,proto3" json:"gas_estimate,omitempty"` + AssigneeRemoteAddress []byte `protobuf:"bytes,10,opt,name=assignee_remote_address,json=assigneeRemoteAddress,proto3" json:"assignee_remote_address,omitempty"` } func (m *OutgoingTxBatch) Reset() { *m = OutgoingTxBatch{} } @@ -42,9 +47,11 @@ func (*OutgoingTxBatch) ProtoMessage() {} func (*OutgoingTxBatch) Descriptor() ([]byte, []int) { return fileDescriptor_16a379404a8854af, []int{0} } + func (m *OutgoingTxBatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *OutgoingTxBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OutgoingTxBatch.Marshal(b, m, deterministic) @@ -57,12 +64,15 @@ func (m *OutgoingTxBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } + func (m *OutgoingTxBatch) XXX_Merge(src proto.Message) { xxx_messageInfo_OutgoingTxBatch.Merge(m, src) } + func (m *OutgoingTxBatch) XXX_Size() int { return m.Size() } + func (m *OutgoingTxBatch) XXX_DiscardUnknown() { xxx_messageInfo_OutgoingTxBatch.DiscardUnknown(m) } @@ -125,7 +135,21 @@ func (m *OutgoingTxBatch) GetAssignee() string { return "" } -// OutgoingTransferTx represents an individual send from skyway to ETH +func (m *OutgoingTxBatch) GetGasEstimate() uint64 { + if m != nil { + return m.GasEstimate + } + return 0 +} + +func (m *OutgoingTxBatch) GetAssigneeRemoteAddress() []byte { + if m != nil { + return m.AssigneeRemoteAddress + } + return nil +} + +// OutgoingTransferTx represents an individual send from Paloma to remote chain type OutgoingTransferTx struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` @@ -140,9 +164,11 @@ func (*OutgoingTransferTx) ProtoMessage() {} func (*OutgoingTransferTx) Descriptor() ([]byte, []int) { return fileDescriptor_16a379404a8854af, []int{1} } + func (m *OutgoingTransferTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *OutgoingTransferTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OutgoingTransferTx.Marshal(b, m, deterministic) @@ -155,12 +181,15 @@ func (m *OutgoingTransferTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *OutgoingTransferTx) XXX_Merge(src proto.Message) { xxx_messageInfo_OutgoingTransferTx.Merge(m, src) } + func (m *OutgoingTransferTx) XXX_Size() int { return m.Size() } + func (m *OutgoingTransferTx) XXX_DiscardUnknown() { xxx_messageInfo_OutgoingTransferTx.DiscardUnknown(m) } @@ -208,9 +237,11 @@ func (*EventOutgoingBatchCanceled) ProtoMessage() {} func (*EventOutgoingBatchCanceled) Descriptor() ([]byte, []int) { return fileDescriptor_16a379404a8854af, []int{2} } + func (m *EventOutgoingBatchCanceled) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *EventOutgoingBatchCanceled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventOutgoingBatchCanceled.Marshal(b, m, deterministic) @@ -223,12 +254,15 @@ func (m *EventOutgoingBatchCanceled) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *EventOutgoingBatchCanceled) XXX_Merge(src proto.Message) { xxx_messageInfo_EventOutgoingBatchCanceled.Merge(m, src) } + func (m *EventOutgoingBatchCanceled) XXX_Size() int { return m.Size() } + func (m *EventOutgoingBatchCanceled) XXX_DiscardUnknown() { xxx_messageInfo_EventOutgoingBatchCanceled.DiscardUnknown(m) } @@ -277,9 +311,11 @@ func (*EventOutgoingBatch) ProtoMessage() {} func (*EventOutgoingBatch) Descriptor() ([]byte, []int) { return fileDescriptor_16a379404a8854af, []int{3} } + func (m *EventOutgoingBatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *EventOutgoingBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventOutgoingBatch.Marshal(b, m, deterministic) @@ -292,12 +328,15 @@ func (m *EventOutgoingBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *EventOutgoingBatch) XXX_Merge(src proto.Message) { xxx_messageInfo_EventOutgoingBatch.Merge(m, src) } + func (m *EventOutgoingBatch) XXX_Size() int { return m.Size() } + func (m *EventOutgoingBatch) XXX_DiscardUnknown() { xxx_messageInfo_EventOutgoingBatch.DiscardUnknown(m) } @@ -351,46 +390,48 @@ func init() { } var fileDescriptor_16a379404a8854af = []byte{ - // 610 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0xce, 0xa6, 0xff, 0x4e, 0xd2, 0x82, 0x55, 0xd0, 0x36, 0x12, 0x69, 0x08, 0x2a, 0x44, 0xa2, - 0x6c, 0xaa, 0xf0, 0x04, 0x4d, 0x54, 0xa4, 0x48, 0x08, 0xa4, 0x25, 0x12, 0x12, 0x97, 0x95, 0x63, - 0xbb, 0x1b, 0x2b, 0x5d, 0xbb, 0x5a, 0x4f, 0x20, 0x79, 0x0b, 0x9e, 0x80, 0x87, 0xe0, 0x29, 0x7a, - 0xec, 0x11, 0x71, 0xa8, 0x50, 0xfb, 0x10, 0x70, 0x44, 0x1e, 0x6f, 0x5b, 0xaa, 0x52, 0xae, 0xdc, - 0xec, 0xef, 0xfb, 0x66, 0x3c, 0xf3, 0xcd, 0xc8, 0x64, 0xe7, 0x98, 0x1d, 0x99, 0x8c, 0xf1, 0x31, - 0x53, 0xba, 0xe3, 0xcf, 0x1d, 0x3b, 0x99, 0x7f, 0x62, 0xf3, 0xce, 0x88, 0x01, 0x1f, 0x47, 0xc7, - 0xb9, 0x01, 0x43, 0xb7, 0xfe, 0x90, 0x45, 0xfe, 0x1c, 0x79, 0x59, 0x7d, 0x33, 0x35, 0xa9, 0x41, - 0x55, 0xc7, 0x9d, 0x7c, 0x40, 0xfd, 0xf9, 0xdd, 0x79, 0x19, 0x80, 0xb4, 0xc0, 0x40, 0x19, 0xed, - 0xc5, 0xad, 0x9f, 0x65, 0xb2, 0xf1, 0x76, 0x0a, 0xa9, 0x51, 0x3a, 0x1d, 0xce, 0x7a, 0xee, 0x5d, - 0xba, 0x4d, 0x2a, 0x58, 0x40, 0xa2, 0x8d, 0xe6, 0x32, 0x0c, 0x9a, 0x41, 0x7b, 0x31, 0x26, 0x08, - 0xbd, 0x71, 0x08, 0x7d, 0x42, 0x6a, 0x5e, 0x00, 0x2a, 0x93, 0x66, 0x0a, 0x61, 0x19, 0x25, 0x55, - 0x04, 0x87, 0x1e, 0xa3, 0xef, 0x49, 0x15, 0x72, 0xa6, 0x2d, 0xe3, 0xee, 0x39, 0x1b, 0x2e, 0x34, - 0x17, 0xda, 0x95, 0xee, 0x8b, 0xe8, 0xce, 0x76, 0xa2, 0xab, 0x3a, 0x5c, 0xd8, 0xa1, 0xcc, 0x87, - 0xb3, 0xde, 0xe2, 0xc9, 0xd9, 0x76, 0x29, 0xbe, 0x91, 0x88, 0xee, 0x90, 0x75, 0x30, 0x13, 0xa9, - 0x13, 0x6e, 0x34, 0xe4, 0x8c, 0x43, 0xb8, 0xd8, 0x0c, 0xda, 0x6b, 0x71, 0x0d, 0xd1, 0x7e, 0x01, - 0xd2, 0x3d, 0xb2, 0xe9, 0xd3, 0x27, 0xa3, 0x23, 0xc3, 0x27, 0x09, 0xcf, 0x25, 0x03, 0x29, 0xc2, - 0x25, 0xac, 0x95, 0x7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8, 0x21, 0x9b, 0xed, 0x63, 0x54, - 0xeb, 0x4b, 0x40, 0xea, 0x07, 0x1f, 0xa5, 0x86, 0xcb, 0xfe, 0x71, 0xef, 0xfa, 0x4c, 0x73, 0x79, - 0x24, 0x05, 0x7d, 0x46, 0x8a, 0x88, 0xeb, 0x09, 0x07, 0xd8, 0xdd, 0xba, 0x87, 0xaf, 0x46, 0xfc, - 0xf4, 0x5a, 0x88, 0x73, 0x53, 0xa2, 0x30, 0xa9, 0x56, 0x08, 0x1d, 0x3a, 0x10, 0x74, 0x8b, 0xac, - 0xfa, 0x7d, 0x55, 0xa2, 0xf0, 0x69, 0x05, 0xef, 0x03, 0x41, 0x37, 0xc9, 0x92, 0xdf, 0x72, 0xbf, - 0x43, 0xfe, 0xd2, 0xfa, 0x1a, 0x10, 0x7a, 0xbb, 0xc0, 0xff, 0x5f, 0xd8, 0x8d, 0x85, 0x5a, 0xba, - 0xb9, 0x50, 0xbd, 0x57, 0x27, 0xe7, 0x8d, 0xe0, 0xf4, 0xbc, 0x11, 0xfc, 0x38, 0x6f, 0x04, 0x9f, - 0x2f, 0x1a, 0xa5, 0xd3, 0x8b, 0x46, 0xe9, 0xdb, 0x45, 0xa3, 0xf4, 0x61, 0x37, 0x55, 0x30, 0x9e, - 0x8e, 0x22, 0x6e, 0xb2, 0xce, 0x5f, 0x3e, 0x87, 0xd9, 0xe5, 0xf7, 0x00, 0xf3, 0x63, 0x69, 0x47, - 0xcb, 0xf8, 0x33, 0xbc, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x92, 0x30, 0x69, 0xfb, 0xa0, 0x04, - 0x00, 0x00, + // 654 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcf, 0x6e, 0x13, 0x3f, + 0x10, 0xce, 0x36, 0xfd, 0x17, 0x27, 0x69, 0x7f, 0x3f, 0xab, 0x85, 0x6d, 0x24,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d8, 0x28, 0xb6, 0xca, 0x9d, 0x67, 0xc1, 0x9d, 0xc7, 0x09, 0x16, 0x3e, 0xb2, + 0xb0, 0x63, 0x48, 0x07, 0xd3, 0xee, 0xf2, 0xd9, 0xc5, 0x6e, 0x21, 0xbc, 0x91, 0x88, 0xee, 0x91, + 0x0d, 0xab, 0xc7, 0xa0, 0x58, 0xa4, 0x95, 0x4d, 0x79, 0x64, 0xfd, 0xe5, 0x86, 0xd7, 0x2a, 0x85, + 0x55, 0x44, 0x7b, 0x39, 0x48, 0x0f, 0xc8, 0x96, 0x4b, 0xcf, 0x86, 0x27, 0x3a, 0x1a, 0xb3, 0x28, + 0x05, 0x6e, 0x41, 0xf8, 0x2b, 0xe8, 0x95, 0x3a, 0xae, 0x9b, 0x51, 0x3d, 0xc7, 0xd0, 0x7d, 0x42, + 0xd1, 0x16, 0x4b, 0xe1, 0x18, 0x52, 0x50, 0x11, 0x30, 0x29, 0xfc, 0x55, 0x4c, 0xfe, 0x1f, 0x32, + 0xe1, 0x9c, 0xe8, 0x0b, 0xda, 0x24, 0xd5, 0xe1, 0xcc, 0x82, 0x61, 0x56, 0x33, 0x23, 0x63, 0xe5, + 0xaf, 0x35, 0xbc, 0x56, 0x25, 0x2c, 0x23, 0x38, 0xd0, 0x6f, 0x65, 0xac, 0x68, 0x8d, 0xac, 0x73, + 0x93, 0x91, 0x00, 0xfe, 0x3a, 0xe6, 0x59, 0xec, 0xe9, 0x43, 0x52, 0x89, 0xb9, 0x61, 0x60, 0xac, + 0x4c, 0xb8, 0x05, 0xbf, 0x84, 0xbe, 0xca, 0x31, 0x37, 0x47, 0x39, 0x44, 0x5f, 0x90, 0xfb, 0x73, + 0x39, 0x4b, 0x21, 0xd1, 0x16, 0x18, 0x17, 0x22, 0x05, 0x63, 0x7c, 0x82, 0xc5, 0xb6, 0xe7, 0x74, + 0x88, 0xec, 0xa1, 0x23, 0x9b, 0x3f, 0x3d, 0x42, 0x6f, 0x5f, 0x26, 0xdd, 0x20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 0x08, 0xbd, 0x6d, 0xf0, 0xdf, 0x1b, 0xbb, 0x31, 0xab, 0x2b, 0x37, 0x67, 0xb5, 0xfb, 0xf2, + 0xec, 0xb2, 0xee, 0x9d, 0x5f, 0xd6, 0xbd, 0x1f, 0x97, 0x75, 0xef, 0xd3, 0x55, 0xbd, 0x70, 0x7e, + 0x55, 0x2f, 0x7c, 0xbb, 0xaa, 0x17, 0xde, 0xef, 0xc7, 0xd2, 0x8e, 0x26, 0xc3, 0x20, 0xd2, 0x49, + 0xfb, 0x0f, 0xff, 0xce, 0x74, 0xfe, 0xf3, 0xd8, 0xd9, 0x29, 0x98, 0xe1, 0x2a, 0x7e, 0x3a, 0xcf, + 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xbf, 0x82, 0xcb, 0xfb, 0x04, 0x00, 0x00, } func (m *OutgoingTxBatch) Marshal() (dAtA []byte, err error) { @@ -413,6 +454,18 @@ func (m *OutgoingTxBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AssigneeRemoteAddress) > 0 { + i -= len(m.AssigneeRemoteAddress) + copy(dAtA[i:], m.AssigneeRemoteAddress) + i = encodeVarintBatch(dAtA, i, uint64(len(m.AssigneeRemoteAddress))) + i-- + dAtA[i] = 0x52 + } + if m.GasEstimate != 0 { + i = encodeVarintBatch(dAtA, i, uint64(m.GasEstimate)) + i-- + dAtA[i] = 0x48 + } if len(m.Assignee) > 0 { i -= len(m.Assignee) copy(dAtA[i:], m.Assignee) @@ -655,6 +708,7 @@ func encodeVarintBatch(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *OutgoingTxBatch) Size() (n int) { if m == nil { return 0 @@ -692,6 +746,13 @@ func (m *OutgoingTxBatch) Size() (n int) { if l > 0 { n += 1 + l + sovBatch(uint64(l)) } + if m.GasEstimate != 0 { + n += 1 + sovBatch(uint64(m.GasEstimate)) + } + l = len(m.AssigneeRemoteAddress) + if l > 0 { + n += 1 + l + sovBatch(uint64(l)) + } return n } @@ -776,9 +837,11 @@ func (m *EventOutgoingBatch) Size() (n int) { func sovBatch(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozBatch(x uint64) (n int) { return sovBatch(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *OutgoingTxBatch) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1029,6 +1092,59 @@ func (m *OutgoingTxBatch) Unmarshal(dAtA []byte) error { } m.Assignee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasEstimate", wireType) + } + m.GasEstimate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasEstimate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssigneeRemoteAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBatch + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthBatch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssigneeRemoteAddress = append(m.AssigneeRemoteAddress[:0], dAtA[iNdEx:postIndex]...) + if m.AssigneeRemoteAddress == nil { + m.AssigneeRemoteAddress = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBatch(dAtA[iNdEx:]) @@ -1050,6 +1166,7 @@ func (m *OutgoingTxBatch) Unmarshal(dAtA []byte) error { } return nil } + func (m *OutgoingTransferTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1250,6 +1367,7 @@ func (m *OutgoingTransferTx) Unmarshal(dAtA []byte) error { } return nil } + func (m *EventOutgoingBatchCanceled) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1428,6 +1546,7 @@ func (m *EventOutgoingBatchCanceled) Unmarshal(dAtA []byte) error { } return nil } + func (m *EventOutgoingBatch) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1638,6 +1757,7 @@ func (m *EventOutgoingBatch) Unmarshal(dAtA []byte) error { } return nil } + func skipBatch(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/skyway/types/batch_test.go b/x/skyway/types/batch_test.go index 47019a71..6d0575f2 100644 --- a/x/skyway/types/batch_test.go +++ b/x/skyway/types/batch_test.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -40,7 +41,16 @@ func TestOutgoingTxBatchCheckpoint(t *testing.T) { actualHashHex := hex.EncodeToString(actualHash) // hash from bridge contract - expectedHash := "0xcab79faf47d1556c5b273afb063ab1889461e35bc6403e410af240cefdb0fd8e"[2:] + expectedHash := "cefc086a77b3115791a9bffa373e3dee2fa4c56e10e3be21eb0eb55b47d1df44" assert.Equal(t, expectedHash, actualHashHex) + + src.AssigneeRemoteAddress = common.HexToAddress("0x28E9e9bfedEd29747FCc33ccA25b4B75f05E434B").Bytes() + + actualHash, err = src.GetCheckpoint("5270") + require.NoError(t, err) + + actualHashHex = hex.EncodeToString(actualHash) + expectedHash = "b1938e2034d12e4fe6e1448df12793db17c75494c573fa8e842da5bc9dd12f38" + assert.Equal(t, expectedHash, actualHashHex) } diff --git a/x/skyway/types/codec.go b/x/skyway/types/codec.go index b0e4758e..f7512ce8 100644 --- a/x/skyway/types/codec.go +++ b/x/skyway/types/codec.go @@ -24,6 +24,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgBatchSendToEthClaim{}, &MsgSendToRemote{}, &MsgConfirmBatch{}, + &MsgEstimateBatchGas{}, &MsgSendToPalomaClaim{}, &MsgBatchSendToRemoteClaim{}, &MsgCancelSendToRemote{}, @@ -34,11 +35,12 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface( "palomachain.paloma.skyway.EthereumClaim", (*EthereumClaim)(nil), - // Register legacy messages &MsgBatchSendToEthClaim{}, &MsgSendToPalomaClaim{}, &MsgBatchSendToRemoteClaim{}, &MsgLightNodeSaleClaim{}, + &MsgSendToPalomaClaim{}, + &MsgBatchSendToRemoteClaim{}, ) registry.RegisterImplementations( @@ -66,6 +68,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*EthereumClaim)(nil), nil) cdc.RegisterConcrete(&MsgSendToRemote{}, "skyway/MsgSendToRemote", nil) cdc.RegisterConcrete(&MsgConfirmBatch{}, "skyway/MsgConfirmBatch", nil) + cdc.RegisterConcrete(&MsgEstimateBatchGas{}, "skyway/MsgEstimateBatchGas", nil) cdc.RegisterConcrete(&MsgSendToPalomaClaim{}, "skyway/MsgSendToPalomaClaim", nil) cdc.RegisterConcrete(&MsgBatchSendToRemoteClaim{}, "skyway/MsgBatchSendToRemoteClaim", nil) cdc.RegisterConcrete(&OutgoingTxBatch{}, "skyway/OutgoingTxBatch", nil) diff --git a/x/skyway/types/expected_keepers.go b/x/skyway/types/expected_keepers.go index b01dbd2f..0714a83e 100644 --- a/x/skyway/types/expected_keepers.go +++ b/x/skyway/types/expected_keepers.go @@ -72,7 +72,7 @@ type DistributionKeeper interface { type EVMKeeper interface { GetChainInfo(ctx context.Context, targetChainReferenceID string) (*evmtypes.ChainInfo, error) - PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) + PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, string, error) GetEthAddressByValidator(ctx context.Context, validator sdk.ValAddress, chainReferenceId string) (ethAddress *EthAddress, found bool, err error) GetValidatorAddressByEthAddress(ctx context.Context, ethAddr EthAddress, chainReferenceId string) (valAddr sdk.ValAddress, found bool, err error) HasAnySmartContractDeployment(ctx context.Context, chainReferenceID string) (found bool) diff --git a/x/skyway/types/genesis.go b/x/skyway/types/genesis.go index 9f6f30b5..60d5b175 100644 --- a/x/skyway/types/genesis.go +++ b/x/skyway/types/genesis.go @@ -70,6 +70,7 @@ func DefaultGenesisState() *GenesisState { SkywayNonces: []SkywayNonces{}, Batches: []OutgoingTxBatch{}, BatchConfirms: []MsgConfirmBatch{}, + BatchGasEstimates: []MsgEstimateBatchGas{}, Attestations: []Attestation{}, Erc20ToDenoms: []ERC20ToDenom{}, UnbatchedTransfers: []OutgoingTransferTx{}, diff --git a/x/skyway/types/genesis.pb.go b/x/skyway/types/genesis.pb.go index 46b7fbaf..2caa85ef 100644 --- a/x/skyway/types/genesis.pb.go +++ b/x/skyway/types/genesis.pb.go @@ -5,18 +5,21 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,6 +34,7 @@ type GenesisState struct { SkywayNonces []SkywayNonces `protobuf:"bytes,2,rep,name=skyway_nonces,json=skywayNonces,proto3" json:"skyway_nonces"` Batches []OutgoingTxBatch `protobuf:"bytes,3,rep,name=batches,proto3" json:"batches"` BatchConfirms []MsgConfirmBatch `protobuf:"bytes,4,rep,name=batch_confirms,json=batchConfirms,proto3" json:"batch_confirms"` + BatchGasEstimates []MsgEstimateBatchGas `protobuf:"bytes,5,rep,name=batch_gas_estimates,json=batchGasEstimates,proto3" json:"batch_gas_estimates"` Attestations []Attestation `protobuf:"bytes,7,rep,name=attestations,proto3" json:"attestations"` Erc20ToDenoms []ERC20ToDenom `protobuf:"bytes,9,rep,name=erc20_to_denoms,json=erc20ToDenoms,proto3" json:"erc20_to_denoms"` UnbatchedTransfers []OutgoingTransferTx `protobuf:"bytes,10,rep,name=unbatched_transfers,json=unbatchedTransfers,proto3" json:"unbatched_transfers"` @@ -45,9 +49,11 @@ func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_e20fa6374f01ce45, []int{0} } + func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) @@ -60,12 +66,15 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *GenesisState) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisState.Merge(m, src) } + func (m *GenesisState) XXX_Size() int { return m.Size() } + func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } @@ -100,6 +109,13 @@ func (m *GenesisState) GetBatchConfirms() []MsgConfirmBatch { return nil } +func (m *GenesisState) GetBatchGasEstimates() []MsgEstimateBatchGas { + if m != nil { + return m.BatchGasEstimates + } + return nil +} + func (m *GenesisState) GetAttestations() []Attestation { if m != nil { return m.Attestations @@ -167,9 +183,11 @@ func (*SkywayNonces) ProtoMessage() {} func (*SkywayNonces) Descriptor() ([]byte, []int) { return fileDescriptor_e20fa6374f01ce45, []int{1} } + func (m *SkywayNonces) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *SkywayNonces) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SkywayNonces.Marshal(b, m, deterministic) @@ -182,12 +200,15 @@ func (m *SkywayNonces) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *SkywayNonces) XXX_Merge(src proto.Message) { xxx_messageInfo_SkywayNonces.Merge(m, src) } + func (m *SkywayNonces) XXX_Size() int { return m.Size() } + func (m *SkywayNonces) XXX_DiscardUnknown() { xxx_messageInfo_SkywayNonces.DiscardUnknown(m) } @@ -239,51 +260,53 @@ func init() { } var fileDescriptor_e20fa6374f01ce45 = []byte{ - // 702 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xdf, 0x4e, 0x13, 0x41, - 0x14, 0xc6, 0x5b, 0xa8, 0x20, 0xd3, 0x2d, 0xe0, 0x80, 0x64, 0xe0, 0xa2, 0x22, 0xe1, 0x5f, 0x10, - 0x77, 0xa1, 0xc6, 0xa8, 0x97, 0x16, 0x95, 0x40, 0x10, 0xc8, 0xb6, 0xc6, 0xc4, 0x9b, 0xcd, 0xec, - 0xee, 0xb0, 0xdd, 0xb0, 0xbb, 0xd3, 0xec, 0x19, 0xb0, 0xbc, 0x85, 0x8f, 0xc5, 0x25, 0x97, 0x5e, - 0x19, 0x03, 0x2f, 0xe0, 0x1b, 0x68, 0x66, 0x76, 0x16, 0x6a, 0x64, 0x5b, 0xaf, 0x7a, 0x72, 0xce, - 0xf7, 0xfd, 0xce, 0xf6, 0xcc, 0x9c, 0x41, 0x6b, 0x5d, 0x1a, 0xf1, 0x98, 0x7a, 0x1d, 0x1a, 0x26, - 0x56, 0x16, 0x5b, 0x70, 0x7a, 0xf1, 0x95, 0x5e, 0x58, 0x01,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, - 0x00, 0xa1, 0xa5, 0x7e, 0x0e, 0x95, 0xbc, 0x59, 0xb9, 0xfc, 0xf1, 0xa4, 0x64, 0x1b, 0xd0, 0x97, - 0xc3, 0xfb, 0x68, 0x5c, 0x1d, 0x20, 0x03, 0x32, 0xaa, 0x68, 0x1b, 0x03, 0x68, 0x47, 0x67, 0x22, - 0xe0, 0x61, 0x12, 0xb4, 0x7b, 0x4d, 0xe9, 0xd1, 0xc0, 0x1c, 0x80, 0x3f, 0xa3, 0x49, 0x15, 0xca, - 0xc1, 0x9f, 0x84, 0x69, 0x0c, 0xa4, 0x32, 0x14, 0xf9, 0x11, 0x82, 0x9d, 0x4c, 0xdd, 0x8f, 0xac, - 0x29, 0x8e, 0x2e, 0x00, 0x3e, 0x46, 0x46, 0xdf, 0x95, 0x04, 0x32, 0xae, 0xb0, 0xab, 0x03, 0xb0, - 0x6f, 0xef, 0xe4, 0xf9, 0xdf, 0xee, 0x27, 0xe0, 0x4f, 0x68, 0x8a, 0xa5, 0x5e, 0x63, 0xcb, 0x11, - 0xdc, 0xf1, 0x59, 0xc2, 0x63, 0x20, 0x13, 0x43, 0x87, 0xf9, 0xde, 0xde, 0x69, 0x6c, 0xb5, 0xf9, - 0x3b, 0xa9, 0xcf, 0x3f, 0x54, 0x51, 0x74, 0x0e, 0xb0, 0x8f, 0x66, 0xce, 0x92, 0x6c, 0x1c, 0xfe, - 0xed, 0xf5, 0x05, 0x82, 0x14, 0xfa, 0xf9, 0xff, 0x4c, 0x56, 0x7b, 0xda, 0x3d, 0xdd, 0x00, 0xdf, - 0xf2, 0xf2, 0x92, 0xec, 0x32, 0x77, 0xef, 0x86, 0x00, 0x31, 0x54, 0x23, 0x73, 0x40, 0xa3, 0xa6, - 0x32, 0xe6, 0xac, 0x03, 0x69, 0xb3, 0x67, 0xdd, 0x7f, 0x93, 0x80, 0x77, 0x91, 0x71, 0xb7, 0xb3, - 0x0c, 0x48, 0x4d, 0xb1, 0x97, 0x87, 0xb3, 0x69,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, 0xcb, 0xdf, 0x6e, - 0xea, 0xa5, 0xab, 0x9b, 0x7a, 0xe9, 0xfb, 0x4d, 0xbd, 0xf4, 0x65, 0x33, 0x08, 0x45, 0xe7, 0xcc, - 0x35, 0x3d, 0x1e, 0x5b, 0xf7, 0x3c, 0x60, 0xbd, 0xbf, 0x9e, 0x30, 0x77, 0x4c, 0xbd, 0x61, 0x2f, - 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x91, 0x3e, 0xa8, 0xbd, 0xa5, 0x06, 0x00, 0x00, + // 732 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xcf, 0x4e, 0xdb, 0x4a, + 0x14, 0xc6, 0x13, 0x08, 0x70, 0x99, 0x38, 0xfc, 0x19, 0xb8, 0x68, 0x60, 0x91, 0xcb, 0x45, 0xfc, + 0x13, 0x97, 0x6b, 0x43, 0xaa, 0xaa, 0xed, 0xb2, 0xa1, 0x14, 0x81, 0x28, 0x20, 0x27, 0x55, 0xa5, + 0x6e, 0xac, 0xb1, 0x3d, 0x38, 0x16, 0xb6, 0x27, 0xf2, 0x19, 0x68, 0x78, 0x8b, 0x3e, 0x16, 0x4b, + 0x96, 0x5d, 0x55, 0x15, 0xa8, 0xfb, 0x3e, 0x42, 0x35, 0xe3, 0x31, 0xa4, 0x2a, 0x4e, 0xba, 0x62, + 0x38, 0xdf, 0xf7, 0xfd, 0x26, 0x3a, 0xc7, 0x67, 0xd0, 0x46, 0x97, 0x46, 0x3c, 0xa6, 0x5e, 0x87, + 0x86, 0x89, 0x95, 0x9d, 0x2d, 0xb8, 0xb8, 0xfe, 0x44, 0xaf, 0xad, 0x80, 0x25, 0x0c, 0x42, 0x30, + 0xbb, 0x29, 0x17, 0x1c, 0x2f, 0xf6, 0x19, 0xcd, 0xec, 0x6c, 0x66, 0xc6, 0xa5, 0xba, 0xc7, 0x21, + 0xe6, 0x60, 0xb9, 0x14, 0x98, 0x75, 0xb5, 0xeb, 0x32, 0x41, 0x77, 0x2d, 0x8f, 0x4b, 0x9f, 0x8c, + 0x2e, 0xcd, 0x07, 0x3c, 0xe0, 0xea, 0x68, 0xc9, 0x93, 0xae, 0xfe, 0x57, 0x7c, 0x33, 0x15, 0x82, + 0x81, 0xa0, 0x22, 0xe4, 0x39, 0x62, 0xad, 0xd8, 0xec, 0x52, 0xe1, 0x75, 0xb4, 0x6d, 0x6b, 0x80, + 0x2d, 0x0d, 0xfd, 0x80, 0x39, 0x82, 0xf6, 0xb4, 0xf7, 0xf9, 0x70, 0x6f, 0x4a, 0x13, 0x38, 0x67, + 0xa9, 0x13, 0x85, 0x71, 0x28, 0x74, 0xec, 0x65, 0x71, 0x2c, 0x0a, 0x83, 0x8e, 0x70, 0x12, 0xee, + 0x33, 0x07, 0x68, 0xc4, 0x1c, 0x8f, 0x27, 0x22, 0xa5, 0x5e, 0x9e, 0x5c, 0x2d, 0x4e, 0xc6, 0x10, + 0xe8, 0x3e, 0x2f, 0xad, 0x17, 0xbb, 0xba, 0x34, 0xa5, 0x31, 0x0c, 0xef, 0x88, 0xb8, 0xee, 0x32, + 0x6d, 0x5b, 0xf9, 0x3e, 0x81, 0x8c, 0x83, 0x6c, 0x90, 0x2d, 0x41, 0x05, 0xc3, 0xaf, 0xd0, 0x78, + 0xc6, 0x21, 0xe5, 0xe5, 0xf2, 0x66, 0xb5, 0xf1, 0xaf, 0x59, 0x38, 0x58, 0xf3, 0x4c, 0x19, 0x6d, + 0x1d, 0xc0, 0x36, 0xaa, 0x65, 0x82, 0x93, 0xf0, 0xc4, 0x63, 0x40, 0x46, 0x96, 0x47, 0x37, 0xab, + 0x8d, 0x8d, 0x01, 0x84, 0x96, 0xfa, 0x73, 0xa2, 0xec, 0xcd, 0xca, 0xcd, 0xd7, 0x7f, 0x4a, 0xb6, + 0x01, 0x7d, 0x35, 0x7c, 0x84, 0x26, 0xd4, 0x00, 0x19, 0x90, 0x51, 0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 0xbd, 0xab, 0x97, 0xbf, 0xdd, 0xd5, 0xcb, 0x9f, 0xef, 0xeb, 0xa5, + 0xdb, 0xfb, 0x7a, 0xe9, 0xcb, 0x7d, 0xbd, 0xf4, 0x71, 0x3b, 0x08, 0x45, 0xe7, 0xd2, 0x35, 0x3d, + 0x1e, 0x5b, 0x4f, 0x3c, 0x93, 0xbd, 0x5f, 0x1e, 0x4a, 0x77, 0x5c, 0xbd, 0x94, 0xcf, 0x7e, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x33, 0x67, 0x8f, 0x56, 0x0b, 0x07, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -390,6 +413,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3a } } + if len(m.BatchGasEstimates) > 0 { + for iNdEx := len(m.BatchGasEstimates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BatchGasEstimates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if len(m.BatchConfirms) > 0 { for iNdEx := len(m.BatchConfirms) - 1; iNdEx >= 0; iNdEx-- { { @@ -508,6 +545,7 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *GenesisState) Size() (n int) { if m == nil { return 0 @@ -536,6 +574,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.BatchGasEstimates) > 0 { + for _, e := range m.BatchGasEstimates { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } if len(m.Attestations) > 0 { for _, e := range m.Attestations { l = e.Size() @@ -603,9 +647,11 @@ func (m *SkywayNonces) Size() (n int) { func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -773,6 +819,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchGasEstimates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchGasEstimates = append(m.BatchGasEstimates, MsgEstimateBatchGas{}) + if err := m.BatchGasEstimates[len(m.BatchGasEstimates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attestations", wireType) @@ -998,6 +1078,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } + func (m *SkywayNonces) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1156,6 +1237,7 @@ func (m *SkywayNonces) Unmarshal(dAtA []byte) error { } return nil } + func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/skyway/types/key.go b/x/skyway/types/key.go index d395f778..0e0cf1d2 100644 --- a/x/skyway/types/key.go +++ b/x/skyway/types/key.go @@ -36,7 +36,7 @@ var ( // Note: This is a LEGACY key, i.e. it is no longer in use! // ** DO NOT USE THIS OUTSIDE OF MIGRATION TESTING! ** // - // i.e. skywayvaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm + // i.e. palomavaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm // A claim is named more intuitively than an Attestation, it is literally // a validator making a claim to have seen something happen. Claims are // attached to attestations which can be thought of as 'the event' that @@ -45,7 +45,7 @@ var ( LEGACYOracleClaimKey = HashString("OracleClaimKey") // OracleAttestationKey attestation details by nonce and validator address - // i.e. skywayvaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm + // i.e. palomavaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm // An attestation can be thought of as the 'event to be executed' while // the Claims are an individual validator saying that they saw an event // occur the Attestation is 'the event' that multiple claims vote on and @@ -65,6 +65,9 @@ var ( // [0x75b935a854d50880236724b9c4822daf] BatchConfirmKey = HashString("BatchConfirmKey") + // BatchGasEstimateKey indexes validator gas estimates by token contract address + // [0xb1571f7250f5547c08def1e44f4d0c98] + BatchGasEstimateKey = HashString("GasEstimateKey") // LastEventNonceByValidatorKey indexes lateset event nonce by validator // [0xeefcb999cc3d7b80b052b55106a6ba5e] LastEventNonceByValidatorKey = HashString("LastEventNonceByValidatorKey") @@ -123,6 +126,9 @@ var ( BridgeTransferLimitPrefix = "bridge-transfer-limit" BridgeTransferUsagePrefix = "bridge-transfer-usage" LightNodeSaleContractsPrefix = "light-node-sale-contracts" + + // LatestCompassIDKey stores the latest compass ID received + LatestCompassIDKey = HashString("LatestCompassIDKey") ) // GetOrchestratorAddressKey returns the following key format @@ -137,7 +143,7 @@ func GetOrchestratorAddressKey(orc sdk.AccAddress) ([]byte, error) { // GetEthAddressByValidatorKey returns the following key format // prefix cosmos-validator -// [0x0][skywayvaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm] +// [0x0][palomavaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm] func GetEthAddressByValidatorKey(validator sdk.ValAddress) ([]byte, error) { if err := sdk.VerifyAddressFormat(validator); err != nil { return nil, sdkerrors.Wrap(err, "invalid validator address") @@ -202,7 +208,7 @@ func GetBatchConfirmNonceContractPrefix(tokenContract EthAddress, batchNonce uin // GetBatchConfirmKey returns the following key format // prefix eth-contract-address BatchNonce Validator-address -// [0x0 ][0xc783df8a850f42e7F7e57013759C285caa701eB6][0 0 0 0 0 0 0 1][skywayvaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm] +// [0x0 ][0xc783df8a850f42e7F7e57013759C285caa701eB6][0 0 0 0 0 0 0 1][palomavaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm] func GetBatchConfirmKey(tokenContract EthAddress, batchNonce uint64, validator sdk.AccAddress) ([]byte, error) { if err := sdk.VerifyAddressFormat(validator); err != nil { return nil, sdkerrors.Wrap(err, "invalid validator address") @@ -210,6 +216,23 @@ func GetBatchConfirmKey(tokenContract EthAddress, batchNonce uint64, validator s return AppendBytes(GetBatchConfirmNonceContractPrefix(tokenContract, batchNonce), validator.Bytes()), nil } +// GetBatchGasEstimateNonceContractPrefix returns +// prefix eth-contract-address BatchNonce +// [0x0][0xc783df8a850f42e7F7e57013759C285caa701eB6][0 0 0 0 0 0 0 1] +func GetBatchGasEstimateNonceContractPrefix(tokenContract EthAddress, batchNonce uint64) []byte { + return AppendBytes(BatchGasEstimateKey, tokenContract.GetAddress().Bytes(), UInt64Bytes(batchNonce)) +} + +// GetBatchGasEstimateKey returns the following key format +// prefix eth-contract-address BatchNonce Validator-address +// [0x0 ][0xc783df8a850f42e7F7e57013759C285caa701eB6][0 0 0 0 0 0 0 1][palomavaloper1ahx7f8wyertuus9r20284ej0asrs085ceqtfnm] +func GetBatchGasEstimateKey(tokenContract EthAddress, batchNonce uint64, validator sdk.ValAddress) ([]byte, error) { + if err := sdk.VerifyAddressFormat(validator); err != nil { + return nil, sdkerrors.Wrap(err, "invalid validator address") + } + return AppendBytes(GetBatchGasEstimateNonceContractPrefix(tokenContract, batchNonce), validator.Bytes()), nil +} + // GetLastEventNonceByValidatorKey indexes latest event nonce by validator // GetLastEventNonceByValidatorKey returns the following key format // prefix cosmos-validator diff --git a/x/skyway/types/key_test.go b/x/skyway/types/key_test.go index b18b282a..698758d8 100644 --- a/x/skyway/types/key_test.go +++ b/x/skyway/types/key_test.go @@ -10,7 +10,7 @@ import ( // ignore func TestPrefixKeysSameLength(t *testing.T) { allKeys := getAllKeys(t) - prefixKeys := allKeys[0:19] + prefixKeys := allKeys[0:20] length := len(HashString("All keys should be same length when hashed")) for _, key := range prefixKeys { @@ -31,7 +31,7 @@ func getAllKeys(t *testing.T) [][]byte { i := 0 inc := func(i *int) *int { *i += 1; return i } - keys := make([][]byte, 33) + keys := make([][]byte, 36) keys[i] = EthAddressByValidatorKey keys[*inc(&i)] = ValidatorByEthAddressKey @@ -52,6 +52,7 @@ func getAllKeys(t *testing.T) [][]byte { keys[*inc(&i)] = LastSlashedBatchBlock keys[*inc(&i)] = LastUnBondingBlockHeight keys[*inc(&i)] = PastEthSignatureCheckpointKey + keys[*inc(&i)] = BatchGasEstimateKey // sdk.AccAddress, sdk.ValAddress dummyAddr := []byte("paloma1ahx7f8wyertuus9r20284ej0asrs085c945jyk") @@ -87,14 +88,21 @@ func getAllKeys(t *testing.T) [][]byte { keys[*inc(&i)] = GetBatchConfirmNonceContractPrefix(dummyEthAddr, dummyNonce) batchConfirmKey, err := GetBatchConfirmKey(dummyEthAddr, dummyNonce, dummyAddr) + require.NoError(t, err) keys[*inc(&i)] = batchConfirmKey lastEventNonceByValidatorKey, err := GetLastEventNonceByValidatorKey(dummyAddr) + require.NoError(t, err) keys[*inc(&i)] = lastEventNonceByValidatorKey keys[*inc(&i)] = GetDenomToERC20Key(dummyChainReferenceID, dummyDenom) keys[*inc(&i)] = GetERC20ToDenomKey(dummyChainReferenceID, dummyEthAddr) keys[*inc(&i)] = GetPastEthSignatureCheckpointKey(dummyBytes) + keys[*inc(&i)] = GetBatchGasEstimateNonceContractPrefix(dummyEthAddr, dummyNonce) + + batchGasEstimateKey, err := GetBatchGasEstimateKey(dummyEthAddr, dummyNonce, dummyAddr) + require.NoError(t, err) + keys[*inc(&i)] = batchGasEstimateKey return keys } diff --git a/x/skyway/types/legacy_msgs.go b/x/skyway/types/legacy_msgs.go index 0d9e6343..7d694e6b 100644 --- a/x/skyway/types/legacy_msgs.go +++ b/x/skyway/types/legacy_msgs.go @@ -48,6 +48,8 @@ func (msg *MsgBatchSendToEthClaim) ClaimHash() ([]byte, error) { return tmhash.Sum([]byte(path)), nil } +func (msg *MsgBatchSendToEthClaim) GetCompassID() string { return "" } + func (msg MsgBatchSendToEthClaim) GetClaimer() sdk.AccAddress { err := msg.ValidateBasic() if err != nil { diff --git a/x/skyway/types/msgs.go b/x/skyway/types/msgs.go index 2aadbb89..e78b2fcc 100644 --- a/x/skyway/types/msgs.go +++ b/x/skyway/types/msgs.go @@ -104,6 +104,38 @@ func (msg MsgConfirmBatch) GetSigners() []sdk.AccAddress { return libmeta.GetSigners(&msg) } +// Route should return the name of the module +func (msg MsgEstimateBatchGas) Route() string { return RouterKey } + +// Type should return the action +func (msg MsgEstimateBatchGas) Type() string { return "estimate_batch_gas" } + +// ValidateBasic performs stateless checks +func (msg MsgEstimateBatchGas) ValidateBasic() error { + if err := libmeta.ValidateBasic(&msg); err != nil { + return err + } + + if err := ValidateEthAddress(msg.EthSigner); err != nil { + return sdkerrors.Wrap(err, "eth signer") + } + + if msg.Estimate < 1 { + return sdkerrors.Wrap(ErrInvalidClaim, "gas estimate must be positive") + } + return nil +} + +// GetSignBytes encodes the message for signing +func (msg MsgEstimateBatchGas) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +// GetSigners defines whose signature is required +func (msg MsgEstimateBatchGas) GetSigners() []sdk.AccAddress { + return libmeta.GetSigners(&msg) +} + // EthereumClaim represents a claim on ethereum state type EthereumClaim interface { // All Ethereum claims that we relay from the Skyway contract and into the module @@ -133,6 +165,8 @@ type EthereumClaim interface { GetChainReferenceId() string // Returns the reference ID of the remote chain on which this claim was observed. GetSkywayNonce() uint64 + // Returns the compass ID that sent the original message + GetCompassID() string } // nolint: exhaustruct @@ -219,10 +253,14 @@ const ( // note that the Orchestrator is the only field excluded from this hash, this is because that value is used higher up in the store // structure for who has made what claim and is verified by the msg ante-handler for signatures func (msg *MsgSendToPalomaClaim) ClaimHash() ([]byte, error) { - path := fmt.Sprintf("%d/%d/%s/%s/%s/%s", msg.SkywayNonce, msg.EthBlockHeight, msg.TokenContract, msg.Amount.String(), msg.EthereumSender, msg.PalomaReceiver) + path := fmt.Sprintf("%d/%d/%s/%s/%s/%s/%s", msg.SkywayNonce, msg.EthBlockHeight, msg.TokenContract, msg.Amount.String(), msg.EthereumSender, msg.PalomaReceiver, msg.CompassId) return tmhash.Sum([]byte(path)), nil } +func (msg *MsgSendToPalomaClaim) GetCompassID() string { + return msg.CompassId +} + func (msg *MsgBatchSendToRemoteClaim) SetOrchestrator(orchestrator sdk.AccAddress) { msg.Orchestrator = orchestrator.String() } @@ -254,10 +292,14 @@ func (e *MsgBatchSendToRemoteClaim) ValidateBasic() error { // Hash implements WithdrawBatch.Hash func (msg *MsgBatchSendToRemoteClaim) ClaimHash() ([]byte, error) { - path := fmt.Sprintf("%d/%d/%d/%s", msg.SkywayNonce, msg.EthBlockHeight, msg.BatchNonce, msg.TokenContract) + path := fmt.Sprintf("%d/%d/%d/%s/%s", msg.SkywayNonce, msg.EthBlockHeight, msg.BatchNonce, msg.TokenContract, msg.CompassId) return tmhash.Sum([]byte(path)), nil } +func (msg *MsgBatchSendToRemoteClaim) GetCompassID() string { + return msg.CompassId +} + func (msg MsgBatchSendToRemoteClaim) GetClaimer() sdk.AccAddress { err := msg.ValidateBasic() if err != nil { @@ -373,11 +415,15 @@ func (msg *MsgLightNodeSaleClaim) ValidateBasic() error { } func (msg *MsgLightNodeSaleClaim) ClaimHash() ([]byte, error) { - path := fmt.Sprintf("%d/%d/%s/%s", msg.SkywayNonce, msg.EthBlockHeight, - msg.ClientAddress, msg.Amount.String()) + path := fmt.Sprintf("%d/%d/%s/%s/%s", msg.SkywayNonce, msg.EthBlockHeight, + msg.ClientAddress, msg.Amount.String(), msg.CompassId) return tmhash.Sum([]byte(path)), nil } +func (msg *MsgLightNodeSaleClaim) GetCompassID() string { + return msg.CompassId +} + func (msg MsgLightNodeSaleClaim) GetClaimer() sdk.AccAddress { err := msg.ValidateBasic() if err != nil { diff --git a/x/skyway/types/msgs.pb.go b/x/skyway/types/msgs.pb.go index a4a89c33..38d632c2 100644 --- a/x/skyway/types/msgs.pb.go +++ b/x/skyway/types/msgs.pb.go @@ -292,6 +292,7 @@ type MsgSendToPalomaClaim struct { ChainReferenceId string `protobuf:"bytes,8,opt,name=chain_reference_id,json=chainReferenceId,proto3" json:"chain_reference_id,omitempty"` Metadata types1.MsgMetadata `protobuf:"bytes,9,opt,name=metadata,proto3" json:"metadata"` SkywayNonce uint64 `protobuf:"varint,10,opt,name=skyway_nonce,json=skywayNonce,proto3" json:"skyway_nonce,omitempty"` + CompassId string `protobuf:"bytes,11,opt,name=compass_id,json=compassId,proto3" json:"compass_id,omitempty"` } func (m *MsgSendToPalomaClaim) Reset() { *m = MsgSendToPalomaClaim{} } @@ -390,6 +391,13 @@ func (m *MsgSendToPalomaClaim) GetSkywayNonce() uint64 { return 0 } +func (m *MsgSendToPalomaClaim) GetCompassId() string { + if m != nil { + return m.CompassId + } + return "" +} + type MsgSendToPalomaClaimResponse struct { } @@ -437,6 +445,7 @@ type MsgBatchSendToRemoteClaim struct { Orchestrator string `protobuf:"bytes,6,opt,name=orchestrator,proto3" json:"orchestrator,omitempty"` Metadata types1.MsgMetadata `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata"` SkywayNonce uint64 `protobuf:"varint,8,opt,name=skyway_nonce,json=skywayNonce,proto3" json:"skyway_nonce,omitempty"` + CompassId string `protobuf:"bytes,9,opt,name=compass_id,json=compassId,proto3" json:"compass_id,omitempty"` } func (m *MsgBatchSendToRemoteClaim) Reset() { *m = MsgBatchSendToRemoteClaim{} } @@ -528,6 +537,13 @@ func (m *MsgBatchSendToRemoteClaim) GetSkywayNonce() uint64 { return 0 } +func (m *MsgBatchSendToRemoteClaim) GetCompassId() string { + if m != nil { + return m.CompassId + } + return "" +} + type MsgBatchSendToRemoteClaimResponse struct { } @@ -1379,6 +1395,7 @@ type MsgLightNodeSaleClaim struct { ClientAddress string `protobuf:"bytes,7,opt,name=client_address,json=clientAddress,proto3" json:"client_address,omitempty"` Amount cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` SmartContractAddress string `protobuf:"bytes,9,opt,name=smart_contract_address,json=smartContractAddress,proto3" json:"smart_contract_address,omitempty"` + CompassId string `protobuf:"bytes,10,opt,name=compass_id,json=compassId,proto3" json:"compass_id,omitempty"` } func (m *MsgLightNodeSaleClaim) Reset() { *m = MsgLightNodeSaleClaim{} } @@ -1470,6 +1487,92 @@ func (m *MsgLightNodeSaleClaim) GetSmartContractAddress() string { return "" } +func (m *MsgLightNodeSaleClaim) GetCompassId() string { + if m != nil { + return m.CompassId + } + return "" +} + +// MsgEstimateBatchGas is a message to estimate the gas for a batch +// Pigeons will send this message to transmit their gas estimation +// for a given batch. +type MsgEstimateBatchGas struct { + Metadata types1.MsgMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + TokenContract string `protobuf:"bytes,3,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"` + EthSigner string `protobuf:"bytes,4,opt,name=eth_signer,json=ethSigner,proto3" json:"eth_signer,omitempty"` + Estimate uint64 `protobuf:"varint,5,opt,name=estimate,proto3" json:"estimate,omitempty"` +} + +func (m *MsgEstimateBatchGas) Reset() { *m = MsgEstimateBatchGas{} } +func (m *MsgEstimateBatchGas) String() string { return proto.CompactTextString(m) } +func (*MsgEstimateBatchGas) ProtoMessage() {} +func (*MsgEstimateBatchGas) Descriptor() ([]byte, []int) { + return fileDescriptor_857e0e6098045c7c, []int{24} +} +func (m *MsgEstimateBatchGas) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEstimateBatchGas) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEstimateBatchGas.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEstimateBatchGas) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEstimateBatchGas.Merge(m, src) +} +func (m *MsgEstimateBatchGas) XXX_Size() int { + return m.Size() +} +func (m *MsgEstimateBatchGas) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEstimateBatchGas.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEstimateBatchGas proto.InternalMessageInfo + +func (m *MsgEstimateBatchGas) GetMetadata() types1.MsgMetadata { + if m != nil { + return m.Metadata + } + return types1.MsgMetadata{} +} + +func (m *MsgEstimateBatchGas) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +func (m *MsgEstimateBatchGas) GetTokenContract() string { + if m != nil { + return m.TokenContract + } + return "" +} + +func (m *MsgEstimateBatchGas) GetEthSigner() string { + if m != nil { + return m.EthSigner + } + return "" +} + +func (m *MsgEstimateBatchGas) GetEstimate() uint64 { + if m != nil { + return m.Estimate + } + return 0 +} + func init() { proto.RegisterType((*MsgSendToRemote)(nil), "palomachain.paloma.skyway.MsgSendToRemote") proto.RegisterType((*MsgSendToRemoteResponse)(nil), "palomachain.paloma.skyway.MsgSendToRemoteResponse") @@ -1495,6 +1598,7 @@ func init() { proto.RegisterType((*MsgUpdateParams)(nil), "palomachain.paloma.skyway.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "palomachain.paloma.skyway.MsgUpdateParamsResponse") proto.RegisterType((*MsgLightNodeSaleClaim)(nil), "palomachain.paloma.skyway.MsgLightNodeSaleClaim") + proto.RegisterType((*MsgEstimateBatchGas)(nil), "palomachain.paloma.skyway.MsgEstimateBatchGas") } func init() { @@ -1502,105 +1606,110 @@ func init() { } var fileDescriptor_857e0e6098045c7c = []byte{ - // 1562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcb, 0x6f, 0x1b, 0xd5, - 0x1a, 0xcf, 0xd8, 0xce, 0xc3, 0x5f, 0xde, 0x73, 0xd3, 0xd4, 0x76, 0x1b, 0xa7, 0xf5, 0xbd, 0x6d, - 0xa3, 0xaa, 0x1d, 0xdf, 0xa6, 0xbd, 0xb7, 0x80, 0x90, 0x4a, 0x1d, 0x52, 0x35, 0x40, 0xd2, 0xca, - 0x2e, 0x1b, 0x84, 0x64, 0x8e, 0x67, 0x4e, 0x67, 0x86, 0x78, 0xe6, 0x98, 0x39, 0xc7, 0x21, 0x5e, - 0x21, 0x75, 0xc5, 0x0a, 0xb1, 0x46, 0x2c, 0x41, 0x6c, 0x59, 0xf4, 0x8f, 0xa8, 0x58, 0x55, 0xac, - 0x10, 0x8b, 0x82, 0x5a, 0x24, 0x96, 0xec, 0x11, 0x0b, 0x74, 0x1e, 0x33, 0x1e, 0xdb, 0x63, 0x3b, - 0x69, 0xb3, 0x60, 0x15, 0x9f, 0xef, 0x75, 0xbe, 0xf3, 0xfb, 0x9e, 0x13, 0xf8, 0x4f, 0x0b, 0x35, - 0x89, 0x87, 0x4c, 0x07, 0xb9, 0x7e, 0x59, 0xfe, 0x2e, 0xd3, 0xfd, 0xce, 0xa7, 0xa8, 0x53, 0xf6, - 0xa8, 0x4d, 0x8d, 0x56, 0x40, 0x18, 0xd1, 0xf3, 0x31, 0x29, 0x43, 0xfe, 0x36, 0xa4, 0x54, 0xa1, - 0x68, 0x12, 0xea, 0x11, 0x5a, 0x6e, 0x20, 0x8a, 0xcb, 0x07, 0xd7, 0x1a, 0x98, 0xa1, 0x6b, 0x65, - 0x93, 0x70, 0x39, 0xae, 0x5a, 0x38, 0xad, 0xf8, 0x1e, 0xb5, 0xcb, 0x07, 0x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0x73, 0xe2, 0x2b, 0x0d, 0x0a, 0x23, 0xf6, 0xc4, 0x31, 0xa6, 0x87, 0x6b, - 0x16, 0xde, 0x7a, 0x59, 0xcd, 0x98, 0x73, 0x3e, 0xcc, 0xf5, 0xb4, 0xff, 0x31, 0x59, 0x1a, 0x97, - 0x1d, 0x97, 0xa5, 0x49, 0x0d, 0x57, 0xff, 0x08, 0xf4, 0x84, 0x66, 0x3b, 0x26, 0x20, 0x83, 0x1a, - 0x85, 0xd5, 0x81, 0x65, 0x7a, 0xdb, 0x6b, 0xb1, 0x4e, 0x69, 0xa2, 0x72, 0xe7, 0xc9, 0xf3, 0xa2, - 0xf6, 0xf4, 0x79, 0x51, 0xfb, 0xf5, 0x79, 0x51, 0xfb, 0xf2, 0x45, 0x71, 0xe2, 0xe9, 0x8b, 0xe2, - 0xc4, 0x4f, 0x2f, 0x8a, 0x13, 0x1f, 0x5c, 0xb1, 0x5d, 0xe6, 0xb4, 0x1b, 0x86, 0x49, 0xbc, 0x72, - 0xc2, 0xff, 0xa4, 0x0e, 0x7b, 0xfe, 0x79, 0xd5, 0x98, 0x12, 0x96, 0xaf, 0xff, 0x1d, 0x00, 0x00, - 0xff, 0xff, 0xf8, 0x19, 0xc4, 0xc4, 0x0f, 0x14, 0x00, 0x00, + // 1646 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0x5b, + 0x15, 0xcf, 0xd8, 0x4e, 0x62, 0x9f, 0x7c, 0x76, 0x5e, 0x5e, 0x6a, 0xfb, 0x35, 0x4e, 0x6b, 0x68, + 0x1b, 0x55, 0xef, 0x8d, 0x69, 0x5a, 0x28, 0x20, 0xa4, 0xb6, 0x0e, 0x29, 0x35, 0xe0, 0xb4, 0x1a, + 0x97, 0x0d, 0xaa, 0x64, 0xae, 0x67, 0x6e, 0x67, 0x86, 0x78, 0xe6, 0x9a, 0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, 0x95, 0x08, 0xe8, 0xa5, 0x06, + 0x7a, 0x0a, 0x99, 0xff, 0xda, 0x9c, 0xe4, 0x4d, 0x58, 0x94, 0xbf, 0x79, 0x5e, 0x8b, 0x44, 0x10, + 0xbf, 0xd1, 0xa0, 0x3c, 0x83, 0x88, 0xcf, 0x71, 0x3d, 0xdd, 0xb2, 0xfc, 0xe0, 0x43, 0x2d, 0x13, + 0xc1, 0x05, 0xb0, 0x3a, 0x72, 0xc9, 0xce, 0xe9, 0x81, 0xa4, 0xee, 0xbc, 0x1e, 0x48, 0xbb, 0xd6, + 0xf4, 0x9f, 0x80, 0x9e, 0x72, 0xa5, 0xcd, 0x49, 0xc8, 0xa4, 0xc5, 0xf4, 0x2e, 0xa8, 0x3f, 0x7a, + 0xfd, 0xae, 0xa2, 0xbd, 0x79, 0x57, 0xd1, 0xfe, 0xf1, 0xae, 0xa2, 0xfd, 0xfa, 0x7d, 0x65, 0xe1, + 0xcd, 0xfb, 0xca, 0xc2, 0xdf, 0xde, 0x57, 0x16, 0x7e, 0xfc, 0xb9, 0xe3, 0x31, 0xb7, 0xdf, 0x31, + 0x2c, 0xe2, 0xd7, 0x52, 0xfe, 0x65, 0x78, 0x3a, 0xf2, 0xbf, 0xc5, 0xce, 0x92, 0xf0, 0x7c, 0xe7, + 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x58, 0x38, 0xde, 0x60, 0xae, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1617,6 +1726,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { SendToRemote(ctx context.Context, in *MsgSendToRemote, opts ...grpc.CallOption) (*MsgSendToRemoteResponse, error) ConfirmBatch(ctx context.Context, in *MsgConfirmBatch, opts ...grpc.CallOption) (*MsgConfirmBatchResponse, error) + EstimateBatchGas(ctx context.Context, in *MsgEstimateBatchGas, opts ...grpc.CallOption) (*emptypb.Empty, error) SendToPalomaClaim(ctx context.Context, in *MsgSendToPalomaClaim, opts ...grpc.CallOption) (*MsgSendToPalomaClaimResponse, error) BatchSendToRemoteClaim(ctx context.Context, in *MsgBatchSendToRemoteClaim, opts ...grpc.CallOption) (*MsgBatchSendToRemoteClaimResponse, error) CancelSendToRemote(ctx context.Context, in *MsgCancelSendToRemote, opts ...grpc.CallOption) (*MsgCancelSendToRemoteResponse, error) @@ -1651,6 +1761,15 @@ func (c *msgClient) ConfirmBatch(ctx context.Context, in *MsgConfirmBatch, opts return out, nil } +func (c *msgClient) EstimateBatchGas(ctx context.Context, in *MsgEstimateBatchGas, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/palomachain.paloma.skyway.Msg/EstimateBatchGas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) SendToPalomaClaim(ctx context.Context, in *MsgSendToPalomaClaim, opts ...grpc.CallOption) (*MsgSendToPalomaClaimResponse, error) { out := new(MsgSendToPalomaClaimResponse) err := c.cc.Invoke(ctx, "/palomachain.paloma.skyway.Msg/SendToPalomaClaim", in, out, opts...) @@ -1709,6 +1828,7 @@ func (c *msgClient) LightNodeSaleClaim(ctx context.Context, in *MsgLightNodeSale type MsgServer interface { SendToRemote(context.Context, *MsgSendToRemote) (*MsgSendToRemoteResponse, error) ConfirmBatch(context.Context, *MsgConfirmBatch) (*MsgConfirmBatchResponse, error) + EstimateBatchGas(context.Context, *MsgEstimateBatchGas) (*emptypb.Empty, error) SendToPalomaClaim(context.Context, *MsgSendToPalomaClaim) (*MsgSendToPalomaClaimResponse, error) BatchSendToRemoteClaim(context.Context, *MsgBatchSendToRemoteClaim) (*MsgBatchSendToRemoteClaimResponse, error) CancelSendToRemote(context.Context, *MsgCancelSendToRemote) (*MsgCancelSendToRemoteResponse, error) @@ -1727,6 +1847,9 @@ func (*UnimplementedMsgServer) SendToRemote(ctx context.Context, req *MsgSendToR func (*UnimplementedMsgServer) ConfirmBatch(ctx context.Context, req *MsgConfirmBatch) (*MsgConfirmBatchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConfirmBatch not implemented") } +func (*UnimplementedMsgServer) EstimateBatchGas(ctx context.Context, req *MsgEstimateBatchGas) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateBatchGas not implemented") +} func (*UnimplementedMsgServer) SendToPalomaClaim(ctx context.Context, req *MsgSendToPalomaClaim) (*MsgSendToPalomaClaimResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendToPalomaClaim not implemented") } @@ -1786,6 +1909,24 @@ func _Msg_ConfirmBatch_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_EstimateBatchGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEstimateBatchGas) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EstimateBatchGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.skyway.Msg/EstimateBatchGas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EstimateBatchGas(ctx, req.(*MsgEstimateBatchGas)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_SendToPalomaClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSendToPalomaClaim) if err := dec(in); err != nil { @@ -1906,6 +2047,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ConfirmBatch", Handler: _Msg_ConfirmBatch_Handler, }, + { + MethodName: "EstimateBatchGas", + Handler: _Msg_EstimateBatchGas_Handler, + }, { MethodName: "SendToPalomaClaim", Handler: _Msg_SendToPalomaClaim_Handler, @@ -2124,6 +2269,13 @@ func (m *MsgSendToPalomaClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.CompassId) > 0 { + i -= len(m.CompassId) + copy(dAtA[i:], m.CompassId) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.CompassId))) + i-- + dAtA[i] = 0x5a + } if m.SkywayNonce != 0 { i = encodeVarintMsgs(dAtA, i, uint64(m.SkywayNonce)) i-- @@ -2240,6 +2392,13 @@ func (m *MsgBatchSendToRemoteClaim) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if len(m.CompassId) > 0 { + i -= len(m.CompassId) + copy(dAtA[i:], m.CompassId) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.CompassId))) + i-- + dAtA[i] = 0x4a + } if m.SkywayNonce != 0 { i = encodeVarintMsgs(dAtA, i, uint64(m.SkywayNonce)) i-- @@ -2914,6 +3073,13 @@ func (m *MsgLightNodeSaleClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.CompassId) > 0 { + i -= len(m.CompassId) + copy(dAtA[i:], m.CompassId) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.CompassId))) + i-- + dAtA[i] = 0x52 + } if len(m.SmartContractAddress) > 0 { i -= len(m.SmartContractAddress) copy(dAtA[i:], m.SmartContractAddress) @@ -2980,6 +3146,63 @@ func (m *MsgLightNodeSaleClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgEstimateBatchGas) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEstimateBatchGas) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEstimateBatchGas) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Estimate != 0 { + i = encodeVarintMsgs(dAtA, i, uint64(m.Estimate)) + i-- + dAtA[i] = 0x28 + } + if len(m.EthSigner) > 0 { + i -= len(m.EthSigner) + copy(dAtA[i:], m.EthSigner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.EthSigner))) + i-- + dAtA[i] = 0x22 + } + if len(m.TokenContract) > 0 { + i -= len(m.TokenContract) + copy(dAtA[i:], m.TokenContract) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.TokenContract))) + i-- + dAtA[i] = 0x1a + } + if m.Nonce != 0 { + i = encodeVarintMsgs(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { offset -= sovMsgs(v) base := offset @@ -3099,6 +3322,10 @@ func (m *MsgSendToPalomaClaim) Size() (n int) { if m.SkywayNonce != 0 { n += 1 + sovMsgs(uint64(m.SkywayNonce)) } + l = len(m.CompassId) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } return n } @@ -3143,6 +3370,10 @@ func (m *MsgBatchSendToRemoteClaim) Size() (n int) { if m.SkywayNonce != 0 { n += 1 + sovMsgs(uint64(m.SkywayNonce)) } + l = len(m.CompassId) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } return n } @@ -3440,6 +3671,35 @@ func (m *MsgLightNodeSaleClaim) Size() (n int) { if l > 0 { n += 1 + l + sovMsgs(uint64(l)) } + l = len(m.CompassId) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgEstimateBatchGas) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovMsgs(uint64(l)) + if m.Nonce != 0 { + n += 1 + sovMsgs(uint64(m.Nonce)) + } + l = len(m.TokenContract) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.EthSigner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Estimate != 0 { + n += 1 + sovMsgs(uint64(m.Estimate)) + } return n } @@ -4272,6 +4532,38 @@ func (m *MsgSendToPalomaClaim) Unmarshal(dAtA []byte) error { break } } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMsgs(dAtA[iNdEx:]) @@ -4577,6 +4869,38 @@ func (m *MsgBatchSendToRemoteClaim) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMsgs(dAtA[iNdEx:]) @@ -6666,6 +6990,223 @@ func (m *MsgLightNodeSaleClaim) Unmarshal(dAtA []byte) error { } m.SmartContractAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEstimateBatchGas) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEstimateBatchGas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEstimateBatchGas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenContract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenContract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthSigner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EthSigner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Estimate", wireType) + } + m.Estimate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Estimate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipMsgs(dAtA[iNdEx:]) diff --git a/x/skyway/types/query.pb.go b/x/skyway/types/query.pb.go index c4376bac..dc9bf332 100644 --- a/x/skyway/types/query.pb.go +++ b/x/skyway/types/query.pb.go @@ -6,6 +6,11 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -14,15 +19,14 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -30,8 +34,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryParamsRequest struct { -} +type QueryParamsRequest struct{} func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } @@ -39,9 +42,11 @@ func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{0} } + func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) @@ -54,12 +59,15 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsRequest.Merge(m, src) } + func (m *QueryParamsRequest) XXX_Size() int { return m.Size() } + func (m *QueryParamsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) } @@ -76,9 +84,11 @@ func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{1} } + func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) @@ -91,12 +101,15 @@ func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsResponse.Merge(m, src) } + func (m *QueryParamsResponse) XXX_Size() int { return m.Size() } + func (m *QueryParamsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) } @@ -117,6 +130,7 @@ type QueryLastPendingBatchRequestByAddrRequest struct { func (m *QueryLastPendingBatchRequestByAddrRequest) Reset() { *m = QueryLastPendingBatchRequestByAddrRequest{} } + func (m *QueryLastPendingBatchRequestByAddrRequest) String() string { return proto.CompactTextString(m) } @@ -124,9 +138,11 @@ func (*QueryLastPendingBatchRequestByAddrRequest) ProtoMessage() {} func (*QueryLastPendingBatchRequestByAddrRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{2} } + func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.Marshal(b, m, deterministic) @@ -139,12 +155,15 @@ func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Marshal(b []byte, determ return b[:n], nil } } + func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.Merge(m, src) } + func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Size() int { return m.Size() } + func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.DiscardUnknown(m) } @@ -165,6 +184,7 @@ type QueryLastPendingBatchRequestByAddrResponse struct { func (m *QueryLastPendingBatchRequestByAddrResponse) Reset() { *m = QueryLastPendingBatchRequestByAddrResponse{} } + func (m *QueryLastPendingBatchRequestByAddrResponse) String() string { return proto.CompactTextString(m) } @@ -172,9 +192,11 @@ func (*QueryLastPendingBatchRequestByAddrResponse) ProtoMessage() {} func (*QueryLastPendingBatchRequestByAddrResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{3} } + func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.Marshal(b, m, deterministic) @@ -187,12 +209,15 @@ func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Marshal(b []byte, deter return b[:n], nil } } + func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.Merge(m, src) } + func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Size() int { return m.Size() } + func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.DiscardUnknown(m) } @@ -217,9 +242,11 @@ func (*QueryOutgoingTxBatchesRequest) ProtoMessage() {} func (*QueryOutgoingTxBatchesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{4} } + func (m *QueryOutgoingTxBatchesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryOutgoingTxBatchesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryOutgoingTxBatchesRequest.Marshal(b, m, deterministic) @@ -232,12 +259,15 @@ func (m *QueryOutgoingTxBatchesRequest) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } + func (m *QueryOutgoingTxBatchesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryOutgoingTxBatchesRequest.Merge(m, src) } + func (m *QueryOutgoingTxBatchesRequest) XXX_Size() int { return m.Size() } + func (m *QueryOutgoingTxBatchesRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryOutgoingTxBatchesRequest.DiscardUnknown(m) } @@ -268,9 +298,11 @@ func (*QueryOutgoingTxBatchesResponse) ProtoMessage() {} func (*QueryOutgoingTxBatchesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{5} } + func (m *QueryOutgoingTxBatchesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryOutgoingTxBatchesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryOutgoingTxBatchesResponse.Marshal(b, m, deterministic) @@ -283,12 +315,15 @@ func (m *QueryOutgoingTxBatchesResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } + func (m *QueryOutgoingTxBatchesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryOutgoingTxBatchesResponse.Merge(m, src) } + func (m *QueryOutgoingTxBatchesResponse) XXX_Size() int { return m.Size() } + func (m *QueryOutgoingTxBatchesResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryOutgoingTxBatchesResponse.DiscardUnknown(m) } @@ -313,9 +348,11 @@ func (*QueryBatchRequestByNonceRequest) ProtoMessage() {} func (*QueryBatchRequestByNonceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{6} } + func (m *QueryBatchRequestByNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBatchRequestByNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchRequestByNonceRequest.Marshal(b, m, deterministic) @@ -328,12 +365,15 @@ func (m *QueryBatchRequestByNonceRequest) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } + func (m *QueryBatchRequestByNonceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchRequestByNonceRequest.Merge(m, src) } + func (m *QueryBatchRequestByNonceRequest) XXX_Size() int { return m.Size() } + func (m *QueryBatchRequestByNonceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchRequestByNonceRequest.DiscardUnknown(m) } @@ -364,9 +404,11 @@ func (*QueryBatchRequestByNonceResponse) ProtoMessage() {} func (*QueryBatchRequestByNonceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{7} } + func (m *QueryBatchRequestByNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBatchRequestByNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchRequestByNonceResponse.Marshal(b, m, deterministic) @@ -379,12 +421,15 @@ func (m *QueryBatchRequestByNonceResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } + func (m *QueryBatchRequestByNonceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchRequestByNonceResponse.Merge(m, src) } + func (m *QueryBatchRequestByNonceResponse) XXX_Size() int { return m.Size() } + func (m *QueryBatchRequestByNonceResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchRequestByNonceResponse.DiscardUnknown(m) } @@ -409,9 +454,11 @@ func (*QueryBatchConfirmsRequest) ProtoMessage() {} func (*QueryBatchConfirmsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{8} } + func (m *QueryBatchConfirmsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBatchConfirmsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchConfirmsRequest.Marshal(b, m, deterministic) @@ -424,12 +471,15 @@ func (m *QueryBatchConfirmsRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } + func (m *QueryBatchConfirmsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchConfirmsRequest.Merge(m, src) } + func (m *QueryBatchConfirmsRequest) XXX_Size() int { return m.Size() } + func (m *QueryBatchConfirmsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchConfirmsRequest.DiscardUnknown(m) } @@ -460,9 +510,11 @@ func (*QueryBatchConfirmsResponse) ProtoMessage() {} func (*QueryBatchConfirmsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{9} } + func (m *QueryBatchConfirmsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBatchConfirmsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchConfirmsResponse.Marshal(b, m, deterministic) @@ -475,12 +527,15 @@ func (m *QueryBatchConfirmsResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *QueryBatchConfirmsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchConfirmsResponse.Merge(m, src) } + func (m *QueryBatchConfirmsResponse) XXX_Size() int { return m.Size() } + func (m *QueryBatchConfirmsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchConfirmsResponse.DiscardUnknown(m) } @@ -504,9 +559,11 @@ func (*QueryLastObservedSkywayNonceRequest) ProtoMessage() {} func (*QueryLastObservedSkywayNonceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{10} } + func (m *QueryLastObservedSkywayNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastObservedSkywayNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedSkywayNonceRequest.Marshal(b, m, deterministic) @@ -519,12 +576,15 @@ func (m *QueryLastObservedSkywayNonceRequest) XXX_Marshal(b []byte, deterministi return b[:n], nil } } + func (m *QueryLastObservedSkywayNonceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedSkywayNonceRequest.Merge(m, src) } + func (m *QueryLastObservedSkywayNonceRequest) XXX_Size() int { return m.Size() } + func (m *QueryLastObservedSkywayNonceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedSkywayNonceRequest.DiscardUnknown(m) } @@ -546,6 +606,7 @@ type QueryLastObservedSkywayNonceByAddrRequest struct { func (m *QueryLastObservedSkywayNonceByAddrRequest) Reset() { *m = QueryLastObservedSkywayNonceByAddrRequest{} } + func (m *QueryLastObservedSkywayNonceByAddrRequest) String() string { return proto.CompactTextString(m) } @@ -553,9 +614,11 @@ func (*QueryLastObservedSkywayNonceByAddrRequest) ProtoMessage() {} func (*QueryLastObservedSkywayNonceByAddrRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{11} } + func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedSkywayNonceByAddrRequest.Marshal(b, m, deterministic) @@ -568,12 +631,15 @@ func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_Marshal(b []byte, determ return b[:n], nil } } + func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedSkywayNonceByAddrRequest.Merge(m, src) } + func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_Size() int { return m.Size() } + func (m *QueryLastObservedSkywayNonceByAddrRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedSkywayNonceByAddrRequest.DiscardUnknown(m) } @@ -604,9 +670,11 @@ func (*QueryLastObservedSkywayNonceResponse) ProtoMessage() {} func (*QueryLastObservedSkywayNonceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{12} } + func (m *QueryLastObservedSkywayNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastObservedSkywayNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedSkywayNonceResponse.Marshal(b, m, deterministic) @@ -619,12 +687,15 @@ func (m *QueryLastObservedSkywayNonceResponse) XXX_Marshal(b []byte, determinist return b[:n], nil } } + func (m *QueryLastObservedSkywayNonceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedSkywayNonceResponse.Merge(m, src) } + func (m *QueryLastObservedSkywayNonceResponse) XXX_Size() int { return m.Size() } + func (m *QueryLastObservedSkywayNonceResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedSkywayNonceResponse.DiscardUnknown(m) } @@ -648,9 +719,11 @@ func (*QueryLastObservedSkywayBlockRequest) ProtoMessage() {} func (*QueryLastObservedSkywayBlockRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{13} } + func (m *QueryLastObservedSkywayBlockRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastObservedSkywayBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedSkywayBlockRequest.Marshal(b, m, deterministic) @@ -663,12 +736,15 @@ func (m *QueryLastObservedSkywayBlockRequest) XXX_Marshal(b []byte, deterministi return b[:n], nil } } + func (m *QueryLastObservedSkywayBlockRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedSkywayBlockRequest.Merge(m, src) } + func (m *QueryLastObservedSkywayBlockRequest) XXX_Size() int { return m.Size() } + func (m *QueryLastObservedSkywayBlockRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedSkywayBlockRequest.DiscardUnknown(m) } @@ -692,9 +768,11 @@ func (*QueryLastObservedSkywayBlockResponse) ProtoMessage() {} func (*QueryLastObservedSkywayBlockResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{14} } + func (m *QueryLastObservedSkywayBlockResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLastObservedSkywayBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedSkywayBlockResponse.Marshal(b, m, deterministic) @@ -707,12 +785,15 @@ func (m *QueryLastObservedSkywayBlockResponse) XXX_Marshal(b []byte, determinist return b[:n], nil } } + func (m *QueryLastObservedSkywayBlockResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedSkywayBlockResponse.Merge(m, src) } + func (m *QueryLastObservedSkywayBlockResponse) XXX_Size() int { return m.Size() } + func (m *QueryLastObservedSkywayBlockResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedSkywayBlockResponse.DiscardUnknown(m) } @@ -737,9 +818,11 @@ func (*QueryERC20ToDenomRequest) ProtoMessage() {} func (*QueryERC20ToDenomRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{15} } + func (m *QueryERC20ToDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryERC20ToDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryERC20ToDenomRequest.Marshal(b, m, deterministic) @@ -752,12 +835,15 @@ func (m *QueryERC20ToDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } + func (m *QueryERC20ToDenomRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryERC20ToDenomRequest.Merge(m, src) } + func (m *QueryERC20ToDenomRequest) XXX_Size() int { return m.Size() } + func (m *QueryERC20ToDenomRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryERC20ToDenomRequest.DiscardUnknown(m) } @@ -788,9 +874,11 @@ func (*QueryERC20ToDenomResponse) ProtoMessage() {} func (*QueryERC20ToDenomResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{16} } + func (m *QueryERC20ToDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryERC20ToDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryERC20ToDenomResponse.Marshal(b, m, deterministic) @@ -803,12 +891,15 @@ func (m *QueryERC20ToDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } + func (m *QueryERC20ToDenomResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryERC20ToDenomResponse.Merge(m, src) } + func (m *QueryERC20ToDenomResponse) XXX_Size() int { return m.Size() } + func (m *QueryERC20ToDenomResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryERC20ToDenomResponse.DiscardUnknown(m) } @@ -833,9 +924,11 @@ func (*QueryDenomToERC20Request) ProtoMessage() {} func (*QueryDenomToERC20Request) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{17} } + func (m *QueryDenomToERC20Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryDenomToERC20Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryDenomToERC20Request.Marshal(b, m, deterministic) @@ -848,12 +941,15 @@ func (m *QueryDenomToERC20Request) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } + func (m *QueryDenomToERC20Request) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryDenomToERC20Request.Merge(m, src) } + func (m *QueryDenomToERC20Request) XXX_Size() int { return m.Size() } + func (m *QueryDenomToERC20Request) XXX_DiscardUnknown() { xxx_messageInfo_QueryDenomToERC20Request.DiscardUnknown(m) } @@ -884,9 +980,11 @@ func (*QueryDenomToERC20Response) ProtoMessage() {} func (*QueryDenomToERC20Response) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{18} } + func (m *QueryDenomToERC20Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryDenomToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryDenomToERC20Response.Marshal(b, m, deterministic) @@ -899,12 +997,15 @@ func (m *QueryDenomToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } + func (m *QueryDenomToERC20Response) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryDenomToERC20Response.Merge(m, src) } + func (m *QueryDenomToERC20Response) XXX_Size() int { return m.Size() } + func (m *QueryDenomToERC20Response) XXX_DiscardUnknown() { xxx_messageInfo_QueryDenomToERC20Response.DiscardUnknown(m) } @@ -948,9 +1049,11 @@ func (*QueryAttestationsRequest) ProtoMessage() {} func (*QueryAttestationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{19} } + func (m *QueryAttestationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryAttestationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryAttestationsRequest.Marshal(b, m, deterministic) @@ -963,12 +1066,15 @@ func (m *QueryAttestationsRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } + func (m *QueryAttestationsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryAttestationsRequest.Merge(m, src) } + func (m *QueryAttestationsRequest) XXX_Size() int { return m.Size() } + func (m *QueryAttestationsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryAttestationsRequest.DiscardUnknown(m) } @@ -1027,9 +1133,11 @@ func (*QueryAttestationsResponse) ProtoMessage() {} func (*QueryAttestationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{20} } + func (m *QueryAttestationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryAttestationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryAttestationsResponse.Marshal(b, m, deterministic) @@ -1042,12 +1150,15 @@ func (m *QueryAttestationsResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } + func (m *QueryAttestationsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryAttestationsResponse.Merge(m, src) } + func (m *QueryAttestationsResponse) XXX_Size() int { return m.Size() } + func (m *QueryAttestationsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryAttestationsResponse.DiscardUnknown(m) } @@ -1061,8 +1172,7 @@ func (m *QueryAttestationsResponse) GetAttestations() []Attestation { return nil } -type QueryErc20ToDenoms struct { -} +type QueryErc20ToDenoms struct{} func (m *QueryErc20ToDenoms) Reset() { *m = QueryErc20ToDenoms{} } func (m *QueryErc20ToDenoms) String() string { return proto.CompactTextString(m) } @@ -1070,9 +1180,11 @@ func (*QueryErc20ToDenoms) ProtoMessage() {} func (*QueryErc20ToDenoms) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{21} } + func (m *QueryErc20ToDenoms) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryErc20ToDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryErc20ToDenoms.Marshal(b, m, deterministic) @@ -1085,12 +1197,15 @@ func (m *QueryErc20ToDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *QueryErc20ToDenoms) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryErc20ToDenoms.Merge(m, src) } + func (m *QueryErc20ToDenoms) XXX_Size() int { return m.Size() } + func (m *QueryErc20ToDenoms) XXX_DiscardUnknown() { xxx_messageInfo_QueryErc20ToDenoms.DiscardUnknown(m) } @@ -1107,9 +1222,11 @@ func (*QueryErc20ToDenomsResponse) ProtoMessage() {} func (*QueryErc20ToDenomsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{22} } + func (m *QueryErc20ToDenomsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryErc20ToDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryErc20ToDenomsResponse.Marshal(b, m, deterministic) @@ -1122,12 +1239,15 @@ func (m *QueryErc20ToDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *QueryErc20ToDenomsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryErc20ToDenomsResponse.Merge(m, src) } + func (m *QueryErc20ToDenomsResponse) XXX_Size() int { return m.Size() } + func (m *QueryErc20ToDenomsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryErc20ToDenomsResponse.DiscardUnknown(m) } @@ -1151,9 +1271,11 @@ func (*QueryPendingSendToRemote) ProtoMessage() {} func (*QueryPendingSendToRemote) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{23} } + func (m *QueryPendingSendToRemote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryPendingSendToRemote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryPendingSendToRemote.Marshal(b, m, deterministic) @@ -1166,12 +1288,15 @@ func (m *QueryPendingSendToRemote) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } + func (m *QueryPendingSendToRemote) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryPendingSendToRemote.Merge(m, src) } + func (m *QueryPendingSendToRemote) XXX_Size() int { return m.Size() } + func (m *QueryPendingSendToRemote) XXX_DiscardUnknown() { xxx_messageInfo_QueryPendingSendToRemote.DiscardUnknown(m) } @@ -1196,9 +1321,11 @@ func (*QueryPendingSendToRemoteResponse) ProtoMessage() {} func (*QueryPendingSendToRemoteResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{24} } + func (m *QueryPendingSendToRemoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryPendingSendToRemoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryPendingSendToRemoteResponse.Marshal(b, m, deterministic) @@ -1211,12 +1338,15 @@ func (m *QueryPendingSendToRemoteResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } + func (m *QueryPendingSendToRemoteResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryPendingSendToRemoteResponse.Merge(m, src) } + func (m *QueryPendingSendToRemoteResponse) XXX_Size() int { return m.Size() } + func (m *QueryPendingSendToRemoteResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryPendingSendToRemoteResponse.DiscardUnknown(m) } @@ -1247,9 +1377,11 @@ func (*QueryBridgeTaxesResponse) ProtoMessage() {} func (*QueryBridgeTaxesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{25} } + func (m *QueryBridgeTaxesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBridgeTaxesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBridgeTaxesResponse.Marshal(b, m, deterministic) @@ -1262,12 +1394,15 @@ func (m *QueryBridgeTaxesResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } + func (m *QueryBridgeTaxesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBridgeTaxesResponse.Merge(m, src) } + func (m *QueryBridgeTaxesResponse) XXX_Size() int { return m.Size() } + func (m *QueryBridgeTaxesResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBridgeTaxesResponse.DiscardUnknown(m) } @@ -1291,9 +1426,11 @@ func (*QueryBridgeTransferLimitsResponse) ProtoMessage() {} func (*QueryBridgeTransferLimitsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{26} } + func (m *QueryBridgeTransferLimitsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBridgeTransferLimitsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBridgeTransferLimitsResponse.Marshal(b, m, deterministic) @@ -1306,12 +1443,15 @@ func (m *QueryBridgeTransferLimitsResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } + func (m *QueryBridgeTransferLimitsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBridgeTransferLimitsResponse.Merge(m, src) } + func (m *QueryBridgeTransferLimitsResponse) XXX_Size() int { return m.Size() } + func (m *QueryBridgeTransferLimitsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBridgeTransferLimitsResponse.DiscardUnknown(m) } @@ -1333,6 +1473,7 @@ type QueryBridgeTransferLimitsResponse_LimitUsage struct { func (m *QueryBridgeTransferLimitsResponse_LimitUsage) Reset() { *m = QueryBridgeTransferLimitsResponse_LimitUsage{} } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) String() string { return proto.CompactTextString(m) } @@ -1340,9 +1481,11 @@ func (*QueryBridgeTransferLimitsResponse_LimitUsage) ProtoMessage() {} func (*QueryBridgeTransferLimitsResponse_LimitUsage) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{26, 0} } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBridgeTransferLimitsResponse_LimitUsage.Marshal(b, m, deterministic) @@ -1355,12 +1498,15 @@ func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_Marshal(b []byte, det return b[:n], nil } } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBridgeTransferLimitsResponse_LimitUsage.Merge(m, src) } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_Size() int { return m.Size() } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) XXX_DiscardUnknown() { xxx_messageInfo_QueryBridgeTransferLimitsResponse_LimitUsage.DiscardUnknown(m) } @@ -1391,9 +1537,11 @@ func (*QueryLightNodeSaleContractsResponse) ProtoMessage() {} func (*QueryLightNodeSaleContractsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_933fccfef6a08c1d, []int{27} } + func (m *QueryLightNodeSaleContractsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *QueryLightNodeSaleContractsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLightNodeSaleContractsResponse.Marshal(b, m, deterministic) @@ -1406,12 +1554,15 @@ func (m *QueryLightNodeSaleContractsResponse) XXX_Marshal(b []byte, deterministi return b[:n], nil } } + func (m *QueryLightNodeSaleContractsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLightNodeSaleContractsResponse.Merge(m, src) } + func (m *QueryLightNodeSaleContractsResponse) XXX_Size() int { return m.Size() } + func (m *QueryLightNodeSaleContractsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLightNodeSaleContractsResponse.DiscardUnknown(m) } @@ -1425,6 +1576,124 @@ func (m *QueryLightNodeSaleContractsResponse) GetLightNodeSaleContracts() []*Lig return nil } +type QueryLastPendingBatchForGasEstimationRequest struct { + // Address of the asking to estimate + Address github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"address,omitempty"` + // Chain reference id of the remote chain to query for + ChainReferenceId string `protobuf:"bytes,2,opt,name=chain_reference_id,json=chainReferenceId,proto3" json:"chain_reference_id,omitempty"` +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) Reset() { + *m = QueryLastPendingBatchForGasEstimationRequest{} +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryLastPendingBatchForGasEstimationRequest) ProtoMessage() {} +func (*QueryLastPendingBatchForGasEstimationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_933fccfef6a08c1d, []int{28} +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLastPendingBatchForGasEstimationRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLastPendingBatchForGasEstimationRequest.Merge(m, src) +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) XXX_Size() int { + return m.Size() +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLastPendingBatchForGasEstimationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLastPendingBatchForGasEstimationRequest proto.InternalMessageInfo + +func (m *QueryLastPendingBatchForGasEstimationRequest) GetAddress() github_com_cosmos_cosmos_sdk_types.ValAddress { + if m != nil { + return m.Address + } + return nil +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) GetChainReferenceId() string { + if m != nil { + return m.ChainReferenceId + } + return "" +} + +type QueryLastPendingBatchForGasEstimationResponse struct { + Batch []OutgoingTxBatch `protobuf:"bytes,1,rep,name=batch,proto3" json:"batch"` +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) Reset() { + *m = QueryLastPendingBatchForGasEstimationResponse{} +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryLastPendingBatchForGasEstimationResponse) ProtoMessage() {} +func (*QueryLastPendingBatchForGasEstimationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_933fccfef6a08c1d, []int{29} +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLastPendingBatchForGasEstimationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLastPendingBatchForGasEstimationResponse.Merge(m, src) +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) XXX_Size() int { + return m.Size() +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLastPendingBatchForGasEstimationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLastPendingBatchForGasEstimationResponse proto.InternalMessageInfo + +func (m *QueryLastPendingBatchForGasEstimationResponse) GetBatch() []OutgoingTxBatch { + if m != nil { + return m.Batch + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "palomachain.paloma.skyway.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "palomachain.paloma.skyway.QueryParamsResponse") @@ -1455,6 +1724,8 @@ func init() { proto.RegisterType((*QueryBridgeTransferLimitsResponse)(nil), "palomachain.paloma.skyway.QueryBridgeTransferLimitsResponse") proto.RegisterType((*QueryBridgeTransferLimitsResponse_LimitUsage)(nil), "palomachain.paloma.skyway.QueryBridgeTransferLimitsResponse.LimitUsage") proto.RegisterType((*QueryLightNodeSaleContractsResponse)(nil), "palomachain.paloma.skyway.QueryLightNodeSaleContractsResponse") + proto.RegisterType((*QueryLastPendingBatchForGasEstimationRequest)(nil), "palomachain.paloma.skyway.QueryLastPendingBatchForGasEstimationRequest") + proto.RegisterType((*QueryLastPendingBatchForGasEstimationResponse)(nil), "palomachain.paloma.skyway.QueryLastPendingBatchForGasEstimationResponse") } func init() { @@ -1462,104 +1733,113 @@ func init() { } var fileDescriptor_933fccfef6a08c1d = []byte{ - // 1466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x8f, 0xd4, 0xc6, - 0x16, 0x6e, 0x0f, 0xf3, 0xe2, 0x0c, 0x8f, 0xb9, 0xc5, 0x68, 0xe8, 0xf1, 0xbd, 0x34, 0x50, 0x97, - 0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1f, 0x11, 0x6b, 0x5d, 0xb8, 0x26, 0x56, 0x67, 0x57, 0x1b, 0x0f, 0xb3, 0xd8, 0x21, 0x4c, - 0x01, 0x1d, 0xf1, 0x10, 0x66, 0x04, 0x9d, 0xc8, 0x08, 0x7a, 0x1d, 0x4e, 0xe4, 0x67, 0x22, 0xeb, - 0x97, 0xba, 0x3c, 0x39, 0x75, 0xa8, 0xbb, 0xb4, 0xb3, 0x35, 0x5e, 0x1d, 0xb2, 0x29, 0x49, 0xd0, - 0x21, 0xa5, 0x76, 0x30, 0xa1, 0x28, 0x89, 0x01, 0xfe, 0x04, 0xca, 0xc2, 0x7b, 0xad, 0x79, 0x73, - 0xf9, 0x62, 0x8b, 0xae, 0x12, 0x8f, 0x76, 0x63, 0x7b, 0x8c, 0xf8, 0x9d, 0xe5, 0x8b, 0x32, 0x74, - 0x38, 0xd8, 0x65, 0xc1, 0x2e, 0xc9, 0x4d, 0x9c, 0xc4, 0x1f, 0x52, 0xb2, 0x82, 0x09, 0x15, 0x40, - 0x0c, 0x22, 0x4a, 0xc2, 0xb6, 0x45, 0x85, 0x67, 0x8c, 0xd2, 0x4e, 0x8f, 0x31, 0x29, 0x25, 0xf1, - 0x87, 0x94, 0x76, 0xe6, 0x8c, 0x9f, 0x69, 0x92, 0xd3, 0xca, 0x50, 0x05, 0xc4, 0x8f, 0xa2, 0xe8, - 0x70, 0xaa, 0xb0, 0x62, 0x80, 0x96, 0x60, 0x96, 0xfa, 0x16, 0xf1, 0x8d, 0xf6, 0x40, 0x32, 0x99, - 0x11, 0xe3, 0xfa, 0x00, 0x1d, 0x01, 0xe8, 0xb8, 0xa6, 0xd3, 0x35, 0x82, 0x4e, 0x5e, 0xde, 0x23, - 0x5e, 0xee, 0x15, 0x33, 0xad, 0x41, 0x2f, 0xb6, 0x77, 0x26, 0xe3, 0x47, 0x7b, 0x11, 0xa6, 0x37, - 0x49, 0xd0, 0x21, 0xcb, 0x53, 0x62, 0x5a, 0x8e, 0x32, 0x72, 0x9f, 0x49, 0xcf, 0xfd, 0xce, 0xe4, - 0xec, 0xf4, 0xfc, 0x4c, 0x13, 0xfa, 0x8c, 0x18, 0x8f, 0x2e, 0x19, 0x5b, 0x64, 0x80, 0xbb, 0xb2, - 0x1a, 0xc9, 0xcc, 0x64, 0x35, 0x1e, 0xc0, 0xbe, 0x98, 0xee, 0x51, 0x57, 0xc1, 0xa9, 0x9c, 0xab, - 0x20, 0x06, 0x23, 0xaf, 0x81, 0x04, 0x42, 0xd4, 0xa8, 0xd7, 0x82, 0xba, 0xca, 0xfd, 0xc0, 0xf0, - 0x43, 0x79, 0x19, 0x25, 0x66, 0x23, 0x16, 0xeb, 0x70, 0x40, 0x2c, 0x83, 0xc1, 0xa9, 0xa1, 0x56, - 0x3f, 0xe0, 0x71, 0x3a, 0x87, 0x47, 0x7c, 0xbf, 0x29, 0x22, 0x24, 0x86, 0x8e, 0x57, 0xe4, 0x8a, - 0xca, 0xc6, 0xbb, 0x4e, 0x3c, 0xab, 0x45, 0x9b, 0xa4, 0x4b, 0x39, 0x41, 0x27, 0xe1, 0x00, 0x23, - 0x5e, 0xb0, 0x78, 0xc9, 0x4b, 0x63, 0x7f, 0x38, 0xab, 0xae, 0xd0, 0xbf, 0x35, 0xd9, 0x0d, 0x52, - 0x30, 0x22, 0xf2, 0x04, 0x16, 0x94, 0x10, 0x62, 0x86, 0xe3, 0x19, 0xc9, 0x76, 0x77, 0x61, 0x94, - 0xe6, 0x20, 0xdd, 0x5b, 0xdb, 0x32, 0x11, 0x14, 0x01, 0xde, 0xf6, 0x64, 0x43, 0x45, 0x16, 0x1c, - 0xea, 0x7b, 0x21, 0xb6, 0x15, 0x29, 0xaf, 0xe0, 0xf2, 0x1f, 0x3f, 0x4a, 0x84, 0xa7, 0x5e, 0x31, - 0xdc, 0x91, 0x45, 0xab, 0x0b, 0x85, 0xd7, 0x32, 0xb7, 0x63, 0xad, 0xbc, 0x01, 0xfb, 0x86, 0x22, - 0x31, 0x4a, 0xf0, 0x44, 0x4e, 0xe8, 0x08, 0xa5, 0x39, 0xd7, 0x1e, 0x02, 0xe2, 0x9f, 0x26, 0xe0, - 0x78, 0x3c, 0x8a, 0x8c, 0x7e, 0x37, 0x38, 0x56, 0xc3, 0x70, 0x06, 0x4c, 0x8b, 0x83, 0xa6, 0x02, - 0x35, 0x72, 0x02, 0x15, 0xa2, 0x55, 0xc5, 0xf0, 0x03, 0x66, 0xda, 0xa4, 0x29, 0x61, 0xf5, 0x1f, - 0x34, 0x80, 0xe1, 0x34, 0x5a, 0x8d, 0x9f, 0xf2, 0xb9, 0xe5, 0x6a, 0x71, 0x5e, 0xf1, 0x48, 0xea, - 0x56, 0x58, 0x85, 0xa9, 0x7e, 0x00, 0x27, 0xae, 0x84, 0xdd, 0xa0, 0x84, 0xdc, 0x42, 0x67, 0xfc, - 0x9d, 0xa6, 0x1a, 0x49, 0x70, 0x05, 0xdc, 0xa3, 0x16, 0x59, 0x37, 0x5d, 0x72, 0x53, 0x76, 0xf8, - 0x61, 0x8d, 0xb6, 0x60, 0x29, 0x4b, 0x54, 0xab, 0xb2, 0x5d, 0xcc, 0x61, 0x90, 0x8a, 0xde, 0x5c, - 0x74, 0x53, 0x83, 0x2e, 0xff, 0x8c, 0x60, 0x4a, 0x90, 0x42, 0x0e, 0x4c, 0x87, 0xb2, 0x19, 0x5d, - 0x28, 0x5a, 0x94, 0x84, 0x5e, 0xd7, 0xab, 0xa3, 0x9a, 0x87, 0xf9, 0xe1, 0x12, 0xfa, 0x55, 0x83, - 0x23, 0xb9, 0xf2, 0x19, 0xad, 0x16, 0x61, 0x8e, 0x22, 0xe2, 0xf5, 0xb5, 0x57, 0x44, 0x89, 0x08, - 0xff, 0xa8, 0xc1, 0xe1, 0x0c, 0xf1, 0x80, 0xde, 0x1d, 0x25, 0x48, 0xb6, 0x7e, 0xd2, 0x6f, 0x8c, - 0xed, 0x1f, 0xd1, 0xfb, 0x45, 0xd6, 0x33, 0x53, 0x50, 0x8d, 0x56, 0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 0xfe, 0xe7, 0xaa, 0xaa, 0xff, 0x5c, 0xd5, 0xb5, 0x6e, 0x8f, 0x0f, 0xf4, 0xcb, 0x23, 0xea, - 0x9b, 0xb8, 0x26, 0xc3, 0xb5, 0xaf, 0x7e, 0xff, 0xeb, 0xfb, 0x89, 0xb3, 0xe8, 0x74, 0x6d, 0x94, - 0x3f, 0x7b, 0x84, 0x05, 0xfd, 0xf4, 0xf0, 0x90, 0x50, 0x42, 0x2b, 0x65, 0x32, 0xbb, 0xfe, 0x2a, - 0xca, 0x0b, 0xbf, 0x23, 0x28, 0xbe, 0x81, 0xae, 0xe6, 0x50, 0x34, 0x5d, 0xd7, 0x48, 0xfd, 0xa9, - 0xc8, 0xd0, 0x6f, 0x1a, 0x2c, 0x35, 0x08, 0x4f, 0x17, 0x42, 0x99, 0x94, 0x8b, 0xfb, 0x43, 0xae, - 0xb0, 0xc2, 0xd7, 0x05, 0xe9, 0xff, 0xa3, 0x2b, 0xb5, 0xdd, 0xff, 0xce, 0x64, 0xf5, 0x5b, 0x4f, - 0x9e, 0x57, 0xb4, 0xa7, 0xcf, 0x2b, 0xda, 0x9f, 0xcf, 0x2b, 0xda, 0xe3, 0x17, 0x95, 0xd2, 0xd3, - 0x17, 0x95, 0xd2, 0xb3, 0x17, 0x95, 0xd2, 0x47, 0xe7, 0x6d, 0x87, 0x6f, 0xf6, 0xdb, 0xd5, 0x0e, - 0xed, 0xa6, 0x21, 0x6f, 0x27, 0x7e, 0x01, 0xb7, 0xa7, 0x45, 0x56, 0x97, 0xff, 0x09, 0x00, 0x00, - 0xff, 0xff, 0x7c, 0xc0, 0xc1, 0x26, 0x45, 0x17, 0x00, 0x00, + // 1579 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0xcd, 0x6f, 0xd4, 0x46, + 0x1b, 0x5f, 0x87, 0x7c, 0xf1, 0x24, 0x40, 0xde, 0x21, 0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xff, 0xe6, 0x4b, 0xd1, 0x2b, 0x09, 0x16, 0xf2, 0xe4, 0x19, + 0xaa, 0x0d, 0xaa, 0x38, 0x52, 0xb4, 0xa8, 0xfc, 0xde, 0xee, 0x81, 0x78, 0xd4, 0x2b, 0x2c, 0xea, + 0x6b, 0xe8, 0x4a, 0x46, 0xd4, 0xed, 0x00, 0x28, 0xe8, 0x05, 0xd5, 0x0d, 0xe2, 0xaa, 0x86, 0x46, + 0x55, 0x1c, 0x82, 0x55, 0x6f, 0x3c, 0x79, 0x51, 0x92, 0x9e, 0xbe, 0x28, 0x49, 0x7f, 0xbe, 0x28, + 0x49, 0x8f, 0x5f, 0x96, 0x0a, 0x4f, 0x5f, 0x96, 0x0a, 0xcf, 0x5e, 0x96, 0x0a, 0x1f, 0x9f, 0x8d, + 0xe8, 0xe3, 0x04, 0x07, 0xdb, 0xb1, 0x7f, 0x12, 0x34, 0xc7, 0xd9, 0x96, 0x5e, 0xf8, 0x27, 0x00, + 0x00, 0xff, 0xff, 0xd3, 0xe7, 0x4f, 0xed, 0x67, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var ( + _ context.Context + _ grpc.ClientConn +) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -1585,6 +1865,7 @@ type QueryClient interface { GetBridgeTaxes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryBridgeTaxesResponse, error) GetBridgeTransferLimits(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryBridgeTransferLimitsResponse, error) GetLightNodeSaleContracts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeSaleContractsResponse, error) + LastPendingBatchForGasEstimation(ctx context.Context, in *QueryLastPendingBatchForGasEstimationRequest, opts ...grpc.CallOption) (*QueryLastPendingBatchForGasEstimationResponse, error) } type queryClient struct { @@ -1739,6 +2020,15 @@ func (c *queryClient) GetLightNodeSaleContracts(ctx context.Context, in *emptypb return out, nil } +func (c *queryClient) LastPendingBatchForGasEstimation(ctx context.Context, in *QueryLastPendingBatchForGasEstimationRequest, opts ...grpc.CallOption) (*QueryLastPendingBatchForGasEstimationResponse, error) { + out := new(QueryLastPendingBatchForGasEstimationResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.skyway.Query/LastPendingBatchForGasEstimation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1757,61 +2047,80 @@ type QueryServer interface { GetBridgeTaxes(context.Context, *emptypb.Empty) (*QueryBridgeTaxesResponse, error) GetBridgeTransferLimits(context.Context, *emptypb.Empty) (*QueryBridgeTransferLimitsResponse, error) GetLightNodeSaleContracts(context.Context, *emptypb.Empty) (*QueryLightNodeSaleContractsResponse, error) + LastPendingBatchForGasEstimation(context.Context, *QueryLastPendingBatchForGasEstimationRequest) (*QueryLastPendingBatchForGasEstimationResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +type UnimplementedQueryServer struct{} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } + func (*UnimplementedQueryServer) LastPendingBatchRequestByAddr(ctx context.Context, req *QueryLastPendingBatchRequestByAddrRequest) (*QueryLastPendingBatchRequestByAddrResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastPendingBatchRequestByAddr not implemented") } + func (*UnimplementedQueryServer) LastObservedSkywayNonce(ctx context.Context, req *QueryLastObservedSkywayNonceRequest) (*QueryLastObservedSkywayNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastObservedSkywayNonce not implemented") } + func (*UnimplementedQueryServer) LastObservedSkywayNonceByAddr(ctx context.Context, req *QueryLastObservedSkywayNonceByAddrRequest) (*QueryLastObservedSkywayNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastObservedSkywayNonceByAddr not implemented") } + func (*UnimplementedQueryServer) LastObservedSkywayBlock(ctx context.Context, req *QueryLastObservedSkywayBlockRequest) (*QueryLastObservedSkywayBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastObservedSkywayBlock not implemented") } + func (*UnimplementedQueryServer) OutgoingTxBatches(ctx context.Context, req *QueryOutgoingTxBatchesRequest) (*QueryOutgoingTxBatchesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OutgoingTxBatches not implemented") } + func (*UnimplementedQueryServer) BatchRequestByNonce(ctx context.Context, req *QueryBatchRequestByNonceRequest) (*QueryBatchRequestByNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchRequestByNonce not implemented") } + func (*UnimplementedQueryServer) BatchConfirms(ctx context.Context, req *QueryBatchConfirmsRequest) (*QueryBatchConfirmsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchConfirms not implemented") } + func (*UnimplementedQueryServer) ERC20ToDenom(ctx context.Context, req *QueryERC20ToDenomRequest) (*QueryERC20ToDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ERC20ToDenom not implemented") } + func (*UnimplementedQueryServer) DenomToERC20(ctx context.Context, req *QueryDenomToERC20Request) (*QueryDenomToERC20Response, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomToERC20 not implemented") } + func (*UnimplementedQueryServer) GetAttestations(ctx context.Context, req *QueryAttestationsRequest) (*QueryAttestationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAttestations not implemented") } + func (*UnimplementedQueryServer) GetErc20ToDenoms(ctx context.Context, req *QueryErc20ToDenoms) (*QueryErc20ToDenomsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetErc20ToDenoms not implemented") } + func (*UnimplementedQueryServer) GetPendingSendToRemote(ctx context.Context, req *QueryPendingSendToRemote) (*QueryPendingSendToRemoteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPendingSendToRemote not implemented") } + func (*UnimplementedQueryServer) GetBridgeTaxes(ctx context.Context, req *emptypb.Empty) (*QueryBridgeTaxesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBridgeTaxes not implemented") } + func (*UnimplementedQueryServer) GetBridgeTransferLimits(ctx context.Context, req *emptypb.Empty) (*QueryBridgeTransferLimitsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBridgeTransferLimits not implemented") } + func (*UnimplementedQueryServer) GetLightNodeSaleContracts(ctx context.Context, req *emptypb.Empty) (*QueryLightNodeSaleContractsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLightNodeSaleContracts not implemented") } +func (*UnimplementedQueryServer) LastPendingBatchForGasEstimation(ctx context.Context, req *QueryLastPendingBatchForGasEstimationRequest) (*QueryLastPendingBatchForGasEstimationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LastPendingBatchForGasEstimation not implemented") +} + func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } @@ -2104,6 +2413,24 @@ func _Query_GetLightNodeSaleContracts_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_LastPendingBatchForGasEstimation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLastPendingBatchForGasEstimationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LastPendingBatchForGasEstimation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.skyway.Query/LastPendingBatchForGasEstimation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LastPendingBatchForGasEstimation(ctx, req.(*QueryLastPendingBatchForGasEstimationRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "palomachain.paloma.skyway.Query", HandlerType: (*QueryServer)(nil), @@ -2172,6 +2499,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetLightNodeSaleContracts", Handler: _Query_GetLightNodeSaleContracts_Handler, }, + { + MethodName: "LastPendingBatchForGasEstimation", + Handler: _Query_LastPendingBatchForGasEstimation_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "palomachain/paloma/skyway/query.proto", @@ -3182,7 +3513,81 @@ func (m *QueryLightNodeSaleContractsResponse) MarshalToSizedBuffer(dAtA []byte) if len(m.LightNodeSaleContracts) > 0 { for iNdEx := len(m.LightNodeSaleContracts) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.LightNodeSaleContracts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LightNodeSaleContracts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastPendingBatchForGasEstimationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainReferenceId) > 0 { + i -= len(m.ChainReferenceId) + copy(dAtA[i:], m.ChainReferenceId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainReferenceId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Batch) > 0 { + for iNdEx := len(m.Batch) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Batch[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3207,6 +3612,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -3637,12 +4043,46 @@ func (m *QueryLightNodeSaleContractsResponse) Size() (n int) { return n } +func (m *QueryLastPendingBatchForGasEstimationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChainReferenceId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Batch) > 0 { + for _, e := range m.Batch { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3693,6 +4133,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3776,6 +4217,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryLastPendingBatchRequestByAddrRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3858,6 +4300,7 @@ func (m *QueryLastPendingBatchRequestByAddrRequest) Unmarshal(dAtA []byte) error } return nil } + func (m *QueryLastPendingBatchRequestByAddrResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3942,6 +4385,7 @@ func (m *QueryLastPendingBatchRequestByAddrResponse) Unmarshal(dAtA []byte) erro } return nil } + func (m *QueryOutgoingTxBatchesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4056,6 +4500,7 @@ func (m *QueryOutgoingTxBatchesRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryOutgoingTxBatchesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4140,6 +4585,7 @@ func (m *QueryOutgoingTxBatchesResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBatchRequestByNonceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4241,6 +4687,7 @@ func (m *QueryBatchRequestByNonceRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBatchRequestByNonceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4324,6 +4771,7 @@ func (m *QueryBatchRequestByNonceResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBatchConfirmsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4425,6 +4873,7 @@ func (m *QueryBatchConfirmsRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBatchConfirmsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4509,6 +4958,7 @@ func (m *QueryBatchConfirmsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryLastObservedSkywayNonceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4591,6 +5041,7 @@ func (m *QueryLastObservedSkywayNonceRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryLastObservedSkywayNonceByAddrRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4705,6 +5156,7 @@ func (m *QueryLastObservedSkywayNonceByAddrRequest) Unmarshal(dAtA []byte) error } return nil } + func (m *QueryLastObservedSkywayNonceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4774,6 +5226,7 @@ func (m *QueryLastObservedSkywayNonceResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryLastObservedSkywayBlockRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4856,6 +5309,7 @@ func (m *QueryLastObservedSkywayBlockRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryLastObservedSkywayBlockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4925,6 +5379,7 @@ func (m *QueryLastObservedSkywayBlockResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryERC20ToDenomRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5039,6 +5494,7 @@ func (m *QueryERC20ToDenomRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryERC20ToDenomResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5121,6 +5577,7 @@ func (m *QueryERC20ToDenomResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryDenomToERC20Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5235,6 +5692,7 @@ func (m *QueryDenomToERC20Request) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryDenomToERC20Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5317,6 +5775,7 @@ func (m *QueryDenomToERC20Response) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryAttestationsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5520,6 +5979,7 @@ func (m *QueryAttestationsRequest) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryAttestationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5604,6 +6064,7 @@ func (m *QueryAttestationsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryErc20ToDenoms) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5654,6 +6115,7 @@ func (m *QueryErc20ToDenoms) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryErc20ToDenomsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5738,6 +6200,7 @@ func (m *QueryErc20ToDenomsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryPendingSendToRemote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5820,6 +6283,7 @@ func (m *QueryPendingSendToRemote) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryPendingSendToRemoteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5938,6 +6402,7 @@ func (m *QueryPendingSendToRemoteResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBridgeTaxesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6022,6 +6487,7 @@ func (m *QueryBridgeTaxesResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBridgeTransferLimitsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6106,6 +6572,7 @@ func (m *QueryBridgeTransferLimitsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *QueryBridgeTransferLimitsResponse_LimitUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6228,6 +6695,7 @@ func (m *QueryBridgeTransferLimitsResponse_LimitUsage) Unmarshal(dAtA []byte) er } return nil } + func (m *QueryLightNodeSaleContractsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6312,6 +6780,209 @@ func (m *QueryLightNodeSaleContractsResponse) Unmarshal(dAtA []byte) error { } return nil } + +func (m *QueryLastPendingBatchForGasEstimationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLastPendingBatchForGasEstimationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLastPendingBatchForGasEstimationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainReferenceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainReferenceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *QueryLastPendingBatchForGasEstimationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLastPendingBatchForGasEstimationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLastPendingBatchForGasEstimationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Batch = append(m.Batch, OutgoingTxBatch{}) + if err := m.Batch[len(m.Batch)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/skyway/types/query.pb.gw.go b/x/skyway/types/query.pb.gw.go index b0a97e24..dc19bb6b 100644 --- a/x/skyway/types/query.pb.gw.go +++ b/x/skyway/types/query.pb.gw.go @@ -26,13 +26,15 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = runtime.String + _ = utilities.NewDoubleArray + _ = descriptor.ForMessage + _ = metadata.Join +) func request_Query_GetBridgeTaxes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq emptypb.Empty @@ -40,7 +42,6 @@ func request_Query_GetBridgeTaxes_0(ctx context.Context, marshaler runtime.Marsh msg, err := client.GetBridgeTaxes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Query_GetBridgeTaxes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -49,7 +50,6 @@ func local_request_Query_GetBridgeTaxes_0(ctx context.Context, marshaler runtime msg, err := server.GetBridgeTaxes(ctx, &protoReq) return msg, metadata, err - } func request_Query_GetBridgeTransferLimits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -58,7 +58,6 @@ func request_Query_GetBridgeTransferLimits_0(ctx context.Context, marshaler runt msg, err := client.GetBridgeTransferLimits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Query_GetBridgeTransferLimits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -67,7 +66,6 @@ func local_request_Query_GetBridgeTransferLimits_0(ctx context.Context, marshale msg, err := server.GetBridgeTransferLimits(ctx, &protoReq) return msg, metadata, err - } func request_Query_GetLightNodeSaleContracts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -76,7 +74,6 @@ func request_Query_GetLightNodeSaleContracts_0(ctx context.Context, marshaler ru msg, err := client.GetLightNodeSaleContracts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Query_GetLightNodeSaleContracts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -85,7 +82,38 @@ func local_request_Query_GetLightNodeSaleContracts_0(ctx context.Context, marsha msg, err := server.GetLightNodeSaleContracts(ctx, &protoReq) return msg, metadata, err +} + +var filter_Query_LastPendingBatchForGasEstimation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + +func request_Query_LastPendingBatchForGasEstimation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLastPendingBatchForGasEstimationRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LastPendingBatchForGasEstimation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LastPendingBatchForGasEstimation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Query_LastPendingBatchForGasEstimation_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLastPendingBatchForGasEstimationRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LastPendingBatchForGasEstimation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.LastPendingBatchForGasEstimation(ctx, &protoReq) + return msg, metadata, err } // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". @@ -93,7 +121,6 @@ func local_request_Query_GetLightNodeSaleContracts_0(ctx context.Context, marsha // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_GetBridgeTaxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -114,7 +141,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Query_GetBridgeTaxes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_Query_GetBridgeTransferLimits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -137,7 +163,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Query_GetBridgeTransferLimits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_Query_GetLightNodeSaleContracts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -160,7 +185,28 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Query_GetLightNodeSaleContracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + + mux.Handle("GET", pattern_Query_LastPendingBatchForGasEstimation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LastPendingBatchForGasEstimation_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + forward_Query_LastPendingBatchForGasEstimation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) return nil @@ -203,7 +249,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_GetBridgeTaxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -221,7 +266,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Query_GetBridgeTaxes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_Query_GetBridgeTransferLimits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -241,7 +285,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Query_GetBridgeTransferLimits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_Query_GetLightNodeSaleContracts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -261,7 +304,25 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Query_GetLightNodeSaleContracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("GET", pattern_Query_LastPendingBatchForGasEstimation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LastPendingBatchForGasEstimation_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LastPendingBatchForGasEstimation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) return nil @@ -273,6 +334,8 @@ var ( pattern_Query_GetBridgeTransferLimits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "skyway", "all_bridge_transfer_limits"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GetLightNodeSaleContracts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "skyway", "light_node_sale_contracts"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LastPendingBatchForGasEstimation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"palomachain", "paloma", "skyway", "pending_batch_for_gas_estimation"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -281,4 +344,6 @@ var ( forward_Query_GetBridgeTransferLimits_0 = runtime.ForwardResponseMessage forward_Query_GetLightNodeSaleContracts_0 = runtime.ForwardResponseMessage + + forward_Query_LastPendingBatchForGasEstimation_0 = runtime.ForwardResponseMessage ) diff --git a/x/treasury/client/cli/query_get_relayer_fee.go b/x/treasury/client/cli/query_get_relayer_fee.go index 1c5420ee..7cc3d7da 100644 --- a/x/treasury/client/cli/query_get_relayer_fee.go +++ b/x/treasury/client/cli/query_get_relayer_fee.go @@ -1,6 +1,7 @@ package cli import ( + "fmt" "strconv" "github.com/cosmos/cosmos-sdk/client" @@ -32,6 +33,8 @@ func CmdGetRelayerFee() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) + fmt.Printf("CLI value: %v", validator) + fmt.Printf("CLI arg: %s", validator.String()) res, err := queryClient.RelayerFee(cmd.Context(), &types.QueryRelayerFeeRequest{ ValAddress: validator.String(), }) diff --git a/x/treasury/keeper/keeper.go b/x/treasury/keeper/keeper.go index 8047047c..d4283370 100644 --- a/x/treasury/keeper/keeper.go +++ b/x/treasury/keeper/keeper.go @@ -13,6 +13,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" xchain "github.com/palomachain/paloma/internal/x-chain" keeperutil "github.com/palomachain/paloma/util/keeper" + consensustypes "github.com/palomachain/paloma/x/consensus/types" "github.com/palomachain/paloma/x/treasury/types" ) @@ -137,6 +138,59 @@ func (k Keeper) GetRelayerFeesByChainReferenceID(ctx context.Context, chainRefer return r, err } +func (k Keeper) GetCombinedFeesForRelay( + ctx context.Context, + valAddress sdk.ValAddress, + chainReferenceID string, +) (*consensustypes.MessageFeeSettings, error) { + rfs, err := k.relayerFees.Get(sdk.UnwrapSDKContext(ctx), valAddress) + if err != nil { + return nil, fmt.Errorf("failed to get relayer fees: %w", err) + } + + var rf math.LegacyDec + for _, v := range rfs.Fees { + if v.ChainReferenceId == chainReferenceID { + rf = v.Multiplicator + break + } + } + + if rf.IsZero() { + // This should basically never happen, as Paloma will + // only assign to Validators which have valid + // fees set. + return nil, fmt.Errorf("relayer fee zero or not found") + } + + fees, err := k.GetFees(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get fees: %w", err) + } + + cf, err := math.LegacyNewDecFromStr(fees.CommunityFundFee) + if err != nil { + return nil, fmt.Errorf("failed to parse community fund fee: %w", err) + } + + sf, err := math.LegacyNewDecFromStr(fees.SecurityFee) + if err != nil { + return nil, fmt.Errorf("failed to parse security fee: %w", err) + } + + if cf.IsZero() || sf.IsZero() { + return nil, fmt.Errorf("invalid fund settings, community fund fee: %s, security fee: %s", + fees.CommunityFundFee, + fees.SecurityFee) + } + + return &consensustypes.MessageFeeSettings{ + RelayerFee: rf, + CommunityFee: cf, + SecurityFee: sf, + }, nil +} + func (k Keeper) setFees(ctx context.Context, fees *types.Fees) error { return k.KeeperUtil.Save(k.Store.TreasuryStore(ctx), k.cdc, []byte(storeKey), fees) } diff --git a/x/valset/types/mocks/QueryServer.go b/x/valset/types/mocks/QueryServer.go index 0e7d1272..5aa32dff 100644 --- a/x/valset/types/mocks/QueryServer.go +++ b/x/valset/types/mocks/QueryServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.1. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks diff --git a/x/valset/types/mocks/SlashingKeeper.go b/x/valset/types/mocks/SlashingKeeper.go index 7b8adff7..cfdc8657 100644 --- a/x/valset/types/mocks/SlashingKeeper.go +++ b/x/valset/types/mocks/SlashingKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -57,7 +57,8 @@ func (_m *SlashingKeeper) JailUntil(_a0 context.Context, _a1 types.ConsAddress, func NewSlashingKeeper(t interface { mock.TestingT Cleanup(func()) -}) *SlashingKeeper { +}, +) *SlashingKeeper { mock := &SlashingKeeper{} mock.Mock.Test(t) diff --git a/x/valset/types/mocks/StakingKeeper.go b/x/valset/types/mocks/StakingKeeper.go index 746d218d..a6f9dcdd 100644 --- a/x/valset/types/mocks/StakingKeeper.go +++ b/x/valset/types/mocks/StakingKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -87,7 +87,8 @@ func (_m *StakingKeeper) Validator(ctx context.Context, addr cosmos_sdktypes.Val func NewStakingKeeper(t interface { mock.TestingT Cleanup(func()) -}) *StakingKeeper { +}, +) *StakingKeeper { mock := &StakingKeeper{} mock.Mock.Test(t) diff --git a/x/valset/types/mocks/ValidatorI.go b/x/valset/types/mocks/ValidatorI.go index d1436333..f37c0794 100644 --- a/x/valset/types/mocks/ValidatorI.go +++ b/x/valset/types/mocks/ValidatorI.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.38.0. DO NOT EDIT. +// Code generated by mockery v2.43.2. DO NOT EDIT. package mocks @@ -455,7 +455,8 @@ func (_m *StakingValidatorI) TokensFromSharesTruncated(_a0 math.LegacyDec) math. func NewStakingValidatorI(t interface { mock.TestingT Cleanup(func()) -}) *StakingValidatorI { +}, +) *StakingValidatorI { mock := &StakingValidatorI{} mock.Mock.Test(t)