Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet and Stagenet chain configurations; Minor bug fixes; Removed unused consensus; Update Go package refs #3

Merged
merged 30 commits into from Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
33433b6
geth/core/params: add startup arg for Electroneum's mainnet and testnet
andrepatta Jun 14, 2022
f776e66
node: change default data dir
andrepatta Jun 14, 2022
c320d45
qbft: check if coinbase address corresponds with block signer
andrepatta Jun 15, 2022
2d176a3
cmd/core/eth/mobile/params: Remove eth testnets and add Electroneum's…
andrepatta Jun 15, 2022
165834b
consensus/eth/params: always use Ceil2Nby3 for istanbul consensus mes…
andrepatta Jun 19, 2022
8d2a05c
cmd/core/eth/miner/params: remove IsQuorum chain configuration flag
andrepatta Jun 19, 2022
948787f
consensus/eth/params: remove TestQBFTBlock from chain configuration
andrepatta Jun 19, 2022
3495451
consensus/eth/params: remove standard IBFT consensus engine
andrepatta Jun 19, 2022
910c431
cmd/consensus/core/eth/miner/params: replace QBFT with IBFT chain con…
andrepatta Jun 19, 2022
13f75cd
miner: instantly make block canonical if using IBFT consensus
andrepatta Jun 19, 2022
b1642fb
core: update testnet genesis with validator addresses
andrepatta Jun 23, 2022
b8b6ab8
core: update testnet genesis with correct timestamp
andrepatta Jun 23, 2022
740563e
params: update testnet genesis hash
andrepatta Jun 23, 2022
58ff524
cmd: update geth/cmd tests with the new testnet genesis timestamp
andrepatta Jun 23, 2022
327c86c
cmd/core/mobile/params: add support for stagenet chain configuration
andrepatta Jun 24, 2022
ea1f129
core/params: pre-alloc funds in testnet and stagenet
andrepatta Jun 27, 2022
2f0ff4d
params: don't use DNS to fetch peers for now, need to setup etn dns f…
andrepatta Jun 27, 2022
5fc1b6f
cmd/les/mobile: set missing networkids to the correct value
andrepatta Jun 27, 2022
0e0db41
cmd: fix custom bootstrap nodes for testnet and stagenet
andrepatta Jun 27, 2022
83d39ea
params: comment out unused dnsPrefix variable
andrepatta Jun 27, 2022
790f502
params/version: set etn version
andrepatta Jun 27, 2022
eed2b31
cmd/ethkey: rename ethkey to etnkey
andrepatta Jun 27, 2022
3ed05c1
cmd/geth: rename geth to etn-sc
andrepatta Jun 27, 2022
c467b6d
dockerfile: update dockerfile entry point
andrepatta Jun 28, 2022
d86e3cc
all: change go package references to electroneum/electroneum-sc
andrepatta Jun 28, 2022
c571965
Update README.md
andrepatta Jun 28, 2022
356ecf1
Update README.md
andrepatta Jun 28, 2022
d17407c
core: params: properly set pre-allocated funds to dev addresses (test…
andrepatta Jun 28, 2022
ff3e40b
node/defaults: change default data dir to "electroneum-sc"
andrepatta Jun 28, 2022
42003f0
core/genesis: update mainnet/stagenet/testnet comments
andrepatta Jun 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Test Build
run: |
make geth
make etn-sc
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,5 +1,5 @@
language: go
go_import_path: github.com/ethereum/go-ethereum
go_import_path: github.com/electroneum/electroneum-sc
sudo: false
jobs:
allow_failures:
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
script:
# Build the Android archive and upload it to Maven Central and Azure
- mkdir -p $GOPATH/src/github.com/ethereum
- ln -s `pwd` $GOPATH/src/github.com/ethereum/go-ethereum
- ln -s `pwd` $GOPATH/src/github.com/electroneum/electroneum-sc
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -signify SIGNIFY_KEY -deploy https://oss.sonatype.org -upload gethstore/builds

# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -23,7 +23,7 @@ RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]
ENTRYPOINT ["etn-sc"]

# Add some metadata labels to help programatic image consumption
ARG COMMIT=""
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Expand Up @@ -2,31 +2,31 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios evm all test clean
.PHONY: etn-sc android ios evm all test clean

GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run

geth:
$(GORUN) build/ci.go install ./cmd/geth
etn-sc:
$(GORUN) build/ci.go install ./cmd/etn-sc
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."
@echo "Run \"$(GOBIN)/etn-sc\" to launch etn-sc."

all:
$(GORUN) build/ci.go install

android:
$(GORUN) build/ci.go aar --local
@echo "Done building."
@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
@echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs"
@echo "Import \"$(GOBIN)/etn-sc.aar\" to use the library."
@echo "Import \"$(GOBIN)/etn-sc-sources.jar\" to add javadocs"
@echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc"

ios:
$(GORUN) build/ci.go xcode --local
@echo "Done building."
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
@echo "Import \"$(GOBIN)/Etn-SC.framework\" to use the library."

test: all
$(GORUN) build/ci.go test
Expand Down
283 changes: 77 additions & 206 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"io"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/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
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/common/math"
"github.com/electroneum/electroneum-sc/crypto"
)

