Skip to content

Commit

Permalink
fix: upgrade tendermint to v0.30.0 (#398)
Browse files Browse the repository at this point in the history
* fix: upgrade tendermint  to v0.30.0

* feat: update tendermint to 0.37-rc

* fix: update the tendermint version to 0.37-rc for ci and cd

* fix: add debug information

* fix: fix local testnet boot failed error
  • Loading branch information
imotai authored Apr 10, 2023
1 parent 6923d06 commit 825bc42
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ jobs:
run: |
cd target/${{ matrix.job.target }}/release
if [[ ${{ matrix.job.target }} == x86_64-unknown-linux-gnu ]]; then
wget https://github.com/tendermint/tendermint/releases/download/v0.34.22/tendermint_0.34.22_linux_amd64.tar.gz
mv tendermint_0.34.22_linux_amd64.tar.gz tendermint.tar.gz
wget https://github.com/tendermint/tendermint/releases/download/v0.37.0-rc2/tendermint_0.37.0-rc2_linux_amd64.tar.gz
mv tendermint_0.37.0-rc2_linux_amd64.tar.gz tendermint.tar.gz
tar -zxf tendermint.tar.gz
fi
if [[ ${{ matrix.job.target }} == x86_64-apple-darwin ]]; then
wget https://github.com/tendermint/tendermint/releases/download/v0.34.22/tendermint_0.34.22_darwin_amd64.tar.gz
mv tendermint_0.34.22_darwin_amd64.tar.gz tendermint.tar.gz
wget https://github.com/tendermint/tendermint/releases/download/v0.37.0-rc2/tendermint_0.37.0-rc2_darwin_amd64.tar.gz
mv tendermint_0.37.0-rc2_darwin_amd64.tar.gz tendermint.tar.gz
tar -zxf tendermint.tar.gz
fi
RELEASE_NAME=db3-${GITHUB_REF/refs\/tags\//}-${{ matrix.job.os-name }}-${{ matrix.job.architecture }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ jobs:
protoc --version
cargo build
cd tools
wget https://github.com/tendermint/tendermint/releases/download/v0.34.22/tendermint_0.34.22_linux_amd64.tar.gz
tar -zxf tendermint_0.34.22_linux_amd64.tar.gz
wget https://github.com/tendermint/tendermint/releases/download/v0.37.0-rc2/tendermint_0.37.0-rc2_linux_amd64.tar.gz
tar -zxf tendermint_0.37.0-rc2_linux_amd64.tar.gz
sh start_localnet.sh >tm.log 2>&1 &
sleep 3
../target/debug/db3 client new-db
sleep 1
../target/debug/db3 client show-state
- name: Run rust test with coverage
run: |
cargo llvm-cov nextest --workspace --exclude merkdb --lcov --output-path lcov.info --no-fail-fast
Expand Down
10 changes: 5 additions & 5 deletions src/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ path = "src/main.rs"

[dependencies]
bytes = { version = "1.0", default-features = false }
tendermint-abci = "0.28.0"
tendermint-proto = "0.28.0"
tendermint-rpc = {version = "0.28.0", features=["http-client", "websocket-client"]}
tendermint-config = "0.28.0"
tendermint = "0.28.0"
tendermint-abci = "0.30.0"
tendermint-proto = "0.30.0"
tendermint-rpc = {version = "0.30.0", features=["http-client", "websocket-client"]}
tendermint-config = "0.30.0"
tendermint = "0.30.0"
actix-web = "4.2.1"
actix-cors = "0.6"
futures-util = "0.3.25"
Expand Down
20 changes: 10 additions & 10 deletions src/node/src/abci_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ impl AbciImpl {
dm: &DatabaseMutation,
) -> ResponseDeliverTx {
let mut attrs = vec![EventAttribute {
key: "sender".to_string().into_bytes().into(),
value: sender.to_hex().into_bytes().into(),
key: "sender".to_string(),
value: sender.to_hex(),
index: false,
}];
let action = DatabaseAction::from_i32(dm.action);
Expand All @@ -181,25 +181,25 @@ impl AbciImpl {
let addr_ref: &[u8] = dm.db_address.as_ref();
if let Ok(addr) = AccountAddress::try_from(addr_ref) {
attrs.push(EventAttribute {
key: "to".to_string().into_bytes().into(),
value: addr.to_hex().into_bytes().into(),
key: "to".to_string(),
value: addr.to_hex(),
index: false,
});
}
}
_ => {
dm.document_mutations.iter().for_each(|x| {
attrs.push(EventAttribute {
key: "collections".to_string().into_bytes().into(),
value: x.collection_name.to_string().into_bytes().into(),
key: "collections".to_string(),
value: x.collection_name.to_string(),
index: false,
})
});
let addr_ref: &[u8] = dm.db_address.as_ref();
if let Ok(addr) = AccountAddress::try_from(addr_ref) {
attrs.push(EventAttribute {
key: "to".to_string().into_bytes().into(),
value: addr.to_hex().into_bytes().into(),
key: "to".to_string(),
value: addr.to_hex(),
index: false,
});
}
Expand Down Expand Up @@ -230,8 +230,8 @@ impl AbciImpl {
) -> ResponseDeliverTx {
if ok {
let attrs = vec![EventAttribute {
key: "sender".to_string().into_bytes().into(),
value: sender.to_hex().into_bytes().into(),
key: "sender".to_string(),
value: sender.to_hex(),
index: false,
}];
let event = Event {
Expand Down
4 changes: 2 additions & 2 deletions src/node/src/node_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub fn get_key_pair(file_path: Option<String>) -> Result<DB3KeyPair> {
};

match PrivValidatorKey::load_json_file(&key_path) {
Ok(key) => match key.priv_key.ed25519_keypair() {
Ok(key) => match key.priv_key.ed25519_signing_key() {
Some(kp) => {
let private_key = Ed25519PrivateKey::from_bytes(kp.secret.as_ref())
let private_key = Ed25519PrivateKey::from_bytes(kp.as_bytes())
.map_err(|e| DB3Error::LoadKeyPairError(format!("{e}")))?;
let pair = Ed25519KeyPair::from(private_key);
Ok(DB3KeyPair::Ed25519(pair))
Expand Down
8 changes: 4 additions & 4 deletions tools/start_localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ then
echo "tendermint exist"
else
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
wget https://github.com/tendermint/tendermint/releases/download/v0.34.22/tendermint_0.34.22_linux_amd64.tar.gz
mv tendermint_0.34.22_linux_amd64.tar.gz tendermint.tar.gz
wget https://github.com/tendermint/tendermint/releases/download/v0.37.0-rc2/tendermint_0.37.0-rc2_linux_amd64.tar.gz
mv tendermint_0.37.0-rc2_linux_amd64.tar.gz tendermint.tar.gz
elif [[ "$OSTYPE" == "darwin"* ]]; then
wget https://github.com/tendermint/tendermint/releases/download/v0.34.22/tendermint_0.34.22_darwin_amd64.tar.gz
mv tendermint_0.34.22_darwin_amd64.tar.gz tendermint.tar.gz
wget https://github.com/tendermint/tendermint/releases/download/v0.37.0-rc2/tendermint_0.37.0-rc2_darwin_amd64.tar.gz
mv tendermint_0.37.0-rc2_darwin_amd64.tar.gz tendermint.tar.gz
else
echo "$OSTYPE is not supported, please give us a issue https://github.com/dbpunk-labs/db3/issues/new/choose"
exit 1
Expand Down

0 comments on commit 825bc42

Please sign in to comment.