Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 65 additions & 61 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
name: Create version branch & PR <working>/* -> version

on:
push:
branches: [ feature/*, bugfix/* ]
branches: [feature/*, bugfix/*]

jobs:
auto-pr:
Expand All @@ -14,63 +15,66 @@ jobs:
id-token: write
pull-requests: write
steps:
# Work around https://github.com/actions/checkout/issues/760
- name: Add safe.directory
run: |
git config --global --add safe.directory /github/workspace
git config --global --add safe.directory $PWD
# ref.: https://github.com/actions/checkout, v3.0.0
- name: Checkout repository
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Extract branch name on pull request
shell: bash
run: |
set -x
git branch -r -l
echo "(current dir): $PWD" && ls -l ./
chmod -Rv 555 ./scripts
RELEASE_VER=$(./scripts/version.sh) && echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV
RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV
REPOSITORY_NAME="${{ github.event.repository.name }}" && echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV
echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
echo "MASTER_REF=$(git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | head -1 | sed 's/HEAD//')" >> $GITHUB_ENV
git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
( git show-branch "origin/$RELEASE_BRANCH" || git show-branch "remotes/origin/$RELEASE_BRANCH" ) && echo "TARGET_BRANCH_EXISTS=true" >> $GITHUB_ENV || echo "TARGET_BRANCH_EXISTS=false" >> $GITHUB_ENV
- name: Print debug data before publishing
run: |
echo "Repository name: ${{ env.REPOSITORY_NAME }}"
echo " Source branch: ${{ env.SOURCE_BRANCH }}"
echo " Default branch: ${{ env.DEFAULT_BRANCH }}"
echo " Master refer.: ${{ env.MASTER_REF }}"
echo "Release version: ${{ env.RELEASE_VER }}"
echo " Release branch: ${{ env.RELEASE_BRANCH }}"
echo " Release exists: ${{ env.RELEASE_EXISTS }}"
echo " Event name: ${{ github.event_name }}"
echo " Target Exists: ${{ env.TARGET_BRANCH_EXISTS }}"
# ref.: https://github.com/peterjgrainger/action-create-branch, v2.2.0
- name: Create version branch from master
uses: peterjgrainger/action-create-branch@c2800a3a9edbba2218da6861fa46496cf8f3195a
if: |
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) &&
( startsWith(env.RELEASE_BRANCH, 'release/v') && contains(env.RELEASE_BRANCH, '.') )
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ env.RELEASE_BRANCH }}
sha: ${{ env.MASTER_REF }}
- name: Create PR from feature to version branch
# ref. repo-sync/pull-request is broken, using cea2aj/pull-request instead
uses: cea2aj/pull-request@84eb0c3478f13651e5649367941b867ca02d7926
if: |
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) &&
( startsWith(env.RELEASE_BRANCH, 'release/v') && contains(env.RELEASE_BRANCH, '.') )
with:
github_token: ${{ secrets.REPO_ACCESS }}
source_branch: ${{ env.SOURCE_BRANCH }}
destination_branch: ${{ env.RELEASE_BRANCH}}
pr_title: "${{ env.SOURCE_BRANCH }} -> ${{ env.RELEASE_BRANCH }}"
pr_label: "kira-automation"
pr_allow_empty: true
# Work around https://github.com/actions/checkout/issues/760
- name: Add safe.directory
run: |
git config --global --add safe.directory /github/workspace
git config --global --add safe.directory $PWD
- name: Checkout repository
# ref.: actions/checkout v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Extract branch name on pull request
shell: bash
run: |
set -x
git branch -r -l
echo "(current dir): $PWD" && ls -l ./
chmod -Rv 555 ./scripts
RELEASE_VER=$(./scripts/version.sh) && echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV
RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV
REPOSITORY_NAME="${{ github.event.repository.name }}" && echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV
echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
echo "MASTER_REF=$(git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | head -1 | sed 's/HEAD//')" >> $GITHUB_ENV
git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
( git show-branch "origin/$RELEASE_BRANCH" || git show-branch "remotes/origin/$RELEASE_BRANCH" ) && echo "TARGET_BRANCH_EXISTS=true" >> $GITHUB_ENV || echo "TARGET_BRANCH_EXISTS=false" >> $GITHUB_ENV
- name: Print debug data before publishing
run: |
echo "Repository name: ${{ env.REPOSITORY_NAME }}"
echo " Source branch: ${{ env.SOURCE_BRANCH }}"
echo " Default branch: ${{ env.DEFAULT_BRANCH }}"
echo " Master refer.: ${{ env.MASTER_REF }}"
echo "Release version: ${{ env.RELEASE_VER }}"
echo " Release branch: ${{ env.RELEASE_BRANCH }}"
echo " Release exists: ${{ env.RELEASE_EXISTS }}"
echo " Event name: ${{ github.event_name }}"
echo " Target Exists: ${{ env.TARGET_BRANCH_EXISTS }}"
- name: Create version branch from master
# ref.: https://github.com/peterjgrainger/action-create-branch, v3.0.0
uses: peterjgrainger/action-create-branch@10c7d268152480ae859347db45dc69086cef1d9c
if: |
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) &&
( startsWith(env.RELEASE_BRANCH, 'release/v') && contains(env.RELEASE_BRANCH, '.') )
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ env.RELEASE_BRANCH }}
sha: ${{ env.MASTER_REF }}
- name: Create PR from feature to version branch
# ref. repo-sync/pull-request is broken, using cea2aj/pull-request instead
# TODO: cea2aj/pull-request abondoned, we need to switch back to peter-evans/create-pull-request
uses: cea2aj/pull-request@84eb0c3478f13651e5649367941b867ca02d7926
# ref.:
if: |
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) &&
( startsWith(env.RELEASE_BRANCH, 'release/v') && contains(env.RELEASE_BRANCH, '.') )
with:
github_token: ${{ secrets.REPO_ACCESS }}
source_branch: ${{ env.SOURCE_BRANCH }}
destination_branch: ${{ env.RELEASE_BRANCH}}
pr_title: "${{ env.SOURCE_BRANCH }} -> ${{ env.RELEASE_BRANCH }}"
pr_label: "kira-automation"
pr_allow_empty: true

4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
git config --global --add safe.directory $PWD
# ref.: https://github.com/actions/checkout, v3.0.0
- name: Checkout repository
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
uses: actions/checkout@v4.2.2
- name: Checking dependency versions & packaging source files
run: |
echo "(current dir): $PWD" && ls -l ./
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Confirm installation!
run: cosign version
- name: Download artifacts
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v4.2.1
with:
name: sekai-bin-deb
- name: Inspecting & organizing artifacts
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ jobs:
run: |
git config --global --add safe.directory /github/workspace
git config --global --add safe.directory $PWD
# ref.: https://github.com/actions/checkout, v3.0.0
- name: Checkout repository
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
uses: actions/checkout@v4.2.2
- name: Extract branch name on pull request
shell: bash
run: |
Expand All @@ -48,4 +47,4 @@ jobs:
pr_title: "${{ env.SOURCE_BRANCH }} -> ${{ env.DEFAULT_BRANCH }}"
pr_label: "kira-automation"
pr_assignee: "asmodat"
pr_allow_empty: true
pr_allow_empty: true
2 changes: 1 addition & 1 deletion .github/workflows/merge_hook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

---
name: Release Merged Hook

on:
Expand Down
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Features:

- Fix legacy tx signing
- KIP-87 (commit: a0c64a8d077df4c9b487509aad5cc3bb8a672f33)
- cidi refactor
13 changes: 11 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import (
"github.com/KiraCore/sekai/x/distributor"
distributorkeeper "github.com/KiraCore/sekai/x/distributor/keeper"
distributortypes "github.com/KiraCore/sekai/x/distributor/types"
"github.com/KiraCore/sekai/x/ethereum"
ethereumkeeper "github.com/KiraCore/sekai/x/ethereum/keeper"
ethereumtypes "github.com/KiraCore/sekai/x/ethereum/types"
"github.com/KiraCore/sekai/x/evidence"
evidencekeeper "github.com/KiraCore/sekai/x/evidence/keeper"
evidencetypes "github.com/KiraCore/sekai/x/evidence/types"
Expand Down Expand Up @@ -128,6 +131,7 @@ var (
collectives.AppModuleBasic{},
layer2.AppModuleBasic{},
consensus.AppModuleBasic{},
ethereum.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -184,6 +188,7 @@ type SekaiApp struct {
CollectivesKeeper collectiveskeeper.Keeper
Layer2Keeper layer2keeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
EthereumKeeper ethereumkeeper.Keeper

// Module Manager
mm *module.Manager
Expand Down Expand Up @@ -237,6 +242,7 @@ func NewInitApp(
collectivestypes.ModuleName,
layer2types.StoreKey,
consensusparamtypes.StoreKey,
ethereumtypes.StoreKey,
)
tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)

Expand Down Expand Up @@ -364,6 +370,7 @@ func NewInitApp(
app.DistrKeeper,
app.TokensKeeper,
)
app.EthereumKeeper = ethereumkeeper.NewKeeper(keys[ethereumtypes.StoreKey], appCodec, app.CustomGovKeeper, app.BankKeeper)

proposalRouter := govtypes.NewProposalRouter(
[]govtypes.ProposalHandler{
Expand Down Expand Up @@ -439,6 +446,7 @@ func NewInitApp(
collectives.NewAppModule(app.CollectivesKeeper),
layer2.NewAppModule(app.Layer2Keeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
ethereum.NewAppModule(app.EthereumKeeper, app.CustomGovKeeper, app.BankKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -451,8 +459,7 @@ func NewInitApp(
evidencetypes.ModuleName, stakingtypes.ModuleName,
spendingtypes.ModuleName, ubitypes.ModuleName,
distributortypes.ModuleName, multistakingtypes.ModuleName, custodytypes.ModuleName,
baskettypes.ModuleName,
distributortypes.ModuleName, multistakingtypes.ModuleName, custodytypes.ModuleName,
ethereumtypes.ModuleName,
baskettypes.ModuleName,
collectivestypes.ModuleName,
layer2types.ModuleName,
Expand All @@ -467,6 +474,7 @@ func NewInitApp(
feeprocessingtypes.ModuleName,
spendingtypes.ModuleName, ubitypes.ModuleName,
distributortypes.ModuleName, multistakingtypes.ModuleName, custodytypes.ModuleName,
ethereumtypes.ModuleName,
baskettypes.ModuleName,
collectivestypes.ModuleName,
layer2types.ModuleName,
Expand Down Expand Up @@ -495,6 +503,7 @@ func NewInitApp(
paramstypes.ModuleName,
distributortypes.ModuleName,
custodytypes.ModuleName,
ethereumtypes.ModuleName,
multistakingtypes.ModuleName,
baskettypes.ModuleName,
collectivestypes.ModuleName,
Expand Down
21 changes: 21 additions & 0 deletions proto/kira/ethereum/ethereum.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";
package kira.ethereum;

import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/KiraCore/sekai/x/ethereum/types";

message EVMTx {
string From = 1;
string To = 2;
string Value = 3;
string Gas = 4;
string GasPrice = 5;
string Nonce = 6;
string Data = 7;
int64 ChainId = 8;
string V = 9;
string R = 10;
string S = 11;
}
8 changes: 8 additions & 0 deletions proto/kira/ethereum/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
syntax = "proto3";
package kira.ethereum;

import "kira/ethereum/ethereum.proto";

option go_package = "github.com/KiraCore/sekai/x/ethereum/types";

message GenesisState { }
26 changes: 26 additions & 0 deletions proto/kira/ethereum/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";
package kira.ethereum;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "kira/ethereum/ethereum.proto";
import "kira/ethereum/tx.proto";

option go_package = "github.com/KiraCore/sekai/x/ethereum/types";

service Query {
rpc RelayByAddress (RelayByAddressRequest) returns (RelayByAddressResponse) {
option (google.api.http).get = "/kira/ethereum/relay/{addr}";
}
}

message RelayByAddressRequest {
bytes addr = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"addr\""
];
}

message RelayByAddressResponse {
MsgRelay msg_relay = 1;
}
31 changes: 31 additions & 0 deletions proto/kira/ethereum/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
syntax = "proto3";
package kira.ethereum;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/bank/v1beta1/bank.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "kira/ethereum/ethereum.proto";

option go_package = "github.com/KiraCore/sekai/x/ethereum/types";

// Msg defines the ethereum Msg service.
service Msg {
rpc Relay(MsgRelay) returns (MsgRelayResponse);
}

message MsgRelay {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

bytes address = 1 [
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
(gogoproto.moretags) = "yaml:\"address\""
];

string data = 2;
}

message MsgRelayResponse {}
2 changes: 1 addition & 1 deletion types/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package types
const (
// we set page iteration limit for safety
PageIterationLimit = 512
SekaiVersion = "v0.4.2"
SekaiVersion = "v0.4.3"
CosmosVersion = "v0.47.6"
)
16 changes: 16 additions & 0 deletions x/ethereum/client/cli/query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package cli

import (
"github.com/KiraCore/sekai/x/ethereum/types"
"github.com/spf13/cobra"
)

// NewQueryCmd returns a root CLI command handler for all x/ethereum transaction commands.
func NewQueryCmd() *cobra.Command {
queryCmd := &cobra.Command{
Use: types.RouterKey,
Short: "query commands for the ethereum module",
}

return queryCmd
}
Loading
Loading