const jsondata = `
Expand Down
14 changes: 7 additions & 7 deletions accounts/abi/bind/auth.go
Expand Up @@ -23,13 +23,13 @@ import (
"io"
"math/big"

"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/electroneum/electroneum-sc/accounts"
"github.com/electroneum/electroneum-sc/accounts/external"
"github.com/electroneum/electroneum-sc/accounts/keystore"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/core/types"
"github.com/electroneum/electroneum-sc/crypto"
"github.com/electroneum/electroneum-sc/log"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
16 changes: 8 additions & 8 deletions accounts/abi/bind/backend.go
Expand Up @@ -21,9 +21,9 @@ import (
"errors"
"math/big"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
electroneum "github.com/electroneum/electroneum-sc"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/core/types"
)

var (
Expand All @@ -50,7 +50,7 @@ type ContractCaller interface {

// CallContract executes an Ethereum contract call with the specified data as the
// input.
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error)
}

// PendingContractCaller defines methods to perform contract calls on the pending state.
Expand All @@ -61,7 +61,7 @@ type PendingContractCaller interface {
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)

// PendingCallContract executes an Ethereum contract call against the pending state.
PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error)
}

// ContractTransactor defines the methods needed to allow operating with a contract
Expand Down Expand Up @@ -92,7 +92,7 @@ type ContractTransactor interface {
// There is no guarantee that this is the true gas limit requirement as other
// transactions may be added or removed by miners, but it should provide a basis
// for setting a reasonable default.
EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
EstimateGas(ctx context.Context, call electroneum.CallMsg) (gas uint64, err error)

// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error
Expand All @@ -105,11 +105,11 @@ type ContractFilterer interface {
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error)

// SubscribeFilterLogs creates a background log filtering operation, returning
// a subscription immediately, which can be used to stream the found events.
SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error)
}

// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
Expand Down
58 changes: 29 additions & 29 deletions accounts/abi/bind/backends/simulated.go
Expand Up @@ -24,25 +24,25 @@ import (
"sync"
"time"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
electroneum "github.com/electroneum/electroneum-sc"
"github.com/electroneum/electroneum-sc/accounts/abi"
"github.com/electroneum/electroneum-sc/accounts/abi/bind"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/common/hexutil"
"github.com/electroneum/electroneum-sc/common/math"
"github.com/electroneum/electroneum-sc/consensus/ethash"
"github.com/electroneum/electroneum-sc/core"
"github.com/electroneum/electroneum-sc/core/bloombits"
"github.com/electroneum/electroneum-sc/core/rawdb"
"github.com/electroneum/electroneum-sc/core/state"
"github.com/electroneum/electroneum-sc/core/types"
"github.com/electroneum/electroneum-sc/core/vm"
"github.com/electroneum/electroneum-sc/eth/filters"
"github.com/electroneum/electroneum-sc/ethdb"
"github.com/electroneum/electroneum-sc/event"
"github.com/electroneum/electroneum-sc/log"
"github.com/electroneum/electroneum-sc/params"
"github.com/electroneum/electroneum-sc/rpc"
)

// This nil assignment ensures at compile time that SimulatedBackend implements bind.ContractBackend.
Expand Down Expand Up @@ -231,7 +231,7 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash common

receipt, _, _, _ := rawdb.ReadReceipt(b.database, txHash, b.config)
if receipt == nil {
return nil, ethereum.NotFound
return nil, electroneum.NotFound
}
return receipt, nil
}
Expand All @@ -252,7 +252,7 @@ func (b *SimulatedBackend) TransactionByHash(ctx context.Context, txHash common.
if tx != nil {
return tx, false, nil
}
return nil, false, ethereum.NotFound
return nil, false, electroneum.NotFound
}

// BlockByHash retrieves a block based on the block hash.
Expand Down Expand Up @@ -414,7 +414,7 @@ func (e *revertError) ErrorData() interface{} {
}

// CallContract executes a contract call.
func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
func (b *SimulatedBackend) CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()

Expand All @@ -437,7 +437,7 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM
}

// PendingCallContract executes a contract call on the pending state.
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
defer b.pendingState.RevertToSnapshot(b.pendingState.Snapshot())
Expand Down Expand Up @@ -482,7 +482,7 @@ func (b *SimulatedBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, erro

// EstimateGas executes the requested code against the currently pending block/state and
// returns the used amount of gas.
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call electroneum.CallMsg) (uint64, error) {
b.mu.Lock()
defer b.mu.Unlock()

Expand Down Expand Up @@ -586,7 +586,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs

// callContract implements common code between normal and pending contract calls.
// state is modified during execution, make sure to copy it if necessary.
func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) {
func (b *SimulatedBackend) callContract(ctx context.Context, call electroneum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) {
// Gas prices post 1559 need to be initialized
if call.GasPrice != nil && (call.GasFeeCap != nil || call.GasTipCap != nil) {
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
Expand Down Expand Up @@ -679,7 +679,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
func (b *SimulatedBackend) FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error) {
var filter *filters.Filter
if query.BlockHash != nil {
// Block filter requested, construct a single-shot filter
Expand Down Expand Up @@ -711,7 +711,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter

// SubscribeFilterLogs creates a background log filtering operation, returning a
// subscription immediately, which can be used to stream the found events.
func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error) {
// Subscribe to contract events
sink := make(chan []*types.Log)

Expand Down Expand Up @@ -744,7 +744,7 @@ func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethere
}

// SubscribeNewHead returns an event subscription for a new header.
func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (electroneum.Subscription, error) {
// subscribe to a new head
sink := make(chan *types.Header)
sub := b.events.SubscribeNewHeads(sink)
Expand Down Expand Up @@ -798,7 +798,7 @@ func (b *SimulatedBackend) Blockchain() *core.BlockChain {

// callMsg implements core.Message to allow passing it as a transaction simulator.
type callMsg struct {
ethereum.CallMsg
electroneum.CallMsg
}

func (m callMsg) From() common.Address { return m.CallMsg.From }
Expand Down