diff --git a/cmd/u2u/launcher/config.go b/cmd/u2u/launcher/config.go index 8809937..4107fc2 100644 --- a/cmd/u2u/launcher/config.go +++ b/cmd/u2u/launcher/config.go @@ -175,26 +175,26 @@ var tomlSettings = toml.Config{ } type config struct { - Node node.Config - U2U gossip.Config - Emitter emitter.Config - TxPool evmcore.TxPoolConfig - U2UStore gossip.StoreConfig - Hashgraph consensus.Config - HashgraphStore consensus.StoreConfig - VectorClock vecmt.IndexConfig - DBs integration.DBsConfig - Monitoring monitoring.Config + Node node.Config + U2U gossip.Config + Emitter emitter.Config + TxPool evmcore.TxPoolConfig + U2UStore gossip.StoreConfig + Helios consensus.Config + HeliosStore consensus.StoreConfig + VectorClock vecmt.IndexConfig + DBs integration.DBsConfig + Monitoring monitoring.Config } func (c *config) AppConfigs() integration.Configs { return integration.Configs{ - U2U: c.U2U, - U2UStore: c.U2UStore, - Hashgraph: c.Hashgraph, - HashgraphStore: c.HashgraphStore, - VectorClock: c.VectorClock, - DBs: c.DBs, + U2U: c.U2U, + U2UStore: c.U2UStore, + Helios: c.Helios, + HeliosStore: c.HeliosStore, + VectorClock: c.VectorClock, + DBs: c.DBs, } } @@ -495,14 +495,14 @@ func mayMakeAllConfigs(ctx *cli.Context) (*config, error) { // Defaults (low priority) cacheRatio := cacheScaler(ctx) cfg := config{ - Node: defaultNodeConfig(), - U2U: gossip.DefaultConfig(cacheRatio), - Emitter: emitter.DefaultConfig(), - TxPool: evmcore.DefaultTxPoolConfig, - U2UStore: gossip.DefaultStoreConfig(cacheRatio), - Hashgraph: consensus.DefaultConfig(), - HashgraphStore: consensus.DefaultStoreConfig(cacheRatio), - VectorClock: vecmt.DefaultConfig(cacheRatio), + Node: defaultNodeConfig(), + U2U: gossip.DefaultConfig(cacheRatio), + Emitter: emitter.DefaultConfig(), + TxPool: evmcore.DefaultTxPoolConfig, + U2UStore: gossip.DefaultStoreConfig(cacheRatio), + Helios: consensus.DefaultConfig(), + HeliosStore: consensus.DefaultStoreConfig(cacheRatio), + VectorClock: vecmt.DefaultConfig(cacheRatio), } if ctx.GlobalIsSet(FakeNetFlag.Name) { diff --git a/cmd/u2u/launcher/config_custom_test.go b/cmd/u2u/launcher/config_custom_test.go index d3dc02b..938b732 100644 --- a/cmd/u2u/launcher/config_custom_test.go +++ b/cmd/u2u/launcher/config_custom_test.go @@ -22,14 +22,14 @@ func TestConfigFile(t *testing.T) { } src := config{ - Node: defaultNodeConfig(), - U2U: gossip.DefaultConfig(cacheRatio), - Emitter: emitter.DefaultConfig(), - TxPool: evmcore.DefaultTxPoolConfig, - U2UStore: gossip.DefaultStoreConfig(cacheRatio), - Hashgraph: consensus.DefaultConfig(), - HashgraphStore: consensus.DefaultStoreConfig(cacheRatio), - VectorClock: vecmt.DefaultConfig(cacheRatio), + Node: defaultNodeConfig(), + U2U: gossip.DefaultConfig(cacheRatio), + Emitter: emitter.DefaultConfig(), + TxPool: evmcore.DefaultTxPoolConfig, + U2UStore: gossip.DefaultStoreConfig(cacheRatio), + Helios: consensus.DefaultConfig(), + HeliosStore: consensus.DefaultStoreConfig(cacheRatio), + VectorClock: vecmt.DefaultConfig(cacheRatio), } canonical := func(nn []*enode.Node) []*enode.Node { diff --git a/cmd/u2u/launcher/consolecmd_test.go b/cmd/u2u/launcher/consolecmd_test.go index 63b4396..8d4166c 100644 --- a/cmd/u2u/launcher/consolecmd_test.go +++ b/cmd/u2u/launcher/consolecmd_test.go @@ -39,7 +39,7 @@ func TestConsoleWelcome(t *testing.T) { // Verify the actual welcome message to the required template cli.Expect(` -Welcome to the Hashgraph JavaScript console! +Welcome to the Helios JavaScript console! instance: go-u2u/v{{version}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{.Coinbase}} @@ -58,7 +58,7 @@ func TestIPCAttachWelcome(t *testing.T) { // Configure the instance for IPC attachement var ipc string if runtime.GOOS == "windows" { - ipc = `\\.\pipe\hashgraph.ipc` + ipc = `\\.\pipe\helios.ipc` } else { ws := tmpdir(t) defer os.RemoveAll(ws) @@ -121,7 +121,7 @@ func testAttachWelcome(t *testing.T, cli *testcli, endpoint, apis string) { // Verify the actual welcome message to the required template attach.Expect(` -Welcome to the Hashgraph JavaScript console! +Welcome to the Helios JavaScript console! instance: go-u2u/v{{version}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{coinbase}} diff --git a/cmd/u2u/launcher/fake_test.go b/cmd/u2u/launcher/fake_test.go index 183f9c1..0d2a62c 100644 --- a/cmd/u2u/launcher/fake_test.go +++ b/cmd/u2u/launcher/fake_test.go @@ -33,7 +33,7 @@ func TestFakeNetFlag_NonValidator(t *testing.T) { // Verify the actual welcome message to the required template cli.Expect(` -Welcome to the Hashgraph JavaScript console! +Welcome to the Helios JavaScript console! instance: go-u2u/v{{version}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{.Coinbase}} @@ -77,7 +77,7 @@ func TestFakeNetFlag_Validator(t *testing.T) { // Verify the actual welcome message to the required template cli.Expect(` -Welcome to the Hashgraph JavaScript console! +Welcome to the Helios JavaScript console! instance: go-u2u/v{{version}}/{{goos}}-{{goarch}}/{{gover}} coinbase: {{.Coinbase}} diff --git a/cmd/u2u/launcher/fixdirty.go b/cmd/u2u/launcher/fixdirty.go index 59ee629..d543e8a 100644 --- a/cmd/u2u/launcher/fixdirty.go +++ b/cmd/u2u/launcher/fixdirty.go @@ -57,12 +57,12 @@ func healDirty(ctx *cli.Context) error { } // prepare consensus database from epochState - log.Info("Recreating hashgraph DB") + log.Info("Recreating helios DB") cMainDb := mustOpenDB(multiProducer, "hashgraph") cGetEpochDB := func(epoch idx.Epoch) u2udb.Store { return mustOpenDB(multiProducer, fmt.Sprintf("hashgraph-%d", epoch)) } - cdb := consensus.NewStore(cMainDb, cGetEpochDB, panics("hashgraph store"), cfg.HashgraphStore) + cdb := consensus.NewStore(cMainDb, cGetEpochDB, panics("helios store"), cfg.HeliosStore) err = cdb.ApplyGenesis(&consensus.Genesis{ Epoch: epochState.Epoch, Validators: epochState.Validators, diff --git a/cmd/u2u/launcher/launcher.go b/cmd/u2u/launcher/launcher.go index b880bf9..92aa532 100644 --- a/cmd/u2u/launcher/launcher.go +++ b/cmd/u2u/launcher/launcher.go @@ -186,7 +186,7 @@ func init() { // App. - app.Action = hashgraphMain + app.Action = heliosMain app.Version = params.VersionWithCommit(gitCommit, gitDate) app.HideVersion = true // we have a command to print the version app.Commands = []cli.Command{ @@ -251,7 +251,7 @@ func Launch(args []string) error { // u2u is the main entry point into the system if no special subcommand is ran. // It creates a default node based on the command line arguments and runs it in // blocking mode, waiting for it to be shut down. -func hashgraphMain(ctx *cli.Context) error { +func heliosMain(ctx *cli.Context) error { if args := ctx.Args(); len(args) > 0 { return fmt.Errorf("invalid command: %q", args[0]) } diff --git a/console/console.go b/console/console.go index dfdfc9b..3c7e61b 100644 --- a/console/console.go +++ b/console/console.go @@ -298,7 +298,7 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str // Welcome shows summary of current u2u instance and some metadata about the // console's available modules. func (c *Console) Welcome() { - message := "Welcome to the Hashgraph JavaScript console!\n\n" + message := "Welcome to the Helios JavaScript console!\n\n" // Print some generic u2u metadata res, err := c.jsre.Run(` diff --git a/ethapi/api.go b/ethapi/api.go index 0e1b59d..eef23aa 100644 --- a/ethapi/api.go +++ b/ethapi/api.go @@ -2537,7 +2537,7 @@ func (api *PrivateDebugAPI) ChaindbCompact() error { // SetHead rewinds the head of the blockchain to a previous block. func (api *PrivateDebugAPI) SetHead(number hexutil.Uint64) error { - return errors.New("hashgraph cannot rewind blocks due to the BFT algorithm") + return errors.New("helios cannot rewind blocks due to the BFT algorithm") } // PublicNetAPI offers network related RPC methods diff --git a/ethapi/backend.go b/ethapi/backend.go index 2a290e4..dca5fbd 100644 --- a/ethapi/backend.go +++ b/ethapi/backend.go @@ -99,14 +99,14 @@ type Backend interface { ChainConfig() *params.ChainConfig CurrentBlock() *evmcore.EvmBlock - // Hashgraph DAG API + // Helios DAG API GetEventPayload(ctx context.Context, shortEventID string) (*native.EventPayload, error) GetEvent(ctx context.Context, shortEventID string) (*native.Event, error) GetHeads(ctx context.Context, epoch rpc.BlockNumber) (hash.Events, error) CurrentEpoch(ctx context.Context) idx.Epoch SealedEpochTiming(ctx context.Context) (start native.Timestamp, end native.Timestamp) - // Hashgraph aBFT API + // Helios aBFT API GetEpochBlockState(ctx context.Context, epoch rpc.BlockNumber) (*iblockproc.BlockState, *iblockproc.EpochState, error) GetDowntime(ctx context.Context, vid idx.ValidatorID) (idx.Block, native.Timestamp, error) GetUptime(ctx context.Context, vid idx.ValidatorID) (*big.Int, error) diff --git a/ethapi/dag_api.go b/ethapi/dag_api.go index 61aa217..043b64e 100644 --- a/ethapi/dag_api.go +++ b/ethapi/dag_api.go @@ -24,7 +24,7 @@ func NewPublicDAGChainAPI(b Backend) *PublicDAGChainAPI { return &PublicDAGChainAPI{b} } -// GetEvent returns the Hashgraph event header by hash or short ID. +// GetEvent returns the Helios event header by hash or short ID. func (s *PublicDAGChainAPI) GetEvent(ctx context.Context, shortEventID string) (map[string]interface{}, error) { header, err := s.b.GetEvent(ctx, shortEventID) if err != nil { @@ -36,7 +36,7 @@ func (s *PublicDAGChainAPI) GetEvent(ctx context.Context, shortEventID string) ( return native.RPCMarshalEvent(header), nil } -// GetEventPayload returns Hashgraph event by hash or short ID. +// GetEventPayload returns Helios event by hash or short ID. func (s *PublicDAGChainAPI) GetEventPayload(ctx context.Context, shortEventID string, inclTx bool) (map[string]interface{}, error) { event, err := s.b.GetEventPayload(ctx, shortEventID) if err != nil { diff --git a/evmcore/dummy_block.go b/evmcore/dummy_block.go index dd63151..c520dde 100644 --- a/evmcore/dummy_block.go +++ b/evmcore/dummy_block.go @@ -87,7 +87,7 @@ func ToEvmHeader(block *native.Block, index idx.Block, prevHash hash.Event, rule } } -// ConvertFromEthHeader converts ETH-formatted header to Hashgraph EVM header +// ConvertFromEthHeader converts ETH-formatted header to Helios EVM header func ConvertFromEthHeader(h *types.Header) *EvmHeader { // NOTE: incomplete conversion return &EvmHeader{ diff --git a/gossip/common_test.go b/gossip/common_test.go index deb3942..2c8a014 100644 --- a/gossip/common_test.go +++ b/gossip/common_test.go @@ -89,7 +89,7 @@ func makeTestEngine(gdb *Store) (*consensus.Consensus, *vecmt.Index) { Validators: gdb.GetValidators(), }) vecClock := vecmt.NewIndex(panics("Vector clock"), vecmt.LiteConfig()) - engine := consensus.NewConsensus(cdb, &testGossipStoreAdapter{gdb}, vecmt2dagidx.Wrap(vecClock), panics("Hashgraph"), consensus.LiteConfig()) + engine := consensus.NewConsensus(cdb, &testGossipStoreAdapter{gdb}, vecmt2dagidx.Wrap(vecClock), panics("Helios"), consensus.LiteConfig()) return engine, vecClock } diff --git a/gossip/ethapi_backend.go b/gossip/ethapi_backend.go index 1970624..c9c8049 100644 --- a/gossip/ethapi_backend.go +++ b/gossip/ethapi_backend.go @@ -202,7 +202,7 @@ func (b *EthAPIBackend) GetFullEventID(shortEventID string) (hash.Event, error) return options[0], nil } -// GetEventPayload returns Hashgraph event by hash or short ID. +// GetEventPayload returns Helios event by hash or short ID. func (b *EthAPIBackend) GetEventPayload(ctx context.Context, shortEventID string) (*native.EventPayload, error) { id, err := b.GetFullEventID(shortEventID) if err != nil { @@ -211,7 +211,7 @@ func (b *EthAPIBackend) GetEventPayload(ctx context.Context, shortEventID string return b.svc.store.GetEventPayload(id), nil } -// GetEvent returns the Hashgraph event header by hash or short ID. +// GetEvent returns the Helios event header by hash or short ID. func (b *EthAPIBackend) GetEvent(ctx context.Context, shortEventID string) (*native.Event, error) { id, err := b.GetFullEventID(shortEventID) if err != nil { diff --git a/integration/assembly.go b/integration/assembly.go index b226d27..b928091 100644 --- a/integration/assembly.go +++ b/integration/assembly.go @@ -45,12 +45,12 @@ func (e *GenesisMismatchError) Error() string { } type Configs struct { - U2U gossip.Config - U2UStore gossip.StoreConfig - Hashgraph consensus.Config - HashgraphStore consensus.StoreConfig - VectorClock vecmt.IndexConfig - DBs DBsConfig + U2U gossip.Config + U2UStore gossip.StoreConfig + Helios consensus.Config + HeliosStore consensus.StoreConfig + VectorClock vecmt.IndexConfig + DBs DBsConfig } func panics(name string) func(error) { @@ -74,7 +74,7 @@ func getStores(producer u2udb.FlushableDBProducer, cfg Configs) (*gossip.Store, cGetEpochDB := func(epoch idx.Epoch) u2udb.Store { return mustOpenDB(producer, fmt.Sprintf("hashgraph-%d", epoch)) } - cdb := consensus.NewStore(cMainDb, cGetEpochDB, panics("Hashgraph store"), cfg.HashgraphStore) + cdb := consensus.NewStore(cMainDb, cGetEpochDB, panics("Helios store"), cfg.HeliosStore) return gdb, cdb } @@ -103,13 +103,13 @@ func rawMakeEngine(gdb *gossip.Store, cdb *consensus.Store, g *genesis.Genesis, Validators: gdb.GetValidators(), }) if err != nil { - return nil, nil, blockProc, fmt.Errorf("failed to write Hashgraph genesis state: %v", err) + return nil, nil, blockProc, fmt.Errorf("failed to write Helios genesis state: %v", err) } } // create consensus vecClock := vecmt.NewIndex(panics("Vector clock"), cfg.VectorClock) - engine := consensus.NewConsensus(cdb, &GossipStoreAdapter{gdb}, vecmt2dagidx.Wrap(vecClock), panics("Hashgraph"), cfg.Hashgraph) + engine := consensus.NewConsensus(cdb, &GossipStoreAdapter{gdb}, vecmt2dagidx.Wrap(vecClock), panics("Helios"), cfg.Helios) return engine, vecClock, blockProc, nil } diff --git a/integration/bench_db_flush_test.go b/integration/bench_db_flush_test.go index 3eadbe2..d6d8767 100644 --- a/integration/bench_db_flush_test.go +++ b/integration/bench_db_flush_test.go @@ -24,12 +24,12 @@ func BenchmarkFlushDBs(b *testing.B) { genStore := makefakegenesis.FakeGenesisStore(1, utils.ToU2U(1), utils.ToU2U(1)) g := genStore.Genesis() _, _, store, s2, _, closeDBs := MakeEngine(dir, &g, Configs{ - U2U: gossip.DefaultConfig(cachescale.Identity), - U2UStore: gossip.DefaultStoreConfig(cachescale.Identity), - Hashgraph: consensus.DefaultConfig(), - HashgraphStore: consensus.DefaultStoreConfig(cachescale.Identity), - VectorClock: vecmt.DefaultConfig(cachescale.Identity), - DBs: DefaultDBsConfig(cachescale.Identity.U64, 512), + U2U: gossip.DefaultConfig(cachescale.Identity), + U2UStore: gossip.DefaultStoreConfig(cachescale.Identity), + Helios: consensus.DefaultConfig(), + HeliosStore: consensus.DefaultStoreConfig(cachescale.Identity), + VectorClock: vecmt.DefaultConfig(cachescale.Identity), + DBs: DefaultDBsConfig(cachescale.Identity.U64, 512), }) defer closeDBs() defer store.Close() diff --git a/integration/metric_test.go b/integration/metric_test.go index a8f849d..f200e3e 100644 --- a/integration/metric_test.go +++ b/integration/metric_test.go @@ -10,15 +10,15 @@ func TestGenericNameOfTmpDB(t *testing.T) { require := require.New(t) for name, exp := range map[string]string{ - "": "", - "main": "main", - "main-single": "main-single", - "hashgraph-0": "hashgraph-tmp", - "hashgraph-0999": "hashgraph-tmp", - "gossip-50": "gossip-tmp", - "epoch-1": "epoch-tmp", - "xxx-1a": "xxx-1a", - "123": "123", + "": "", + "main": "main", + "main-single": "main-single", + "helios-0": "helios-tmp", + "helios-0999": "helios-tmp", + "gossip-50": "gossip-tmp", + "epoch-1": "epoch-tmp", + "xxx-1a": "xxx-1a", + "123": "123", } { got := genericNameOfTmpDB(name) require.Equal(exp, got, name) diff --git a/native/client/dag_api.go b/native/client/dag_api.go index 3fe8756..a802591 100644 --- a/native/client/dag_api.go +++ b/native/client/dag_api.go @@ -12,7 +12,7 @@ import ( "github.com/unicornultrafoundation/go-u2u/native" ) -// GetEvent returns Hashgraph event by hash or short ID. +// GetEvent returns Helios event by hash or short ID. func (ec *Client) GetEvent(ctx context.Context, h hash.Event) (e native.EventI, err error) { var raw map[string]interface{} err = ec.c.CallContext(ctx, &raw, "dag_getEvent", h.Hex()) @@ -27,7 +27,7 @@ func (ec *Client) GetEvent(ctx context.Context, h hash.Event) (e native.EventI, return } -// GetEvent returns Hashgraph event by hash or short ID. +// GetEvent returns Helios event by hash or short ID. func (ec *Client) GetEventPayload(ctx context.Context, h hash.Event, inclTx bool) (e native.EventI, txs []common.Hash, err error) { var raw map[string]interface{} err = ec.c.CallContext(ctx, &raw, "dag_getEventPayload", h.Hex(), inclTx) diff --git a/u2u/rules.go b/u2u/rules.go index de86d76..b5c5d7e 100644 --- a/u2u/rules.go +++ b/u2u/rules.go @@ -80,7 +80,7 @@ type EpochsRules struct { MaxEpochDuration native.Timestamp } -// DagRules of Hashgraph DAG (directed acyclic graph). +// DagRules of Helios DAG (directed acyclic graph). type DagRules struct { MaxParents idx.Event MaxFreeParents idx.Event // maximum number of parents with no gas cost