Giter Site home page Giter Site logo

Comments (20)

leejames00 avatar leejames00 commented on June 2, 2024 2

So do you mean checking the VotingBox, WaitingBox, and ReservedBox every 2 minutes? I think it's a good idea since the the VotingResult does not have to expire in "exactly" 2 minutes. A drawback could be a votingResult waiting for 3min59s before expiring to next box

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024 2
  1. save current state(snapshot) and check validity(uniqueness of hash in boxes)
  2. after 2 min, compare to previous snapshot and find target to move the other box
  3. Repeat above

In the worst case, some ballot may take 4 min to move WaitingBox to ReservedBox. But this is not that big a deal.

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024 1

If time is recorded, you have to check how long does it take periodically.
I figure, using time.ticker is better.

from sebak.

leejames00 avatar leejames00 commented on June 2, 2024 1

Aha I agree. I was thinking about other ways too

from sebak.

leejames00 avatar leejames00 commented on June 2, 2024

Why are the Message.Hashes sorted in BallotBox? Will it be replaced by a combining function?

Hashes sort.StringSlice // `Message.Hash`es

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

@leejames00 Would you please let me know in detail about combining function?

from sebak.

leejames00 avatar leejames00 commented on June 2, 2024

I was confused on why the Message.Hashes need to be sorted.
Because in SCP, the transaction sets are merged (by a combining function) into one message(or hash)... so if a combining function is implemented, there would be no need for sorting

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

Aha, there is no combining function in sebak yet. All transactions are handled as they are.

from sebak.

leejames00 avatar leejames00 commented on June 2, 2024

and also I was thinking about timeouts to VotingResult -- if the VotingResult should be moved from VotingBox to ReservedBox after 2minutes, I think the message hash should be mapped with time

for example,

type BallotBox struct {
	sebakcommon.SafeLock

	Hashes map[hash]time.Time
}

or if there are other suggestions on implementing timeouts please comment :)

from sebak.

sconeman avatar sconeman commented on June 2, 2024

@leejames00 I don't think I need to record time. After the message is moved to the ReservedBox, we don't have to check the time data in the message.

from sebak.

leejames00 avatar leejames00 commented on June 2, 2024

@astonshnam but after 2 minutes in VotingBox, it should be moved to ReservedBox. How do you check that the VotingResult is expired?

from sebak.

sconeman avatar sconeman commented on June 2, 2024

@leejames00 However, a time check is only needed within the VotingBox. It is unnecessary to change the structure of the BallotBox because of the process in the VotingBox. I want to think about other ways.

from sebak.

sconeman avatar sconeman commented on June 2, 2024

What do you think about changing BallotBox to interface type?

from sebak.

sconeman avatar sconeman commented on June 2, 2024

Node is also an interface type. As follows..

type Node interface {
	Address() string
	Keypair() *keypair.Full
	SetKeypair(*keypair.Full)
	Alias() string
	SetAlias(string)
	Endpoint() *Endpoint
	Equal(Node) bool
	DeepEqual(Node) bool
	GetValidators() map[string]*Validator
	AddValidators(validators ...*Validator) error
	HasValidators(string) bool
	RemoveValidators(validators ...*Validator) error
	Serialize() ([]byte, error)
}

from sebak.

sconeman avatar sconeman commented on June 2, 2024

no. It does not seem to be a good way. Using the interface does not solve this problem. :(

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

I figure, we need the independent struct BoxManager or ResultManager
This struct can handle Results and Boxes validation, move hashes each other, etc...
We can discuss about it tomorrow in detail :)

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

I have an idea. I figure, if ticker is attached every ballot, then it is not that good for performance. So, It is better to check every 2 minute by saving snapshot. @astonshnam @leejames00

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

@leejames00 You fully understand my word :)

from sebak.

anarcher avatar anarcher commented on June 2, 2024

Maybe I don't understand this issue, Is it(gist) right?
gist: https://gist.github.com/anarcher/b8e895f9793b87c1012f101f1bea6af7

from sebak.

Charleslee522 avatar Charleslee522 commented on June 2, 2024

@anarcher @astonshnam
I figure it is better to talk about this issue ASAP. Cause we did duplicated works :)

fyi @spikeekips

from sebak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.