Skip to content

Commit

Permalink
Merge pull request #64 from kaiachain/release/v1.0.2
Browse files Browse the repository at this point in the history
[Main] release/v1.0.2 QA Sign-off
  • Loading branch information
blukat29 authored Aug 19, 2024
2 parents 6d4b549 + c2d06a2 commit 9f03292
Show file tree
Hide file tree
Showing 131 changed files with 1,613 additions and 422 deletions.
71 changes: 60 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ executors:
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
darwin-executor: # this executor is for packaging darwin binaries
working_directory: ~/go/src/github.com/kaiachain/kaia
macos:
xcode: 14.2.0
resource_class: macos.m1.medium.gen1
rpm-executor: # this executor is for packaging rpm binaries
working_directory: /go/src/github.com/kaiachain/kaia
docker:
Expand All @@ -70,6 +75,18 @@ executors:
- image: cimg/go:1.22.1

commands:
install-darwin-dependencies:
description: Install dependencies on darwin machine
steps:
- run:
name: "install darwin dependencies"
command: |
# install awscli
brew install awscli
# install golang
curl -O https://dl.google.com/go/go1.22.1.darwin-arm64.tar.gz
mkdir $HOME/go1.22.1
tar -C $HOME/go1.22.1 -xzf go1.22.1.darwin-arm64.tar.gz
pre-build:
description: "before build, set version"
steps:
Expand Down Expand Up @@ -141,7 +158,7 @@ commands:
for item in kcn kpn ken kscn kspn ksen kbn kgen homi; do
TARGET_RPM=$(find $item-linux-x86_64/rpmbuild/RPMS/x86_64/ | awk -v pat="$item(d)?-v" '$0~pat')
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/rhel/7/prod/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/rhel/7/kaia/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/kaia/$KAIA_VERSION/
done
rpm-tagging-baobab:
Expand All @@ -158,17 +175,17 @@ commands:
command: |
for item in kcn kpn ken; do
TARGET_RPM=$(find $item-linux-x86_64/rpmbuild/RPMS/x86_64/ | awk -v pat="$item(d)?-kairos-v" '$0~pat')
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/rhel/7/prod/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/rhel/7/kaia/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/kaia/$KAIA_VERSION/
done
createrepo-update:
steps:
- run:
name: "createrepo update"
command: |
aws s3 sync s3://$FRONTEND_BUCKET/packages/rhel/7/prod/ rhel/7/prod/
createrepo --update rhel/7/prod
aws s3 sync --delete rhel/7/prod/repodata/ s3://$FRONTEND_BUCKET/packages/rhel/7/prod/repodata/
aws s3 sync s3://$FRONTEND_BUCKET/packages/rhel/7/kaia/ rhel/7/kaia/
createrepo --update rhel/7/kaia
aws s3 sync --delete rhel/7/kaia/repodata/ s3://$FRONTEND_BUCKET/packages/rhel/7/kaia/repodata/
tag-verify:
steps:
- run:
Expand Down Expand Up @@ -231,7 +248,7 @@ commands:
command: |
export version=$(go run build/rpm/main.go version) >> $BASH_ENV
echo "git tag $version"
git config --global user.email "team.devops@groundx.xyz"
git config --global user.email "devops@kaia.io"
git config --global user.name "circleci-kaia"
git tag -a $version -m "$CIRCLE_STAGE"
git push origin $version
Expand Down Expand Up @@ -300,13 +317,14 @@ commands:
no_output_timeout: 30m
command: |
make kcn
git clone https://$TEST_TOKEN@github.com/klaytn/klaytn-rpc-tester.git
cd klaytn-rpc-tester
git clone https://$TEST_TOKEN@github.com/kaiachain/kaia-rpc-tester.git
cd kaia-rpc-tester
cp ../build/bin/kcn script/cn/bin/
cd script
./set_CNonly.sh
cd ..
cp config_template.json config.json
apt update
apt install python3.8 python3-venv -y
python3.8 -m venv --without-pip venv
source venv/bin/activate
Expand Down Expand Up @@ -368,7 +386,7 @@ jobs:
name: "Run test tests"
no_output_timeout: 30m
command: |
git clone --depth 1 https://$TEST_TOKEN@github.com/klaytn/klaytn-tests.git tests/testdata
git clone --depth 1 https://$TEST_TOKEN@github.com/kaiachain/kaia-core-tests.git tests/testdata
make test-tests
test-others:
Expand Down Expand Up @@ -415,7 +433,7 @@ jobs:
command: |
set -e
export GOPATH=/go
git clone --depth 1 https://$TEST_TOKEN@github.com/klaytn/klaytn-tests.git tests/testdata
git clone --depth 1 https://$TEST_TOKEN@github.com/kaiachain/kaia-core-tests.git tests/testdata
make cover
mkdir -p /tmp/coverage_reports
cp coverage_report.txt /tmp/coverage_reports/
Expand Down Expand Up @@ -470,7 +488,27 @@ jobs:
baobab: "-b"
- upload-repo:
item: "kcn kpn ken"
packaging-darwin:
executor: darwin-executor
steps:
- checkout
- install-darwin-dependencies
- pre-build
- build-packaging:
os-network: "darwin-arm64"
- upload-repo

