Skip to content

Commit

Permalink
Merge pull request #641 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: prepare for release v1.9.0
  • Loading branch information
unclezoro committed Jul 12, 2024
2 parents 6868551 + d85ef37 commit 0404b8b
Show file tree
Hide file tree
Showing 16 changed files with 991 additions and 207 deletions.
17 changes: 17 additions & 0 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig.
app.registerSerengetiUpgradeHandler()
app.registerErdosUpgradeHandler()
app.registerVeldUpgradeHandler()
app.registerMongolianUpgradeHandler()
// app.register...()
// ...
return nil
Expand Down Expand Up @@ -279,3 +280,19 @@ func (app *App) registerVeldUpgradeHandler() {
return nil
})
}

func (app *App) registerMongolianUpgradeHandler() {
// Register the upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Mongolian,
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
app.Logger().Info("upgrade to ", plan.Name)
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

// Register the upgrade initializer
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Mongolian,
func() error {
app.Logger().Info("Init Veld upgrade")
return nil
})
}
1 change: 1 addition & 0 deletions deployment/localup/localup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function generate_genesis() {
echo -e '[[upgrade]]\nname = "Serengeti"\nheight = 24\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
echo -e '[[upgrade]]\nname = "Erdos"\nheight = 25\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
echo -e '[[upgrade]]\nname = "Veld"\nheight = 26\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
echo -e '[[upgrade]]\nname = "Mongolian"\nheight = 27\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
done

# enable swagger API for validator0
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/billing-and-payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ deposit, several fields will be recorded for this stream account:

*<span style={{color:'#FFDEAD'}}>Buffer Balance</span> = - Netflow Rate \* pre-configured ReserveTime if Netflow Rate is negative*

![funds-flow](../../../../static/asset/04-Funds-Flow.jpg)
![funds-flow](https://docs.bnbchain.org/bnb-greenfield/static/asset/04-Funds-Flow.jpg)

<div style={{textAlign:'center'}}><i>How a User Receives Inflow and Outflow of Funds</i></div>

Expand Down Expand Up @@ -677,4 +677,4 @@ When deleting an object, the following outflows will be updated.

Be noted, when deleting an object, if it is stored less than `ReserveTime`, it still needs to pay for
storing `ReserveTime`
and the unpaid fee will be transferred to Global Virtual Group Family, Global Virtual Group, and validator tax pool.
and the unpaid fee will be transferred to Global Virtual Group Family, Global Virtual Group, and validator tax pool.
6 changes: 3 additions & 3 deletions docs/modules/virtual-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Local Virtual Group(LVG): Each bucket maintains a mapping from the local group I

Local virtual groups are linked to their corresponding buckets, and each object needs to store the ID information of the local virtual group. Each local virtual group must correspond to one and only one global virtual group.

![VirtualGroup Overview](../../../../static/asset/12-Greenfield-VirtualGroup.png)
![VirtualGroup Overview](https://docs.bnbchain.org/bnb-greenfield/static/asset/12-Greenfield-VirtualGroup.png)

In order to avoid all the data of a primary SP being transferred to one SP within a short period of time, we introduce the concept of "family".

![VirtualGroup Family](../../../../static/asset/13-Greenfield-VirtualGroupFamily.png)
![VirtualGroup Family](https://docs.bnbchain.org/bnb-greenfield/static/asset/13-Greenfield-VirtualGroupFamily.png)

A family can contain multiple GVG that the same SP creates. A bucket can only be served by the GVGs that are in the same family, cross family GVG is not allowed within one bucket. Once the total storage size of a family exceeds 64TB(TBD), the GVG inside the family can not server new buckets, the SP has to create a new family. By introducing family , the primary SP can exit at family level without breaking the one bucket, one primary SP rule.

Expand Down Expand Up @@ -61,7 +61,7 @@ This orderly exit process ensures a smooth transition of responsibilities and re

### Bucket Migration Workflow

![Bucket Miragtion](../../../../static/asset/14-Greenfield-Bucket-Migration.png)
![Bucket Miragtion](https://docs.bnbchain.org/bnb-greenfield/static/asset/14-Greenfield-Bucket-Migration.png)

Below are the key workflow of Bucket Migration:

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ replace (
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.3.0
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.8.1-0.20240711041516-7fd2f478ff35
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.3.0 h1:v3nZ16ledTZGF5Csys7fTQGZcEV78
github.com/bnb-chain/greenfield-cometbft v1.3.0/go.mod h1:0D+VPivZTeBldjtGGi9LKbBnKEO/RtMRJikie92LkYI=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI=
github.com/bnb-chain/greenfield-cosmos-sdk v1.8.0 h1:XaHBYnlAJNIEVTr9dXp3jzw12gCoIEL5jHiAMp+PX0s=
github.com/bnb-chain/greenfield-cosmos-sdk v1.8.0/go.mod h1:2bwmwdXYBISnQoMwgAcZTVGt21lMsHZSeeeMByTvDlQ=
github.com/bnb-chain/greenfield-cosmos-sdk v1.8.1-0.20240711041516-7fd2f478ff35 h1:9VZdnAqCBFCGzNxzV7jnxqSpUwIDwH7UcUMl1nfCEY4=
github.com/bnb-chain/greenfield-cosmos-sdk v1.8.1-0.20240711041516-7fd2f478ff35/go.mod h1:2bwmwdXYBISnQoMwgAcZTVGt21lMsHZSeeeMByTvDlQ=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s=
Expand Down
28 changes: 28 additions & 0 deletions proto/greenfield/permission/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,34 @@ message Policy {
];
}

message CrossChainPolicy {
// id is an unique u256 sequence for each policy. It also be used as NFT tokenID
string id = 1 [
(cosmos_proto.scalar) = "cosmos.Uint",
(gogoproto.customtype) = "Uint",
(gogoproto.nullable) = false
];
// principal defines the accounts/group which the permission grants to
Principal principal = 2;
// resource_type defines the type of resource that grants permission for
resource.ResourceType resource_type = 3;
// resource_id defines the bucket/object/group id of the resource that grants permission for
string resource_id = 4 [
(cosmos_proto.scalar) = "cosmos.Uint",
(gogoproto.customtype) = "Uint",
(gogoproto.nullable) = false
];
// statements defines the details content of the permission, including effect/actions/sub-resources
repeated Statement statements = 5;
// expiration_time defines the whole expiration time of all the statements.
// Notices: Its priority is higher than the expiration time inside the Statement
google.protobuf.Timestamp expiration_time = 6 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
];
optional string resourceGRN = 7;
}

// PolicyGroup refers to a group of policies which grant permission to Group, which is limited to MaxGroupNum (default 10).
// This means that a single resource can only grant permission to 10 groups. The reason for
// this is to enable on-chain determination of whether an operator has permission within a limited time.
Expand Down
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ through decentralized applications known as BNB Greenfield dApps. These dApps pr
interacting with the platform, enabling users to create and manipulate data in a secure and decentralized environment.

## Documentation
Visit our official [documentation site](https://docs.bnbchain.org/greenfield-docs/docs/guide/introduction/overview) for more info.
Visit our official [documentation site](https://docs.bnbchain.org/bnb-greenfield/introduction/) for more info.

## Quick Started

Expand Down Expand Up @@ -83,7 +83,7 @@ $ bash ./deployment/localup/localup.sh stop
bash ./deployment/localup/localup.sh start 3 3
```

More advanced script and command line usage, please refer to the [Tutorial](https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-cli).
More advanced script and command line usage, please refer to the [Tutorial](https://docs.bnbchain.org/bnb-greenfield/greenfield-blockchain/gnfd-cli/).

## Key Modules

Expand All @@ -104,14 +104,14 @@ And the following modules are in cosmos-sdk:
- `x/staking`: based on the Proof-of-Stake logic. The elected validators are responsible for the security of the Greenfield blockchain.
They get involved in the governance and staking of the blockchain.

Refer to the [docs](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/storage-module) to dive deep into these modules.
Refer to the [docs](https://github.com/bnb-chain/greenfield/blob/master/docs/modules/storage-module.md) to dive deep into these modules.

## Running node

- [Interacting with the Node](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/interact-node)
- [Run Local Network](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/run-local-network)
- [Run Node](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node)
- [Become Validator](https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/run-node/become-validator)
- [Interacting with the Node](https://docs.bnbchain.org/bnb-greenfield/greenfield-blockchain/interact-node/)
- [Run Local Network](https://docs.bnbchain.org/bnb-greenfield/greenfield-blockchain/run-node/run-node/)
- [Run Node](https://docs.bnbchain.org/bnb-greenfield/greenfield-blockchain/run-node/run-node/)
- [Become Validator](https://docs.bnbchain.org/bnb-greenfield/greenfield-blockchain/run-node/become-validator/)

## Related Projects
- [Greenfield-Contract](https://github.com/bnb-chain/greenfield-contracts): the cross chain contract for Greenfield that deployed on BSC network.
Expand Down
Loading

0 comments on commit 0404b8b

Please sign in to comment.