elucidsoft / dotnet-stellar-sdk

Stellar API SDK for .NET 6.x
Apache License 2.0
117 stars 54 forks source link

Exception during loading effects for the ledger: {"Unknown 'type_i'='26'"} #313

Closed OttoVT closed 3 years ago

OttoVT commented 3 years ago

Describe the bug Exception during loading effects for the ledger 384048: {"Unknown 'type_i'='26'"}

https://laboratory.stellar.org/#explorer?resource=effects&endpoint=for_ledger&values=eyJsZWRnZXIiOiIzODIzNDkifQ%3D%3D&network=test

To Reproduce Steps to reproduce the behavior:

var server = new Server("https://horizon-testnet.stellar.org");

//Exception is thrown here!
var page = await _server.Effects.ForLedger(384048)
                .Limit(100)
                .Execute();

Expected behavior There should be no exception!

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

$exception | {"Unknown 'type_i'='26'"} | Newtonsoft.Json.JsonSerializationException

Stack Trace: at stellar_dotnet_sdk.responses.EffectDeserializer.CreateResponse(Int32 type) at stellar_dotnet_sdk.responses.EffectDeserializer.ReadJson(JsonReader reader, Type objectType, EffectResponse existingValue, Boolean hasExistingValue, JsonSerializer serializer) at Newtonsoft.Json.JsonConverter1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters) at stellar_dotnet_sdk.responses.JsonSingleton.GetInstance[T](String content) at stellar_dotnet_sdk.requests.ResponseHandler1.d0.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at stellar_dotnet_sdk.requests.RequestBuilder1.d71.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at stellar_dotnet_sdk.requests.RequestBuilderExecutePageable2.<Execute>d__1.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()

Kirbyrawr commented 3 years ago

Hi, will check it soon!

Kirbyrawr commented 3 years ago

Hi, type_id 26 is a new effect response in protocol 16, i don't see where that 26 is coming from since in the JSON data you shared (the url) it doesn't appear.

Kirbyrawr commented 3 years ago

What branch are you using, master?

OttoVT commented 3 years ago

"stellar-dotnet-sdk" Version="7.0.12"

OttoVT commented 3 years ago

You may find type 26 in 384048 now -_-

Kirbyrawr commented 3 years ago

We have an ongoing PR #312 that fix this problem

KonstantinRyazantsev commented 3 years ago

@Kirbyrawr is there any estimation on when this fix will be released? Is it possible to support new protocol features in advance, before the mainnet is upgraded?

We use dotnet-stellar-sdk lib in our production services and issues like this affect us significantly.

Can we help to avoid this somehow?

Kirbyrawr commented 3 years ago

You are correct, @elucidsoft and @fracek can tell you more about this.

Usually Stellar Foundation tell us to update our SDK's before it goes to mainnet, there was some issues with validators and that protocol update didn't include this changes, but right now the PR is done we only need to merge it and of course it must be done before its in mainnet.

elucidsoft commented 3 years ago

We have just released v7.1.0 which should fix this issue.

OttoVT commented 3 years ago

thx