Skip to content

Commit

Permalink
Merge pull request #40 from kaiachain/release/v1.0.1
Browse files Browse the repository at this point in the history
[Main] release/v1.0.1 QA Sign-off
  • Loading branch information
blukat29 authored Jul 18, 2024
2 parents b6cc5d0 + 9aadb8e commit 6d4b549
Show file tree
Hide file tree
Showing 924 changed files with 11,230 additions and 9,244 deletions.
97 changes: 23 additions & 74 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ orbs:

executors:
linux-executor: # this executor is for general testing and packaging linux binaries
working_directory: ~/go/src/github.com/klaytn/klaytn
working_directory: ~/go/src/github.com/kaiachain/kaia
resource_class: medium
docker:
- image: klaytn/build_base:1.12-go.1.22.1-solc0.8.13-ubuntu-20.04
- image: kaiachain/build_base:1.12-go.1.22.1-solc0.8.13-ubuntu-20.04
auth:
username: $DOCKER_LOGIN
password: $DOCKER_PASSWORD
linux-others-executor: # this executor is for test-others job
working_directory: /go/src/github.com/klaytn/klaytn
working_directory: /go/src/github.com/kaiachain/kaia
resource_class: xlarge
docker:
- image: klaytn/build_base:1.12-go.1.22.1-solc0.8.13-ubuntu-20.04
- image: kaiachain/build_base:1.12-go.1.22.1-solc0.8.13-ubuntu-20.04
auth:
username: $DOCKER_LOGIN
password: $DOCKER_PASSWORD
Expand All @@ -57,36 +57,19 @@ 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/klaytn/klaytn
macos:
xcode: 14.2.0
resource_class: macos.x86.medium.gen2
rpm-executor: # this executor is for packaging rpm binaries
working_directory: /go/src/github.com/klaytn/klaytn
working_directory: /go/src/github.com/kaiachain/kaia
docker:
- image: klaytn/circleci-rpmbuild:1.22.1-gcc7
- image: kaiachain/circleci-rpmbuild:1.22.1-gcc7
auth:
username: $DOCKER_LOGIN
password: $DOCKER_PASSWORD
default:
working_directory: ~/go/src/github.com/klaytn/klaytn
working_directory: ~/go/src/github.com/kaiachain/kaia
docker:
- 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-amd64.tar.gz
mkdir $HOME/go1.22.1
tar -C $HOME/go1.22.1 -xzf go1.22.1.darwin-amd64.tar.gz
pre-build:
description: "before build, set version"
steps:
Expand All @@ -107,7 +90,7 @@ commands:
else
echo "this is not RC version"
fi
echo "export KLAYTN_VERSION=$(go run build/rpm/main.go version)" >> $BASH_ENV
echo "export KAIA_VERSION=$(go run build/rpm/main.go version)" >> $BASH_ENV
build-packaging:
description: "Build for each OS/Network"
parameters:
Expand Down Expand Up @@ -139,8 +122,8 @@ commands:
command: |
export GOPATH=~/go
export PATH=$HOME/go1.22.1/go/bin:$PATH
KLAYTN_VERSION=$(go run build/rpm/main.go version)
for item in << parameters.item >>; do aws s3 cp packages/${item}-*.tar.gz s3://$FRONTEND_BUCKET/packages/klaytn/$KLAYTN_VERSION/; done
KAIA_VERSION=$(go run build/rpm/main.go version)
for item in << parameters.item >>; do aws s3 cp packages/${item}-*.tar.gz s3://$FRONTEND_BUCKET/packages/kaia/$KAIA_VERSION/; done
rpm-tagging:
description: "rpm tagging for cypress"
steps:
Expand All @@ -154,12 +137,12 @@ commands:
name: "upload S3 repo"
command: |
PLATFORM_SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)
KLAYTN_VERSION=$(go run build/rpm/main.go version)
KAIA_VERSION=$(go run build/rpm/main.go version)
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/klaytn/$KLAYTN_VERSION/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/kaia/$KAIA_VERSION/
done
rpm-tagging-baobab:
description: "rpm tagging for baobab"
Expand All @@ -174,9 +157,9 @@ commands:
name: "upload S3 repo"
command: |
for item in kcn kpn ken; do
TARGET_RPM=$(find $item-linux-x86_64/rpmbuild/RPMS/x86_64/ | awk -v pat="$item(d)?-baobab-v" '$0~pat')
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/klaytn/$KLAYTN_VERSION/
aws s3 cp $TARGET_RPM s3://$FRONTEND_BUCKET/packages/kaia/$KAIA_VERSION/
done
createrepo-update:
steps:
Expand All @@ -192,9 +175,9 @@ commands:
name: "Verify tag and file version match"
command: |
echo "tag version is " $CIRCLE_TAG
KLAYTN_VERSION=$(go run build/rpm/main.go version)
echo "version on version.go" $KLAYTN_VERSION
if [ $KLAYTN_VERSION == ${CIRCLE_TAG%-*} ]; then
KAIA_VERSION=$(go run build/rpm/main.go version)
echo "version on version.go" $KAIA_VERSION
if [ $KAIA_VERSION == ${CIRCLE_TAG%-*} ]; then
echo "verification pass"
else
echo "It's not same version."
Expand All @@ -206,10 +189,10 @@ commands:
name: "Verify tag and file version match"
command: |
TAGGER=$(git for-each-ref --format='%(tagger)' refs/tags/$CIRCLE_TAG | sed 's/ .*//')
if [ $TAGGER == 'circleci-klaytn' ]; then
echo "Pass! Tagger is circleci-klaytn"
if [ $TAGGER == 'circleci-kaia' ]; then
echo "Pass! Tagger is circleci-kaia"
else
echo "only circleci-klaytn can tagging major version"
echo "only circleci-kaia can tagging major version"
exit 1
fi
make-pr:
Expand Down Expand Up @@ -249,7 +232,7 @@ commands:
export version=$(go run build/rpm/main.go version) >> $BASH_ENV
echo "git tag $version"
git config --global user.email "[email protected]"
git config --global user.name "circleci-klaytn"
git config --global user.name "circleci-kaia"
git tag -a $version -m "$CIRCLE_STAGE"
git push origin $version
- run:
Expand Down Expand Up @@ -488,28 +471,6 @@ jobs:
- upload-repo:
item: "kcn kpn ken"