packaging-darwin-baobab:
executor: darwin-executor
steps:
- checkout
- install-darwin-dependencies
- pre-build
- build-packaging:
os-network: "darwin-arm64"
baobab: "-b"
- upload-repo:
item: "kcn kpn ken"
rpm-tagged:
executor: rpm-executor
steps:
Expand Down Expand Up @@ -593,6 +631,8 @@ workflows:
- rpm-tagged-baobab
- packaging-linux
- packaging-linux-baobab
- packaging-darwin
- packaging-darwin-baobab
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]/
Expand All @@ -605,6 +645,8 @@ workflows:
- rpm-tagged-baobab
- packaging-linux
- packaging-linux-baobab
- packaging-darwin
- packaging-darwin-baobab
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+.*/
Expand All @@ -627,7 +669,14 @@ workflows:
filters: *filter-only-version-tag
requires:
- pass-tests

- packaging-darwin:
filters: *filter-only-version-tag
requires:
- pass-tests
- packaging-darwin-baobab:
filters: *filter-only-version-tag
requires:
- pass-tests
- major-tagging:
filters:
branches:
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"errors"
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"errors"
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/state"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"time"

"github.com/golang/mock/gomock"
kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/types"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"sync"
"time"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/bloombits"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"testing"
"time"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/blockchain"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"strings"
"sync"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"strings"
"testing"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/blockchain/types"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import (
"strings"
"errors"
kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/common"
Expand Down
2 changes: 1 addition & 1 deletion accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package accounts
import (
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/event"
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/keystore_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package keystore
import (
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts"
"github.com/kaiachain/kaia/blockchain/types"
)
Expand Down
12 changes: 8 additions & 4 deletions api/api_public_klay.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,16 @@ type TotalSupplyResult struct {
TotalSupply *hexutil.Big `json:"totalSupply"` // The total supply of the native token. i.e. Minted - Burnt.
TotalMinted *hexutil.Big `json:"totalMinted"` // Total minted amount.
TotalBurnt *hexutil.Big `json:"totalBurnt"` // Total burnt amount. Sum of all burnt amounts below.
BurntFee *hexutil.Big `json:"burntFee"` // from tx fee burn. ReadAccReward(num).BurntFee.
BurntFee *hexutil.Big `json:"burntFee"` // from tx fee burn.
ZeroBurn *hexutil.Big `json:"zeroBurn"` // balance of 0x0 (zero) address.
DeadBurn *hexutil.Big `json:"deadBurn"` // balance of 0xdead (dead) address.
Kip103Burn *hexutil.Big `json:"kip103Burn"` // by KIP103 fork. Read from its memo.
Kip160Burn *hexutil.Big `json:"kip160Burn"` // by KIP160 fork. Read from its memo.
}

func (s *PublicKaiaAPI) GetTotalSupply(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*TotalSupplyResult, error) {
// If showPartial == nil or *showPartial == false, the regular use case, this API either delivers the full result or fails.
// If showPartial == true, the advanced and debugging use case, this API delivers full or best effort partial result.
func (s *PublicKaiaAPI) GetTotalSupply(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, showPartial *bool) (*TotalSupplyResult, error) {
block, err := s.b.BlockByNumberOrHash(ctx, blockNrOrHash)
if err != nil {
return nil, err
Expand All @@ -143,11 +145,13 @@ func (s *PublicKaiaAPI) GetTotalSupply(ctx context.Context, blockNrOrHash rpc.Bl
Kip103Burn: (*hexutil.Big)(ts.Kip103Burn),
Kip160Burn: (*hexutil.Big)(ts.Kip160Burn),
}
if err != nil {
if showPartial != nil && *showPartial && err != nil {
errStr := err.Error()
res.Error = &errStr
return res, nil
} else {
return res, err
}
return res, nil
}

// Syncing returns false in case the node is currently not syncing with the network. It can be up to date or has not
Expand Down
2 changes: 1 addition & 1 deletion api/api_public_transaction_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func (s *PublicTransactionPoolAPI) RecoverFromTransaction(ctx context.Context, e
if err != nil {
return common.Address{}, err
}
return tx.From()
return types.Sender(signer, tx)
}

// RecoverFromMessage validates that the message is signed by one of the keys in the given account.
Expand Down
2 changes: 1 addition & 1 deletion api/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"math/big"
"time"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/state"
Expand Down
2 changes: 1 addition & 1 deletion api/debug/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (h *HandlerT) StartGoTrace(file string) error {
return nil
}

// StopTrace stops an ongoing trace.
// StopGoTrace stops an ongoing trace.
func (h *HandlerT) StopGoTrace() error {
h.mu.Lock()
defer h.mu.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion api/mocks/backend_mock.go

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

2 changes: 1 addition & 1 deletion blockchain/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func genDBManagerForTest(dir string, dbType database.DBType) database.DBManager
db := database.NewMemoryDBManager()
return db
} else {
dbc := &database.DBConfig{Dir: dir, DBType: dbType, LevelDBCacheSize: 128, OpenFilesLimit: 128}
dbc := &database.DBConfig{Dir: dir, DBType: dbType, LevelDBCacheSize: 128, PebbleDBCacheSize: 128, OpenFilesLimit: 128}
return database.NewDBManager(dbc)
}
}
6 changes: 6 additions & 0 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, root common.Hash, repair bo
// to low, so it's safe the update in-memory markers directly.
bc.currentFastBlock.Store(newHeadFastBlock)
}

// Rewind the supply checkpoint
newLastSupplyCheckpointNumber := header.Number.Uint64() - (header.Number.Uint64() % params.SupplyCheckpointInterval)
bc.db.WriteLastSupplyCheckpointNumber(newLastSupplyCheckpointNumber)

return bc.CurrentBlock().Number().Uint64(), nil
}

Expand All @@ -629,6 +634,7 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, root common.Hash, repair bo
if bc.Config().Istanbul.ProposerPolicy == params.WeightedRandom && !bc.Config().IsKaiaForkEnabled(new(big.Int).SetUint64(num)) && params.IsStakingUpdateInterval(num) {
bc.db.DeleteStakingInfo(num)
}
bc.db.DeleteSupplyCheckpoint(num)
}

