From 82c7213b67ff77ed33a7f655f2f77393d656496c Mon Sep 17 00:00:00 2001 From: Benjamin Bollen <ben@monax.io> Date: Sat, 11 Feb 2017 23:28:22 +0100 Subject: [PATCH] manager/eris-mint: clean up comments in relation to internal time --- manager/eris-mint/eris-mint.go | 10 +++++----- manager/eris-mint/state/state.go | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manager/eris-mint/eris-mint.go b/manager/eris-mint/eris-mint.go index 29050723..85c3165b 100644 --- a/manager/eris-mint/eris-mint.go +++ b/manager/eris-mint/eris-mint.go @@ -168,13 +168,13 @@ func (app *ErisMint) Commit() (res tmsp.Result) { // flush events to listeners (XXX: note issue with blocking) app.evc.Flush() - // MARMOT: - // set internal time as two seconds per block + // TODO: [ben] over the tendermint 0.6 TMSP interface we have + // no access to the block header implemented; + // On Tendermint v0.8 load the blockheader into the application + // state and remove the fixed 2-"seconds" per block internal clock. + // NOTE: set internal time as two seconds per block app.state.LastBlockTime = app.state.LastBlockTime.Add(time.Duration(2) * time.Second) - fmt.Printf("\n\nMARMOT TIME: %s\n\n", app.state.LastBlockTime) - // MARMOT: appHash := app.state.Hash() - fmt.Printf("\n\nMARMOT COMMIT: %X\n\n", appHash) // return tmsp.NewResultOK(app.state.Hash(), "Success") return tmsp.NewResultOK(appHash, "Success") } diff --git a/manager/eris-mint/state/state.go b/manager/eris-mint/state/state.go index a9dd607f..2960cc56 100644 --- a/manager/eris-mint/state/state.go +++ b/manager/eris-mint/state/state.go @@ -416,10 +416,12 @@ func MakeGenesisState(db dbm.DB, genDoc *genesis.GenesisDoc) *State { } if genDoc.GenesisTime.IsZero() { - // MARMOT: really? - // set time to 11/18/2016 @ 4:09am (UTC) + // NOTE: [ben] change GenesisTime to requirement on v0.17 + // GenesisTime needs to be deterministic across the chain + // and should be required in the genesis file; + // the requirement is not yet enforced when lacking set + // time to 11/18/2016 @ 4:09am (UTC) genDoc.GenesisTime = time.Unix(1479442162, 0) - // genDoc.GenesisTime = time.Now() } // Make accounts state tree -- GitLab