packaging-darwin:
executor: darwin-executor
steps:
- checkout
- install-darwin-dependencies
- pre-build
- build-packaging:
os-network: "darwin-amd64"
- upload-repo

packaging-darwin-baobab:
executor: darwin-executor
steps:
- checkout
- install-darwin-dependencies
- pre-build
- build-packaging:
os-network: "darwin-amd64"
baobab: "-b"
- upload-repo:
item: "kcn kpn ken"

rpm-tagged:
executor: rpm-executor
steps:
Expand Down Expand Up @@ -600,7 +561,7 @@ workflows:
requires:
- pass-tests
extra_build_args: '--platform=linux/amd64'
image: klaytn/klaytn
image: kaiachain/kaia
tag: dev
executor: docker/docker
use-remote-docker: true
Expand All @@ -616,7 +577,7 @@ workflows:
requires:
- pass-tests
extra_build_args: '--platform=linux/amd64'
image: klaytn/klaytn
image: kaiachain/kaia
tag: latest,$CIRCLE_TAG
executor: docker/docker
use-remote-docker: true
Expand All @@ -632,8 +593,6 @@ 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 @@ -646,8 +605,6 @@ 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 @@ -670,14 +627,6 @@ 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:
Expand Down
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Please put an x in the boxes related to your change.

## Checklist

*Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.*
_Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/klaytn/klaytn/blob/master/CONTRIBUTING.md) doc
- [ ] I have signed the [CLA](https://cla-assistant.io/klaytn/klaytn)
- [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/kaiachain/kaia/blob/main/CONTRIBUTING.md) doc
- [ ] I have read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) and signed by comment `I have read the CLA Document and I hereby sign the CLA` in first time contribute
- [ ] Lint and unit tests pass locally with my changes (`$ make test`)
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
Expand Down
4 changes: 2 additions & 2 deletions .github/worflows/CLA.yml → .github/workflows/CLA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: "${{ github.event.repository.name }}/signatures/version1/cla.json"
path-to-document: "https://gist.github.com/e78f99e1c527225637e269cff1bc7e49" # Klaytn Gist
path-to-document: "https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6" # Kaia Gist
branch: "main"
allowlist: dependabot[bot], KlaytnDev, circleci-klaytn
allowlist: dependabot[bot], KaiaDev, circleci-kaia
remote-repository-name: ${{ secrets.CLA_REPOSITORY }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for the details of CC bootstrapping process.

## Running an Endpoint Node

Endpoint Node (EN) is an entry point from the outside of the network in order to interact with the Kaia network. Currently, two official networks are available: Testnet and Mainnet (legacy names: Baobab and Cypress). Please visit the official
Endpoint Node (EN) is an entry point from the outside of the network in order to interact with the Kaia network. Currently, two official networks are available: Kairos and Mainnet (legacy names: Baobab and Cypress). Please visit the official
[EN Operation Guide](https://docs.kaia.io/docs/nodes/endpoint-node/).

## Running a Service Chain Node
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"fmt"
"io"

"github.com/klaytn/klaytn/common"
"github.com/klaytn/klaytn/crypto"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"strings"
"testing"

"github.com/klaytn/klaytn/common"
"github.com/klaytn/klaytn/common/math"
"github.com/klaytn/klaytn/crypto"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/math"
"github.com/kaiachain/kaia/crypto"
"github.com/stretchr/testify/assert"
)

Expand Down
10 changes: 5 additions & 5 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"io"
"math/big"

"github.com/klaytn/klaytn/accounts"
"github.com/klaytn/klaytn/accounts/keystore"
"github.com/klaytn/klaytn/blockchain/types"
"github.com/klaytn/klaytn/common"
"github.com/klaytn/klaytn/crypto"
"github.com/kaiachain/kaia/accounts"
"github.com/kaiachain/kaia/accounts/keystore"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/crypto"
)

