Releases: eoscanada/eos-go
v0.10.2
v0.10.1
v0.10.0
[0.10] (October 16th, 2021)
Breaking Changes
-
BREAKING: We started adding an initial
context.Context
to all interruptible functions. All method performing an HTTP call have the new parameter as well as a bunch of other method. We cannot list all of them. If the caller already have acontext.Context
value, pass it to the function that now require one. Otherwise, simply passcontext.Background()
. -
BREAKING: Fixed binary unpacking of
BlockState
,TransactionTrace
,SignedTransaction
,Action
(and some inner types). This required changing a few struct fields to better fit with EOSIO definition, here the full list:-
MerkleRoot.ActiveNodes
is now a[]Checksum256
, was previously[]string
-
MerkleRoot.NodeCount
is now auint64
, was previouslyuint32
-
Type
EOSNameOrUint32
has been removed and replaced byPairAccountNameBlockNum
which is strictly typed now. -
BlockState.ProducerToLastProduced
is now[]PairAccountNameBlockNum
, was previously[][2]EOSNameOrUint32
. -
BlockState.ProducerToLastImpliedIRB
is now[]PairAccountNameBlockNum
, was previously[][2]EOSNameOrUint32
. -
BlockState.BlockID
is now aChecksum256
, was previouslystring
. -
BlockState.ActivatedProtocolFeatures
is now a*ProtocolFeatureActivationSet
, was previouslymap[string][]HexBytes
. -
BlockState.ConfirmCount
is now a[]uint8
, was previously[]uint32
. -
PendingSchedule.ScheduleHash
is now aChecksum256
, was previouslyHexBytes
. -
ActionTraceReceipt.ActionDigest
is now aChecksum256
, was previouslystring
. -
ActionTraceReceipt.CodeSequence
is now aVaruint32
, was previouslyUint64
. -
ActionTraceReceipt.ABISequence
is now aVaruint32
, was previouslyUint64
. -
ActionTrace.ActionOrdinal
is now aVaruint32
, was previouslyuint32
. -
ActionTrace.CreatorActionOrdinal
is now aVaruint32
, was previouslyuint32
. -
ActionTrace.ClosestUnnotifiedAncestorActionOrdinal
is now aVaruint32
, was previouslyuint32
. -
Except.Code
is now aInt64
, was previouslyint
. -
ExceptLogContext.Level
is now aExceptLogLevel
, was previouslystring
. -
ExceptLogContext.Line
is now auint64
, was previouslyint
.Note While those are flagged as breaking change to augment the visibility, they are really bug fixes to fit with the behavior of
nodeos
directly.
-
-
BREAKING: The decoding for ABI
variant
was not returning the correctjson
representation. Now ABIvariant
is returned as a two elements array, the first element being thevariant
type name as astring
and the second the actual value as JSON. For example, assuming avariant
type defined asgame_type: ["string", "uint32"]
, and afield
of typegame_type
, before, the JSON serialization would have looked like{"field":"some_string"}
or{"field":100}
while after the change, it will get serialized to the correct form{"field":["string", "some_string"]}
or{"field":["uint32", 100]}
.Note While this is flagged as breaking change to augment the visibility, this is really a bug fix to fit with the behavior of
nodeos
directly. -
BREAKING: The serialization for
ExtendedAsset
was aligned with theeos
codebase. Beforehand, it would serialize the field name"Contract"
with a capitalC
, and theAsset
field as"asset"
where it should have been"quantity"
. -
BREAKING: Renamed
ConsoleLog
toSafeString
for better re-usability in the codebase.
Added
- Proper handling for float precision in binary encoding/decoding.
- Added SHiP binary structures
- Added capabilities to read EOSIO Snapshot format (early implementation)
- Added architecture to support binary decoding/encoding Variant objects, see []
- Greatly improved performance of
NameToString
(~230%
) method. TimePoint
will decode with0
nanoseconds, when thefitNodeos
flag is set on the ABI.- Ability to decode a
int128
anduint128
in decimal format whenfitNodeos
flag is set on the ABI - Ability to decode nested
arrays
in ABI decoder. - Added
BlockState.Header
field of typeSignedBlockHeader
that was previously missing from the struct definition. - Added
BlockState.AdditionalSignatures
field of type[]ecc.Signature
that was previously missing from the struct definition. - Added
ActionTrace.ContextFree
field of typebool
that was previously missing from the struct definition. - Normalized all logging to use
streamingfast/logging
and its trace enabled support.
Changed
- All errors are wrapped using
fmt.Errorf("...: %w", ..., err)
which is standard now in Go.
Fixed
-
Optional encoding of primitive types.
A struct with a non-pointer type tagged with
eos:"optional"
is now properly encoded at the binary level. Important that means that for non-pointer type, when the value of the type is the "emtpy" value according to Golang rules, it will be written as not-present at the binary level. If it's something that you do want want, use a pointer to a primitive type. It's actually a good habit to use a pointer type for "optional" element anyway, to increase awarness. -
Fix json tags for delegatebw action data.
-
Unpacking binary
Except
now correctly works. -
Unpacking binary
Action
andActionTrace
now correctly works. -
Unpacking binary
TransactionTrace
now correctly works. -
Unpacking binary
TransactionReceipt
type will now correctly set the innerTransactionWithID.ID
field correctly. -
Unpacking binary
BlockState
now correctly works but is restricted to EOSIO 2.0.x version.
Deprecated
- Renamed
AccountRAMDelta
toAccountDelta
which is the correct name in EOSIO. - Renamed
JSONFloat64
toFloat64
, to follow the same convention that was changed years ago withUint64
, etc. Type alias left for backwards compatibility.
Detailed Changes
- 772b30b Added GitHub workflow
- 7cd7a57 Added SHIP structures, fixup of BaseVariant.
- a9d5402 Added
String()
method toTimePoint
andTimePointSec
- 4a80cd6 Added back support for golang 1.10
- 2b67efe Added helper method in system setcode
- 21f9a14 Added helpers in ABI type to
EncodeTable
andEncode
(any valid struct) - 1d323b9 Added init system func
- d07c6e0 Added int128 decimal support
- c16a0d3 Added method to append directly a private key to a KeyBag
- 562f9de Added more snapshot test
- 57f0eec Added multiple tests for block state
- 0a51422 Added possibility to override all key prefix
- 2c1feaa Added producer protocol feature support
- c61b3e5 Added release instructions
- 63c34d3 Added section handler error
- c69d7ea Added section name constants
- a9ca5dd Added snapshot tests
- e096816 Added some new section handler for Ultra
- 6d94af7 Added stringer support for eos type
- 746769b Added support for
get_accounts_by_authorizers
. - bf09fb1 Added support for
map<string, string>
action types - 15b8a30 Added system helper to activate protocol feature
- 47b8be1 Adding more context
- e3c3192 All errors are wrapped using
fmt.Errorf("...: %w", ..., err)
which is standard now in Go - 0daef5a All sections supported!
- 9ed9d7d All sections supported!
- 97d6c10 Allow to set
expected_core_symbol
when calling/v1/chain/get_account
RPC call viaclient.GetAccount
- ef30f40 BREAKING CHANGE: all API calls now require a
context.Context
as a first parameter, to allow for cancellation to propagate to long calls (or stalling calls on nodes that are overloaded). - c138ebf Bump github.com/tidwall/gjson from 1.3.2 to 1.6.5
- 16e0fe3 Deprecated
AccountRAMDelta
which is not the right name used in EOSIO - 850eeb8 First draft for blocks logs handling.
- 843f081 First draft of snapshot reading.
- c0dd979 Fix Variant decoding, added a few more tests
- 4255016 Fix system init action
- edcf181 Fix time_point format for fit nodeos
- 5e090ae Fix timepoint formatting to fit nodeos
- f68c757 Fix token issue action permission
- fef658a Fixed BaseVariant JSON support
- f6651dd Fixed JSON decoding of PairAccountNameBlockNum
- 85d059b Fixed
BlockState
ConfirmedCount
not of the right type, should have been a[]uint8
- 6ca8107 Fixed bug when precision is
MaxUint8
- 0f5cba4 Fixed decoding or array at the fiels and alias level
- 24c0eb7 Fixed encoding of optional primitive types as well as
*Uint64
types - c64178e Fixed fcVariant
ToNative
when encountering aint64
type id - 271bfac Fixed formatting of sub-list
- a6a5bd6 Fixed tests with TimePointSec
- 6e32ae2 Fixed unit tests for P2P
- 50a7dfd GetTableByScopeResp.more is string now.
- a7047d5 Greatly improved efficiency of
NameToString
- bcdc4bb Improve binary unpacking of some core
nodeos
types - 96d4aeb Improved panic error message in MustStringToSymbol
- e9ea3e4 Improvements to Uint128, Int128 & Float128
DecimalString
andMarshalJSON
implementation - 8bfe0e8 Just one left!
- 2505e99 Just one left!
- f48ae43 Merge branch 'develop' into feature/snapshot
- a729145 Merge branch 'develop' of github.com:eoscanada/eos-go into develop
- 1b19518 Merge branch 'feature/more-context'
- 5548ad4 Merge pull request #135 from zhaoyilun/master
- 0a84410 Merge pull request #138 from crazybits/master
- d58292a Merge pull request #154 from keisuke-kanao/fix-serialization-of-TimePointSec
- 0940450 Merge pull request #159 from eoscanada/dependabot/go_modules/github.com/tidwall/gjson-1.6.5
- cce276e Merge remote-tracking branch 'origin/feature/snapshot' into develop
- 6c90f08 Normalized logging behavior of library
- 9473dee Now support a bunch of other snapshot sections. Better support for the different index types in contract tables.
- 55261c7 Now support a bunch of other snapshot sections. Better support for the different index types in contract tables.
- 12388aa Prepare for 0.10 release
- fbb4f58 Quick internal rename
- 48d4609 Read account objects w/ ABI, read block st...
EOSIO 2.0
This release add support for ESIO 2.0 features, mainly WebAuthN keys support (no signing though) and WTMSIG_BLOCK_SIGNATURES
protocol feature that brings incompatibilities in the model layer when activated.
The v0.9.0 release add supports for that. We had to break compatibility of the type and field names in some base model present in the library. This was the occasion to make other "small" removal of some types that are not required anymore with the some small API changes of the EOSIO binary format decoder. Expect more structural changes to come in this area.
We renamed all fields that require logic changes from your code so you know quickly due to compilation errors that you need to handle some fields differently now.
Some fields were renamed and deprecated also, see Deprecation Notices section for further details.
WebAuthN Keys
The ecc
package has been upgraded to support WebAuthN key in EOSIO model. This supports add the following things:
- A new
CurveID
of typeWA
- Support for
PUB_WA_
keys from EOSIO - Support for
SIG_WA_
keys from EOSIO - Reconstruction of
PUB_WA_
format toecdsa.PublicKey
(recovery ofY
curve point from compressedPUB_WA_
public key form). - Verification of payload signature signed with with WA key (this is untested yet, but code is present).
WTMSIG_BLOCK_SIGNATURES Models
We now support all the models updates required for WTMSIG_BLOCK_SIGNATURES
protocol.
Breaking Changes
WTMSIG_BLOCK_SIGNATURES changes
The WTMSIG_BLOCK_SIGNATURES
enable block to be signed by more than a single key. When this protocol feature is activated, the block can be signed by multiple key, using a key with some weights and a threshold to reach, must like standard EOS permission.
This means that once activated, models for block signing and schedule are now different to support the new feature.
Here the list of changes that occurred, usually, more explanation can be found in the eos-go#p2ptypes.go file directly.
BlockSigningKey
in BlockState
has been renamed to BlockSigningKeyV1
and now a *ecc.PublicKey
This field can now be nil
, which is the case after WTMSIG_BLOCK_SIGNATURES
activation.
blockState.BlockSigningKey
now
if blockState.BlockSigningKeyV1 != nil {
// Deal with EOSIO 1.x model
...
}
ValidBlockSigningAuthorityV2
has been added to BlockState
This replaces old BlockSigningKey
and is of type BlockSigningAuthority
.
ActiveSchedule
in BlockState
is now of type *ProducerScheduleOrAuthoritySchedule
This new type contains both a V1
field (of type ProducerSchedule
) and a V2
field (of type ProducerAuthoritySchedule
). Old code that rely on ActiveSchedule
now must deal with either ActiveSchedule.V1
(old format) or ActiveSchedule.V2
(new format)
Important There is an ambiguity when deciding about the type the field active_schedule
can take since structure can be identical: {version:0, producers:[]}
and {version:0,producers:[]}
. This means both V1
and V2
field can be present at the same time. This is not a problem when serializing back to JSON since they represent the same JSON, but something you must be aware when doing your conditions around this new type as V1 != nil && V2 != nil == true
in some circumstances. The value could be discriminated by checking if ActivatedProtocolFeatures
contains the correct feature, it's something we suggest implementer to do in their own code for now, but it's in discussion for a direct usage in eos-go library.
blockState.ActiveSchedule
now
if blockState.ActiveSchedule.V1 != nil {
// Old format model or indistinguishable from `ProducerAuthoritySchedule`
}
if blockState.ActivateSchedule.V2 != nil {
// New format model or indistinguishable from `ProducerAuthoritySchedule`
}
PendingSchedule.Schedule
is now of type *ProducerScheduleOrAuthoritySchedule
Same logic as ActiveProducer
changes above, but apply to the PendingSchedule
type.
BlockHeader
NewProducers
has been renamed NewProducersV1
.
EOSIO 2.x does not have this field and has been replaced by a block header extension. Also, we changed how EOSIO binary optional value are handled throughout the library and removed the OptionalProducerSchedule
type, you now have a direct ProducerSchedule
field instead.
When the WTMSIG_BLOCK_SIGNATURES
will be activated, this field will never be populated anymore and must not be used anymore.
The new producers should now be extracted from the BlockHeader.HeaderExtensions
field. The library added supported for some know EOSIO BlockHeaderExtension
.
A block header extension contains a payload, when the producer_schedule_change_extension
block header extension is present, it means we are dealing with a new set of producers, as such, replacing the old BlockHeader.NewProducers
field.
if blockHeader.NewProducers != nil {
}
now
if blockHeader.NewProducersV1 != nil {
// Old format
}
OR
for _, e := range blockHeader.HeaderExtensions {
if e.Type == uint16(eos.EOS_ProducerScheduleChangeExtension) {
extension, err := e.AsBlockHeaderExtension("EOS")
if err != nil { ... }
// New format
scheduleChange := extension.(*eos.ProducerScheduleChangeExtension)
scheduleChange.Version
scheduleChange.Producers
}
}
Removal of GoAwayCrazy
enum for GoAwayReason
type
This field was not defined in EOSIO software, as such, it was removed. If you were relying on this field to be set, you will need to adapt your code to use another one.
Deprecation Notices
Those field were renamed to be in sync with other Golang fields. You should simply use the new field name. Those will be removed in a next major bump.
- Renamed
eos.TypeSize.UInt8
toeos.TypeSize.Uint8
- Renamed
eos.TypeSize.UInt16
toeos.TypeSize.Uint16
- Renamed
eos.TypeSize.UInt32
toeos.TypeSize.Uint32
- Renamed
eos.TypeSize.UInt64
toeos.TypeSize.Uint64
- Renamed
eos.TypeSize.UInt128
toeos.TypeSize.Uint128
- Renamed
eos.Decoder.ReadUInt8
toeos.Decoder.ReadUint8
Names, ABI Decoding, Errors, Tooling & Bug Fixes
support trx compression as int
fix incompatibility with eos-js
Updated global_sequence and recv_sequence (and friends) to `Uint64`, …
v0.8.5 Updated global_sequence and recv_sequence (and friends) to `Uint64`, …
Using eosio.forum official contract name
v0.8.2 Changed default forum contract
2019-01-08 Release
Added support for following nodeos
RPC calls
get_table_by_scope
get_raw_abi
get_currency_stats
Other changes
- Added
Blob
type support - Small error logging changes
First tagged version for go.mod
v0.8.0 unfix the fix -> the condition prevent the error message from nodes t…