Skip to content

Tech: Atomic Transaction #1309

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

Open
astaphobia opened this issue Oct 22, 2020 · 0 comments · May be fixed by #1304
Open

Tech: Atomic Transaction #1309

astaphobia opened this issue Oct 22, 2020 · 0 comments · May be fixed by #1304

Comments

@astaphobia
Copy link
Contributor

Description

Create new transaction type called Atomic. Inside Atomic transaction can includes multiple different transactions with different senders as well, and those could validate on the fly.
Don't miss add in Rollback and Snapshot also.

The Atomic transaction body:

// UnsignedTransactionBytes is collection of unsigned transaction bytes
UnsignedTransactionBytes [][]byte 
// Signatures is <addressHex, Signature>
Signatures           map[string][]byte

And when parsed to single bytes collection should like:

buff.Write(util.ConvertUint32ToBytes(uint32(len(tx.Body.GetUnsignedTransactionBytes())))) // total unsigned inner transactions
for _, unsignedTX := range tx.Body.GetUnsignedTransactionBytes() {
	buff.Write(util.ConvertUint32ToBytes(uint32(len(unsignedTX))))
	buff.Write(unsignedTX)
}
buff.Write(util.ConvertUint32ToBytes(uint32(len(tx.Body.GetSignatures())))) // total signatures
for addressHex, signature := range tx.Body.GetSignatures() {
	var addressBytes []byte
	addressBytes, err = hex.DecodeString(addressHex)
	if err != nil {
		return bodyBytes, err
	}
	buff.Write(addressBytes)
	buff.Write(signature)
}

Breakdown

  • Atomic transaction type
  • Add table atomic_transaction and also the schema
  • Rollback
  • Snapshot integration
@astaphobia astaphobia self-assigned this Oct 22, 2020
@abiman7u abiman7u added this to the V.0.0.2.W.02 milestone Nov 12, 2020
@astaphobia astaphobia linked a pull request Nov 25, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants