Skip to content

Commit

Permalink
feat: Pigeon Feed (#1262)
Browse files Browse the repository at this point in the history
# 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 <mail.lmcarvalho@gmail.com>
Co-authored-by: Luis Carvalho <luis@volume.finance>
  • Loading branch information
3 people authored Aug 16, 2024
1 parent d2ee162 commit fca3518
Show file tree
Hide file tree
Showing 139 changed files with 9,490 additions and 1,416 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -574,6 +575,7 @@ func New(
app.GetSubspace(consensusmoduletypes.ModuleName),
app.ValsetKeeper,
consensusRegistry,
&app.TreasuryKeeper,
)

app.EvmKeeper = *evmmodulekeeper.NewKeeper(
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions internal/x-chain/mocks/Bridge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion internal/x-chain/mocks/FundCollecter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion proto/palomachain/paloma/consensus/consensus_queue.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ 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;
int64 addedAtBlockHeight = 2;
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;
Expand All @@ -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; }
Expand Down Expand Up @@ -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" ];
Expand Down
30 changes: 28 additions & 2 deletions proto/palomachain/paloma/consensus/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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}";
}
Expand Down Expand Up @@ -95,15 +102,24 @@ message ValidatorSignature {
}

message MessageWithSignatures {
reserved 8;
reserved "evidence";

bytes nonce = 1;
uint64 id = 2;
google.protobuf.Any msg = 3;
repeated ValidatorSignature signData = 4;
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 {
Expand Down Expand Up @@ -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 ];
}
19 changes: 19 additions & 0 deletions proto/palomachain/paloma/consensus/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}

2 changes: 2 additions & 0 deletions proto/palomachain/paloma/evm/chain_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ message ChainInfo {
string minOnChainBalance = 12;

RelayWeights relayWeights = 13;

string feeManagerAddr = 14;
}

message SmartContract {
Expand Down
1 change: 1 addition & 0 deletions proto/palomachain/paloma/evm/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ message GenesisChainInfo {
string blockHashAtHeight = 4;
string minOnChainBalance = 5;
RelayWeights relayWeights = 6;
string feeManagerAddr = 7;
}

message GenesisSmartContract {
Expand Down
11 changes: 11 additions & 0 deletions proto/palomachain/paloma/evm/set_fee_mgr_proposal.proto
Original file line number Diff line number Diff line change
@@ -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;
}
13 changes: 12 additions & 1 deletion proto/palomachain/paloma/evm/turnstone.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -63,6 +72,8 @@ message Message {
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string assigneeRemoteAddress = 10;
}

message TxExecutedProof { bytes serializedTX = 1; }
Expand Down
6 changes: 4 additions & 2 deletions proto/palomachain/paloma/skyway/batch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions proto/palomachain/paloma/skyway/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 23 additions & 7 deletions proto/palomachain/paloma/skyway/msgs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Loading

0 comments on commit fca3518

Please sign in to comment.