// NewTransactor is a utility method to easily create a transaction signer from
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"errors"
"math/big"

kaia "github.com/klaytn/klaytn"
"github.com/klaytn/klaytn/blockchain/types"
"github.com/klaytn/klaytn/common"
kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
)

var (
Expand Down
57 changes: 45 additions & 12 deletions accounts/abi/bind/backends/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ import (
"errors"
"math/big"

kaia "github.com/klaytn/klaytn"
"github.com/klaytn/klaytn/accounts/abi/bind"
"github.com/klaytn/klaytn/blockchain"
"github.com/klaytn/klaytn/blockchain/state"
"github.com/klaytn/klaytn/blockchain/types"
"github.com/klaytn/klaytn/blockchain/vm"
"github.com/klaytn/klaytn/common"
"github.com/klaytn/klaytn/event"
"github.com/klaytn/klaytn/node/cn/filters"
"github.com/klaytn/klaytn/params"
kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/state"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/blockchain/vm"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/math"
"github.com/kaiachain/kaia/event"
"github.com/kaiachain/kaia/node/cn/filters"
"github.com/kaiachain/kaia/params"
)

// Maintain separate minimal interfaces of blockchain.BlockChain because ContractBackend are used
Expand Down Expand Up @@ -125,6 +126,28 @@ func (b *BlockchainContractBackend) CallContract(ctx context.Context, call kaia.
}

func (b *BlockchainContractBackend) callContract(call kaia.CallMsg, block *types.Block, state *state.StateDB) (*blockchain.ExecutionResult, error) {
gasPrice := common.Big0
if call.GasPrice != nil && (call.GasFeeCap != nil || call.GasTipCap != nil) {
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
}
if !b.bc.Config().IsKaiaForkEnabled(block.Number()) { // before KIP-162
if call.GasPrice != nil {
gasPrice = call.GasPrice
}
} else { // after KIP-162
if call.GasPrice != nil {
gasPrice = call.GasPrice
} else {
if call.GasFeeCap == nil {
call.GasFeeCap = big.NewInt(0)
}
if call.GasTipCap == nil {
call.GasTipCap = big.NewInt(0)
}
gasPrice = math.BigMin(new(big.Int).Add(call.GasTipCap, block.Header().BaseFee), call.GasFeeCap)
}
}

if call.Gas == 0 {
call.Gas = uint64(3e8) // enough gas for ordinary contract calls
}
Expand All @@ -138,7 +161,8 @@ func (b *BlockchainContractBackend) callContract(call kaia.CallMsg, block *types
if call.AccessList != nil {
accessList = *call.AccessList
}
msg := types.NewMessage(call.From, call.To, 0, call.Value, call.Gas, call.GasPrice, call.Data,

msg := types.NewMessage(call.From, call.To, 0, call.Value, call.Gas, gasPrice, call.Data,
false, intrinsicGas, accessList)

txContext := blockchain.NewEVMTxContext(msg, block.Header(), b.bc.Config())
Expand Down Expand Up @@ -232,7 +256,16 @@ func (b *BlockchainContractBackend) EstimateGas(ctx context.Context, call kaia.C
return res.Failed(), res, nil
}

estimated, err := blockchain.DoEstimateGas(ctx, call.Gas, 0, call.Value, call.GasPrice, balance, executable)
gasPrice := common.Big0
if call.GasPrice != nil && (call.GasFeeCap != nil || call.GasTipCap != nil) {
return 0, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
} else if call.GasPrice != nil {
gasPrice = call.GasPrice
} else if call.GasFeeCap != nil {
gasPrice = call.GasFeeCap
}

estimated, err := blockchain.DoEstimateGas(ctx, call.Gas, 0, call.Value, gasPrice, balance, executable)
return uint64(estimated), err
}

Expand Down
Loading

0 comments on commit 6d4b549

Please sign in to comment.