Skip to content

Commit

Permalink
L1-chain (#13)
Browse files Browse the repository at this point in the history
* apply patch

* Fix for unit tests

* lint fix

* lint fix

* contracts fix

* makefile fix

* build fix

* fix some imports

* Lint fix

* comment fixs

* fix imports

* Update command/genesis/genesis.go

Co-authored-by: Stefan Negovanović <[email protected]>

* Update command/genesis/params.go

Co-authored-by: Stefan Negovanović <[email protected]>

* fix comments

* Linter fixes

* deleted supernet package

* stake fix

* stake fix 2

* comments fix

* Use new version of contracts

* Remove RewardPool address and rename ValidatorSet address to EpochManager address

* Remove burn contract flag

* Remove non-mintable configuration in genesis

* Lint fixes

* Minor rename

* Update e2e-polybft/e2e/consensus_test.go

Co-authored-by: Stefan Negovanović <[email protected]>

* Fix comment

* bridge commands relocation (#19)

* bridge commands relocation

* mint command relocation

* un/stake and whitelist from sidechain to validator folder

* sidechain commands relocation

* commands relocation

* deleted license

* build fix

* Build fix

* segmentation fault fix

* added nativeERC20 approve

* command fix

---------

Co-authored-by: Stefan Negovanović <[email protected]>

* Remove IsMintable native token flag (#22)

* Remove IsMintable native token flag

* Remove key from PremineInfo

* Add blade admin flag (#24)

* Introduce blade admin

* Move to the newest main branch on contracts

* Remove NativeTokenConfig from e2e tests

* Comments fix

---------

Co-authored-by: Goran Rojovic <[email protected]>

* UT fix (#25)

* Add default premine for validators (#26)

* Fix consensus `e2e` tests (#28)

* Fix e2e tests

* Fix migration e2e test (#30)

* Remove StakeManagerAddr, StakeTokenAddr and CustomSupernetManagerAddr from bridge config

* Fix integration test (#31)

* Fix fund command UT

* Small fixes

---------

Co-authored-by: Stefan Negovanović <[email protected]>

* Small fixes for e2e tests

* Move and modify `ChangeVotingPower` `e2e` test (#34)

* Move and modify test

* variable name change

---------

Co-authored-by: Dusan <[email protected]>

* Fix bridge e2e tests (#33)

* Spin up bridge in bridge e2e tests

* Remove unused param

* Check if bridge is enabled when creating state sync relayer

* Remove bridge non native ERC20 token test case

* Logs

* Fix segmentation fault

* Remove logs

* small fix

* small fix

* Deploy root erc20 token to the rootchain

* Initialize CheckpointManager

* Reduce default stake amount

* TestE2E_Bridge_Transfers_AccessLists fix

* Minor fixes

* Fix TestE2E_AddressLists_Bridge

* Fix TestE2E_Bridge_ERC721Transfer and TestE2E_Bridge_ERC1155Transfer

* Fix TestE2E_Bridge_RootchainTokensTransfers

* Premine fix

* Reduce DefaultStake

---------

Co-authored-by: Goran Rojovic <[email protected]>

* Fix local deployment scripts (#40)

* Fix cluster script

* Fix docker local deployment

* Rename (rootchain to bridge in command outputs)

* Minor change

---------

Co-authored-by: Stefan Negovanović <[email protected]>

* test fix

* Remove unnecessary forks (#42)

* Remove leftover

* Use in-house built event tracker (#41)

* Use ethernal's event tracker

* Remove log

* EventTracker config in one struct

* Comments fix

---------

Co-authored-by: Stefan Negovanović <[email protected]>

* baseFeeConfig as condition for london fork (#43)

* baseFeeConfig as condition for london fork

* lint fix

* comment fix

* Update command/genesis/polybft_params.go

Co-authored-by: Goran Rojovic <[email protected]>

* deleted unnecessary if

* e2e test fix

* Linter fix

* Add base-fee-config to e2e tests where needed

* Add SetBaseFeeConfig to the legacy e2e framework

* Remove leftover

* Provide non-validator account as receiver of native tokens in TestE2E_Consensus_MintableERC20NativeToken

---------

Co-authored-by: Goran Rojovic <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>

---------

Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Goran Rojovic <[email protected]>
Co-authored-by: Goran Rojovic <[email protected]>
  • Loading branch information
5 people authored Dec 6, 2023
1 parent c485d1d commit 7cb91cb
Show file tree
Hide file tree
Showing 137 changed files with 2,268 additions and 6,286 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
path = tests/tests
url = https://github.com/ethereum/tests.git
shallow = true
[submodule "core-contracts"]
path = core-contracts
url = https://github.com/0xPolygon/core-contracts
[submodule "blade-contracts"]
path = blade-contracts
url = https://github.com/Ethernal-Tech/blade-contracts
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ test-property-polybft: check-go
env EDGE_BINARY=${PWD}/artifacts/blade E2E_TESTS=true E2E_LOGS=true go test -v -timeout=30m ./e2e-polybft/property/... \
-rapid.checks=10

.PHONY: compile-core-contracts
compile-core-contracts: check-npm
cd core-contracts && npm install && npm run compile
.PHONY: compile-blade-contracts
compile-blade-contracts: check-npm
cd blade-contracts && npm install && npm run compile
$(MAKE) generate-smart-contract-bindings

.PHONY: generate-smart-contract-bindings
Expand Down Expand Up @@ -117,7 +117,7 @@ help:
@printf " %-35s - %s\n" "test-e2e" "Run end-to-end tests"
@printf " %-35s - %s\n" "test-e2e-polybft" "Run end-to-end tests for PolyBFT"
@printf " %-35s - %s\n" "test-property-polybft" "Run property tests for PolyBFT"
@printf " %-35s - %s\n" "compile-core-contracts" "Compile core contracts"
@printf " %-35s - %s\n" "compile-blade-contracts" "Compile blade contracts"
@printf " %-35s - %s\n" "generate-smart-contract-bindings" "Generate smart contract bindings"
@printf " %-35s - %s\n" "run-docker" "Run Docker cluster for PolyBFT"
@printf " %-35s - %s\n" "stop-docker" "Stop Docker cluster for PolyBFT"
Expand Down
1 change: 1 addition & 0 deletions blade-contracts
Submodule blade-contracts added at de420a
68 changes: 28 additions & 40 deletions chain/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,15 @@ func (p *Params) GetEngine() string {

// predefined forks
const (
Homestead = "homestead"
Byzantium = "byzantium"
Constantinople = "constantinople"
Petersburg = "petersburg"
Istanbul = "istanbul"
London = "london"
EIP150 = "EIP150"
EIP158 = "EIP158"
EIP155 = "EIP155"
QuorumCalcAlignment = "quorumcalcalignment"
TxHashWithType = "txHashWithType"
LondonFix = "londonfix"
Homestead = "homestead"
Byzantium = "byzantium"
Constantinople = "constantinople"
Petersburg = "petersburg"
Istanbul = "istanbul"
London = "london"
EIP150 = "EIP150"
EIP158 = "EIP158"
EIP155 = "EIP155"
)

// Forks is map which contains all forks and their starting blocks from genesis
Expand All @@ -116,18 +113,15 @@ func (f *Forks) RemoveFork(name string) *Forks {
// At returns ForksInTime instance that shows which supported forks are enabled for the block
func (f *Forks) At(block uint64) ForksInTime {
return ForksInTime{
Homestead: f.IsActive(Homestead, block),
Byzantium: f.IsActive(Byzantium, block),
Constantinople: f.IsActive(Constantinople, block),
Petersburg: f.IsActive(Petersburg, block),
Istanbul: f.IsActive(Istanbul, block),
London: f.IsActive(London, block),
EIP150: f.IsActive(EIP150, block),
EIP158: f.IsActive(EIP158, block),
EIP155: f.IsActive(EIP155, block),
QuorumCalcAlignment: f.IsActive(QuorumCalcAlignment, block),
TxHashWithType: f.IsActive(TxHashWithType, block),
LondonFix: f.IsActive(LondonFix, block),
Homestead: f.IsActive(Homestead, block),
Byzantium: f.IsActive(Byzantium, block),
Constantinople: f.IsActive(Constantinople, block),
Petersburg: f.IsActive(Petersburg, block),
Istanbul: f.IsActive(Istanbul, block),
London: f.IsActive(London, block),
EIP150: f.IsActive(EIP150, block),
EIP158: f.IsActive(EIP158, block),
EIP155: f.IsActive(EIP155, block),
}
}

Expand Down Expand Up @@ -177,24 +171,18 @@ type ForksInTime struct {
London,
EIP150,
EIP158,
EIP155,
QuorumCalcAlignment,
TxHashWithType,
LondonFix bool
EIP155 bool
}

// AllForksEnabled should contain all supported forks by current edge version
var AllForksEnabled = &Forks{
Homestead: NewFork(0),
EIP150: NewFork(0),
EIP155: NewFork(0),
EIP158: NewFork(0),
Byzantium: NewFork(0),
Constantinople: NewFork(0),
Petersburg: NewFork(0),
Istanbul: NewFork(0),
London: NewFork(0),
QuorumCalcAlignment: NewFork(0),
TxHashWithType: NewFork(0),
LondonFix: NewFork(0),
Homestead: NewFork(0),
EIP150: NewFork(0),
EIP155: NewFork(0),
EIP158: NewFork(0),
Byzantium: NewFork(0),
Constantinople: NewFork(0),
Petersburg: NewFork(0),
Istanbul: NewFork(0),
London: NewFork(0),
}
12 changes: 9 additions & 3 deletions command/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package bridge
import (
"github.com/spf13/cobra"

deploy "github.com/0xPolygon/polygon-edge/command/bridge/deploy"
depositERC1155 "github.com/0xPolygon/polygon-edge/command/bridge/deposit/erc1155"
depositERC20 "github.com/0xPolygon/polygon-edge/command/bridge/deposit/erc20"
depositERC721 "github.com/0xPolygon/polygon-edge/command/bridge/deposit/erc721"
"github.com/0xPolygon/polygon-edge/command/bridge/exit"
"github.com/0xPolygon/polygon-edge/command/bridge/mint"
"github.com/0xPolygon/polygon-edge/command/bridge/fund"
"github.com/0xPolygon/polygon-edge/command/bridge/server"
withdrawERC1155 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc1155"
withdrawERC20 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc20"
withdrawERC721 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc721"
Expand Down Expand Up @@ -41,7 +43,11 @@ func registerSubcommands(baseCmd *cobra.Command) {
withdrawERC1155.GetCommand(),
// bridge exit
exit.GetCommand(),
// bridge mint erc-20
mint.GetCommand(),
// bridge deploy
deploy.GetCommand(),
// bridge server
server.GetCommand(),
// bridge fund
fund.GetCommand(),
)
}
Loading

0 comments on commit 7cb91cb

Please sign in to comment.