// If SetHead was only called as a chain reparation method, try to skip
Expand Down
2 changes: 1 addition & 1 deletion blockchain/state_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func createLocalTestDB(t *testing.T) (string, database.DBManager) {
if err != nil {
t.Fatalf("failed to create a database: %v", err)
}
dbc := &database.DBConfig{Dir: dir, DBType: database.LevelDB, LevelDBCacheSize: 128, OpenFilesLimit: 128}
dbc := &database.DBConfig{Dir: dir, DBType: database.LevelDB, LevelDBCacheSize: 128, PebbleDBCacheSize: 128, OpenFilesLimit: 128}
db := database.NewDBManager(dbc)
return dir, db
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/system/multicall.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"context"
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind/backends"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/state"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/system/rebalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"errors"
"math/big"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/accounts/abi/bind/backends"
"github.com/kaiachain/kaia/blockchain"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/types/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func NewAccountWithType(t AccountType) (Account, error) {
return nil, ErrUndefinedAccountType
}

// NewAccountWithType creates an Account object initialized with the given map.
// NewAccountWithMap creates an Account object initialized with the given map.
func NewAccountWithMap(t AccountType, values map[AccountValueKeyType]interface{}) (Account, error) {
switch t {
case LegacyAccountType:
Expand Down
Loading

0 comments on commit 9f03292

Please sign in to comment.