text:
Automatically ignore null keyword usage within getDerivedStateFromProps method

Bug Report

tslint-react version: 4.0.0
tslint version: 5.17.0
typescript version: 3.5.1
Running TSLint via: CLI

TypeScript code being linted
public static getDerivedStateFromProps(nextProps: Props): Partial<State> | null {
    if(some conditions) {
        return {
            // some state values
        };
    } else {
        return null; // <--- I got tslint error here
    }
  }

with tslint.json configuration:
{
    "extends": ["tslint-react"],
    "rules": {
        "adjacent-overload-signatures": true,
        "align": [true, "parameters", "arguments", "statements"],
        "arrow-return-shorthand": true,
        "await-promise": true,
        "ban": false,
        "ban-comma-operator": true,
        "class-name": true,
        "comment-format": [true, "check-space"],
        "curly": true,
        "deprecation": true,
        "encoding": true,
        "eofline": true,
        "forin": true,
        "import-spacing": true,
        "indent": [true, "spaces"],
        "interface-name": [true, "never-prefix"],
        "interface-over-type-literal": true,
        "jsdoc-format": true,
        "jsx-no-lambda": false,
        "jsx-no-multiline-js": false,
        "label-position": true,
        "linebreak-style": [true, "LF"],
        "max-line-length": [true, 120],
        "member-access": true,
        "member-ordering": [
            true,
            "public-before-protected",
            "protected-before-private",
            "static-before-instance",
            "variables-before-functions"
        ],
        "new-parens": true,
        "no-any": true,
        "no-arg": true,
        "no-bitwise": true,
        "no-boolean-literal-compare": true,
        "no-conditional-assignment": true,
        "no-console": [true, "log", "error", "debug", "info", "time", "timeEnd", "trace"],
        "no-consecutive-blank-lines": true,
        "no-construct": true,
        "no-debugger": true,
        "no-duplicate-imports": true,
        "no-duplicate-super": true,
        "no-duplicate-switch-case": true,
        "no-duplicate-variable": true,
        "no-empty": true,
        "no-eval": true,
        "no-floating-promises": true,
        "no-for-in-array": true,
        "no-implicit-dependencies": [true, "dev"],
        "no-invalid-template-strings": true,
        "no-invalid-this": true,
        "no-irregular-whitespace": true,
        "no-mergeable-namespace": true,
        "no-misused-new": true,
        "no-null-keyword": true,
        "no-object-literal-type-assertion": true,
        "no-parameter-reassignment": true,
        "no-reference": true,
        "no-return-await": true,
        "no-shadowed-variable": true,
        "no-sparse-arrays": true,
        "no-string-literal": true,
        "no-switch-case-fall-through": true,
        "no-string-throw": true,
        "no-trailing-whitespace": true,
        "no-unnecessary-callback-wrapper": true,
        "no-unnecessary-class": true,
        "no-unnecessary-initializer": true,
        "no-unnecessary-qualifier": true,
        "no-unsafe-finally": true,
        "no-unused-expression": true,
        "no-var-keyword": true,
        "number-literal-format": true,
        "object-literal-key-quotes": [true, "as-needed"],
        "one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace", "check-whitespace"],
        "prefer-const": true,
        "prefer-for-of": true,
        "prefer-method-signature": true,
        "prefer-object-spread": true,
        "prefer-switch": [true, {"min-cases": 3}],
        "prefer-template": [true, "allow-single-concat"],
        "promise-function-async": true,
        "quotemark": [true, "single", "jsx-double"],
        "radix": true,
        "restrict-plus-operands": true,
        "return-undefined": true,
        "semicolon": [true, "always", "strict-bound-class-methods"],
        "space-before-function-paren": [true, "never"],
        "space-within-parens": false,
        "strict-type-predicates": true,
        "switch-default": true,
        "trailing-comma": [true, {"multiline": "always", "singleline": "never"}],
        "triple-equals": true,
        "typedef": [true, "parameter", "property-declaration"],
        "typedef-whitespace": [
            true,
            {
                "call-signature": "nospace",
                "index-signature": "nospace",
                "parameter": "nospace",
                "property-declaration": "nospace",
                "variable-declaration": "nospace"
            }
        ],
        "use-isnan": true,
        "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
        "whitespace": [
            true,
            "check-branch",
            "check-decl",
            "check-module",
            "check-operator",
            "check-separator",
            "check-rest-spread",
            "check-type",
            "check-typecast",
            "check-type-operator",
            "check-preblock"
        ]
    }
}

Actual behavior
I got an error with the message use undefined instead of null in return null statement of getDerivedStateFromProps.
Expected behavior
According to react documentation getDerivedStateFromProps must return null when there is no actual state change.
I completely understand we must use undefined instead of null in any elsewhere and I know I can ignore the error in that line, but I want to ask to add a feature that tslint-react ignore automatically such special case.

Which rule is reporting that error? You can find out using the verbose or stylish formatter.

I'm currently traveling right now and can't test. I provide all resources to reproduce the error, can you test it yourself, please?
Only a guess, it's probably produced by "no-null-keyword": true

Ok, yeah, it's the no-null-keyword rule. I think this is part of a broader discussion of null restrictions here https://github.com/palantir/tslint/issues/2798
This rule is fairly extreme and probably not suited for general use until we can sort out a good way to deal with the problems described in the linked issue. Closing as a duplicate for now

authors: SaeedZhiany adidahiya


text:
Invalid filenames in repo

This repo contains some files that have < or > symbols in the filenames:
https://github.com/palantir/tslint/tree/6d6a90154e/test/rules/quotemark/backtick
These are valid filenames in Unix, but not in Windows (and possibly some other operating systems as well).
Could someone rename them?

C:\Code\tslint (master -> origin) (tslint@5.15.0)
λ git pull upstream master
remote: Enumerating objects: 90, done.
remote: Counting objects: 100% (90/90), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 122 (delta 84), reused 90 (delta 84), pack-reused 32R
Receiving objects: 100% (122/122), 67.08 KiB | 5.16 MiB/s, done.
Resolving deltas: 100% (85/85), completed with 34 local objects.
From https://github.com/palantir/tslint
 * branch              master     -> FETCH_HEAD
   703acaf6..59f89421  master     -> upstream/master
error: unable to create file test/rules/quotemark/backtick/test<2.7.1.ts.fix: Invalid argument
error: unable to create file test/rules/quotemark/backtick/test<2.7.1.ts.lint: Invalid argument
error: unable to create file test/rules/quotemark/backtick/test>=2.7.1.ts.fix: Invalid argument
error: unable to create file test/rules/quotemark/backtick/test>=2.7.1.ts.lint: Invalid argument
Updating 703acaf6..59f89421

source: gharchive/issue

authors: JoshuaKGoldberg mjomble

repo: palantir/tslint

license_type: permissive

license_source: github-api


text:
dataset module

Summary - tl;dr
I'm currently using a tiny and trivial dataset module and I am wondering if it is worth sharing (tiny size but limited benefits). I can prepare a PR with tests if there is any interest and/or recommendations.
Background
Because the node.dataset property is read-only, using {props: {dataset: {foo: 'foo'}}} does not work. The attributes module can be used but wrapping the attribute names get a little tedious: {attrs: {'data-foo': foo}}. The little module below allows for a new dataset item in the data object so that we can write: {dataset: {foo: 'foo'}}.
function updateDataset(oldVnode, vnode) {
  var key
  var elm = vnode.elm
  var oldDataset = oldVnode.data.dataset || {}
  var dataset = vnode.data.dataset || {}

  for (key in oldDataset) if (!dataset[key]) delete elm.dataset[key]
  for (key in dataset) if (oldDataset[key] !== dataset[key]) elm.dataset[key] = dataset[key]
}
module.exports = {create: updateDataset, update: updateDataset}

Use Case
Works nicely for event handlers where we can update a data-action parameter instead of recreating a function specific to every elements. In my case, I use it to store the origin JSONPointer in data-path so that the event handler can produce a JSONPatch. Example:
function commonHandler(e) {  //same handler declared once for all element on every render
  store.patch([{
    op: 'replace',
    path: e.target.dataset.path,
    value: e.target.value  // ommitting additional formatting and validation
  }])
}
vtree = h('input', {
  props: {
    value: store.get().foo.bar.baz,
    oninput: commonHandler
  },
  dataset: {path: '/foo/bar/baz'} //same outcome as attrs:{'data-path': '/foo/bar/baz'}
})

Both {attrs: {'data-foo': foo}} and {dataset: {foo: 'foo'}} modify the underlying HTML so I am not sure if it is not be better to simply use some random custom property instead: {props: {datasetfoo: 'foo'}}.
Feedback/suggestions welcome

I definitely think this is a useful addition to the currently offered modules. I have been using attrs: {'data-x': 1}  as well and it's not the best. In the name of performance only, which many doesn't matter all that much considering most people probably don't have more than a few dataset attributes to set, I've modified your code just a smidge to use regular for-loops + Object.keys() which is significantly faster in v8 - source for that claim is here
function updateDataset(oldVnode, vNode) {
  var elm = vNode.elm
  var oldDataset = oldVNode.data.dataset || {}
  var dataset = vNode.data.dataset || {}

  var oldKeys = Object.keys(oldDataSet)
  var keys = Object.keys(dataset)

  for (var i = 0; i < oldKeys.length; ++i) {
    if (!dataset[oldKeys[i]]) {
     delete elm.dataset[key]
    }
  }

  for(var i =0; i < keys.length; ++i) {
    var key = keys[i]
    oldKeyIndex = oldKeys.findIndex(key)
    if (oldKeyIndex !== -1 && oldDataset[oldKeyIndex] !== dataset[key]) {
      elm.dataset[key] = dataset[key]
    }
  }
}

Thanks for the feedback. I've used for-in to match the structure and style of the other modules. The loop optimization could be a separate PR for all modules.
I also don't understand your intent in the second last line:
if (oldKeyIndex !== -1 && oldDataset[oldKeyIndex] !== dataset[key]) { ...
What is wrong with the former if (oldDataset[key] !== dataset[key]) { ...?

Good catch, I think I may have screwed that up a bit. Basically the oldKeyIndex might return as -1 because it didn't previously exist. It should probably be
if (oldKeyIndex === -1 || oldDataset[oldKeyIndex] !== dataset[key]) {...}

Does that make more sense?

authors: TylorS hville

repo: paldepind/snabbdom

license: mit

license_source: bigquery


text:
Have To Check Data Changes Before Update Document ?

If I have opened two browser windows of same document with flask admin (mongoengine)
window # 1 and window # 2
when I have updated anything in window # 1 and then incorrectly updated window # 2 flask admin will save window # 2 data (not present data)
is this correct ? or flask admin may have check for changes before saving document ?

from flask_admin.contrib.mongoengine import ModelView
from flask import flash, redirect
class UserModelView(ModelView):
def on_model_change(self, form, model, is_created):
if not is_created:
original = self.get_one(model.id)  # Fetch the original model
if original.version != model.version:
flash('This document has been modified by another user. Your changes will not be saved.', 'error')
return redirect(self.get_url('.index_view'))
        model.version += 1  # Increment the version for successful updates

Register your view
admin.add_view(UserModelView(User))

repo: pallets-eco/flask-admin


text:
reflect specific table from specific database

Unable to only reflect a single table that I want to use with flask-sqlalchemy, there should be an option like db.reflect(bind='db2',only=['table1']) to only reflect a table from specific db.

Fixed in #1087. There is now a separate metadata per bind. You can call db.metadatas["db2"].reflect(only=["table1"]).

authors: davidism pechavarriaa

repo: pallets-eco/flask-sqlalchemy


text:
Error: Failed to find application in module "flaskr".  Are you sure it contains a Flask application?  Maybe you wrapped it in a WSGI middleware or you are using a factory function.

click (6.7)
Flask (0.12.2)
flaskr (1.0.0, f:\python-flask\flask\examples\tutorial)
itsdangerous (0.24)
Jinja2 (2.10)
MarkupSafe (1.0)
pip (9.0.1)
setuptools (28.8.0)
Werkzeug (0.14.1)
(venv) PS F:\python-flask\flask\examples\tutorial> flask run
Usage: flask run [OPTIONS]
Error: Failed to find application in module "flaskr".  Are you sure it contains a Flask application?  Maybe you wrapped
it in a WSGI middleware or you are using a factory function.
(venv) PS F:\python-flask\flask\examples\tutorial>

You didn't install the latest Flask master from GitHub. Duplicate of #2513.

authors: davidism jxsoftyanlinyu

repo: pallets/flask


text:
Pyright Type Errors

We have a number of various Pyright typing errors.
Environment:

Python version: 3.12
Flask version: 3.1.0

Hello @brendon-codes,
Do you want any help to fix it? I can check the errors

fixed in #5620

authors: NelsonSanti brendon-codes davidism


text:
any guides or recommendations for apps with SSR? (due to nodejs not utilising "the platform")

sorry for brevity, but title says it all

I dont think all "platform" hooks will work though, useWindowSize() might have few problems

Correct. If it’s not isomorphic it will not work.

authors: iamstarkov jaredpalmer

repo: palmerhq/the-platform

license: MIT


text:
Box hover states

Allow hover states to be set on Box components

background color
color
cursor
transition timing?

Here's some inspiration
https://twitter.com/antfu7/status/1370173736456835076

Hey @nathanyoung I very much want to go the tailwind route with this one and to that effect I've been researching ways to allow our users to properly purge unused css classes from their bundles. I would say that work precludes this one since without it, adding all the modifier utility classes is non-viable for production releases unfortunately.

Just created one --https://trello.com/c/7LTxtYTS/551-review-purgecss-solutions-to-allow-growth-of-utility-class-system

https://github.com/palmetto/palmetto-components/pull/439

authors: juanfabrega nathanyoung

repo: palmetto/palmetto-components


text:
Cosmos-SDK V0.47.1 Upgrade: Bring Pigeon dependencies to Cosmos-SDK v0.47.1

Background
After successful upgrade of Paloma to Cosmos-SDK v0.47.1, we noticed that pigeon  start was failing with the error:
Apr 12 17:50:52 testnet-1 pigeon[1308114]: {"level":"info","msg":"Starting healthcheck server","time":"2023-04-12T17:50:52Z"}
Apr 12 17:50:52 testnet-1 pigeon[1308114]: panic: Bytes left over in UnmarshalBinaryLengthPrefixed, should read 10 more bytes but have 152
Apr 12 17:50:52 testnet-1 pigeon[1308114]: goroutine 1 [running]:
Apr 12 17:50:52 testnet-1 pigeon[1308114]: github.com/palomachain/pigeon/chain/paloma.getMainAddress({0xc000ccc0b0, {{{0xc000cb8c88, 0x4}, {0xc000cb8d28, 0x6}, {0xc000cb
/usr/local/bin/pigeon version
App version: v0.11.7
Build commit hash: 958ed17722fc2e468716276883a1cc4052ba07ca

For example: https://github.com/palomachain/pigeon/blob/master/chain/paloma/client.go#L25 still refers to tendermint and Paloma is now on CoreBFT. Pigeon healthcheck appears to require tendermint, so we now need to upgrade Pigeon to Cosmos-SDK v0.47.1 as Paloma.
Done when

[ ] Update Pigeon to use Cosmos-SDK v0.47.1 packages
[ ] Test Pigeon https://github.com/palomachain/pigeon  is able to start after upgrade.

Added links to https://github.com/palomachain/pigeon

Need to upgrade cosmos-sdk to v0.47.0 in https://github.com/VolumeFi/lens-1.
Refer to https://github.com/strangelove-ventures/lens/commit/735a2a0195eb0a9c0eb7a0f54813bf9f0b09b433.
This is a dependency in pigeon.

depends on https://github.com/VolumeFi/paloma/issues/115

Fixed with https://github.com/palomachain/pigeon/pull/138. Closing.

authors: 0xmuralik taariq verabehr

repo: palomachain/paloma


text:
chore: fix CONTRIBUTING.md

Related Github tickets

a list of github issues that are relevant for this PR

Background
fix CONTRIBUTING.md
Testing completed

[ ] test coverage exists or has been added/updated
[ ] tested in a private testnet

Breaking changes

[ ] I have checked my code for breaking changes
[ ] If there are breaking changes, there is a supporting migration.

Thanks for the kind changes. The bad grammar keeps everyone on their toes!

source: gharchive/pull-request

authors: lencap taariq


text:
Import is successful is but imported flag not set

http://alpha.pandaproject.net/#dataset/2

Checked logs. No errors with timestamps corresponding to this dataset.

Unable to reproduce. Closing out.

repo: pandaproject/panda


text:
[wip]Exec tachikoma update 20151017193517

:hamster::hamster::hamster:   Strategy david
Powered by David Update as a Service - Tachikoma.io Announcement: 2015-06-28 Updated permissions - Tachikoma.io

change lnfs interface https://github.com/kevva/lnfs/compare/2.0.0...3.0.0

authors: pazjacket sanemat

repo: pandawing/node-run-yo


text:
SLua.LuaSvr:tick crash

Some function not remove temp value() from lua stack. You should fix it.
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
SLua.LuaSvr:tick() (at Assets/Slua/Script/LuaSvr.cs:101)
SLua.LuaSvrGameObject:Update() (at Assets/Slua/Script/LuaSvrGameObject.cs:48)

(Filename: Assets/Slua/Script/LuaSvr.cs Line: 101)

Receiving unhandled NULL exception
Launching bug reporter
Obtained 39 stack frames.
#0  0x000000973ac920 in strlen
#1  0x000000048ea72e in ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi
#2  0x0000002e556574 in  (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:PtrToStringAnsi (intptr) + 0x3c (0x2e556538 0x2e5565b7) [0xf398a80 - Unity Child Domain]
#3  0x0000002e556445 in  LuaInterface.LuaDLL:lua_typenamestr (intptr,LuaInterface.LuaTypes) + 0x4d (0x2e5563f8 0x2e556450) [0xf398a80 - Unity Child Domain]
#4  0x0000002e5563dd in  LuaInterface.LuaDLL:luaL_typename (intptr,int) + 0x3d (0x2e5563a0 0x2e5563e8) [0xf398a80 - Unity Child Domain]
#5  0x00000038be38c5 in  SLua.LuaSvr:tick () + 0xb5 (0x38be3810 0x38be393c) [0xf398a80 - Unity Child Domain]
#6  0x00000038be37f6 in  SLua.LuaSvrGameObject:Update () + 0x3e (0x38be37b8 0x38be380d) [0xf398a80 - Unity Child Domain]
#7  0x00000017b72b4f in  (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0x8f (0x17b72ac0 0x17b72c1a) [0xf398a80 - Unity Child Domain]
#8  0x000000047d5a16 in mono_get_runtime_build_info
#9  0x000000049094b7 in mono_runtime_invoke
#10 0x00000000730b0c in scripting_method_invoke(ScriptingMethodMono, MonoObject*, ScriptingArguments&, MonoException**)
#11 0x0000000097aec1 in ScriptingInvocationNoArgs::Invoke(MonoException**)
#12 0x0000000097ae1e in ScriptingInvocationNoArgs::Invoke()
#13 0x0000000095f5fa in MonoBehaviour::CallMethodIfAvailable(int)
#14 0x00000000959e7a in MonoBehaviour::CallUpdateMethod(int)
#15 0x00000000959ea9 in MonoBehaviour::Update()
#16 0x000000006fdfd0 in void BaseBehaviourManager::CommonUpdate<BehaviourManager>()
#17 0x00000000871367 in PlayerLoop(bool, bool, IHookEvent*)
#18 0x000000014d4c19 in Application::UpdateScene(bool)
#19 0x000000014d11c9 in Application::UpdateSceneIfNeeded()
#20 0x000000014d0209 in Application::TickTimer()
#21 0x000000016c2168 in -[EditorApplication TickTimer]
#22 0x00000099e2c6cf in __NSFireTimer
#23 0x0000009b6ac006 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#24 0x0000009b6abab4 in __CFRunLoopDoTimer
#25 0x0000009b72754f in __CFRunLoopDoTimers
#26 0x0000009b663531 in __CFRunLoopRun
#27 0x0000009b662aa6 in CFRunLoopRunSpecific
#28 0x0000009b66290b in CFRunLoopRunInMode
#29 0x0000009746f8f8 in RunCurrentEventLoopInMode
#30 0x0000009746f631 in ReceiveNextEventCommon
#31 0x0000009746f42c in _BlockUntilNextEventMatchingListInModeWithFilter
#32 0x00000090bd8721 in _DPSNextEvent
#33 0x00000090bd7dc5 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#34 0x00000090bcc77c in -[NSApplication run]
#35 0x00000090b41bc0 in NSApplicationMain
#36 0x000000016d78bb in EditorMain(int, char const**)
#37 0x000000016d7ff8 in main
#38 0x00000000003435 in start

*** Launching bug reporter due to crashbug.
Obtained 44 stack frames.
0   Unity                               0x016ba271 _Z17LaunchBugReporter13BugReportMode + 1073
1   Unity                               0x009654a5 _Z12HandleSignaliP9__siginfoPv + 53
2   libmono.0.dylib                     0x0488981a mono_chain_signal + 76
3   libmono.0.dylib                     0x047d3ae2 mono_sigsegv_signal_handler + 234
4   libsystem_platform.dylib            0x900e503b _sigtramp + 43
5   ???                                 0xffffffff 0x0 + 4294967295
6   libmono.0.dylib                     0x048ea72e ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi + 37
7   ???                                 0x2e556574 0x0 + 777348468
8   ???                                 0x2e556445 0x0 + 777348165
9   ???                                 0x2e5563dd 0x0 + 777348061
10  ???                                 0x38be38c5 0x0 + 951990469
11  ???                                 0x38be37f6 0x0 + 951990262
12  ???                                 0x17b72b4f 0x0 + 397880143
13  libmono.0.dylib                     0x047d5a16 mono_get_runtime_build_info + 3344
14  libmono.0.dylib                     0x049094b7 mono_runtime_invoke + 133
15  Unity                               0x00730b0c _Z23scripting_method_invoke19ScriptingMethodMonoP10MonoObjectR18ScriptingArgumentsPP13MonoException + 60
16  Unity                               0x0097aec1 _ZN25ScriptingInvocationNoArgs6InvokeEPP13MonoException + 145
17  Unity                               0x0097ae1e _ZN25ScriptingInvocationNoArgs6InvokeEv + 30
18  Unity                               0x0095f5fa _ZN13MonoBehaviour21CallMethodIfAvailableEi + 458
19  Unity                               0x00959e7a _ZN13MonoBehaviour16CallUpdateMethodEi + 314
20  Unity                               0x00959ea9 _ZN13MonoBehaviour6UpdateEv + 25
21  Unity                               0x006fdfd0 _ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv + 448
22  Unity                               0x00871367 _Z10PlayerLoopbbP10IHookEvent + 1639
23  Unity                               0x014d4c19 _ZN11Application11UpdateSceneEb + 457
24  Unity                               0x014d11c9 _ZN11Application19UpdateSceneIfNeededEv + 73
25  Unity                               0x014d0209 _ZN11Application9TickTimerEv + 2057
26  Unity                               0x016c2168 -[EditorApplication TickTimer] + 24
27  Foundation                          0x99e2c6cf __NSFireTimer + 119
28  CoreFoundation                      0x9b6ac006 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
29  CoreFoundation                      0x9b6abab4 __CFRunLoopDoTimer + 1316
30  CoreFoundation                      0x9b72754f __CFRunLoopDoTimers + 351
31  CoreFoundation                      0x9b663531 __CFRunLoopRun + 2081
32  CoreFoundation                      0x9b662aa6 CFRunLoopRunSpecific + 390
33  CoreFoundation                      0x9b66290b CFRunLoopRunInMode + 123
34  HIToolbox                           0x9746f8f8 RunCurrentEventLoopInMode + 262
35  HIToolbox                           0x9746f631 ReceiveNextEventCommon + 494
36  HIToolbox                           0x9746f42c _BlockUntilNextEventMatchingListInModeWithFilter + 99
37  AppKit                              0x90bd8721 _DPSNextEvent + 742
38  AppKit                              0x90bd7dc5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 350
39  AppKit                              0x90bcc77c -[NSApplication run] + 907
40  AppKit                              0x90b41bc0 NSApplicationMain + 2082
41  Unity                               0x016d78bb _Z10EditorMainiPPKc + 1339
42  Unity                               0x016d7ff8 main + 24
43  Unity                               0x00003435 start + 53
Material 0: Orc
Texture 0: Map #0
Material 0: Orc
Texture 0: Map #0
Material 0: Armor - Orc
Texture 0: Map #1
Material 0: Orc
Texture 0: Map #0
Material 0: Material #1
Material 1: Material #0
Texture 0: Map #3
Texture 1: Map #2
Material 0: Armor - Orc
Texture 0: Map #1
Material 0: Material #1
Material 1: Material #0
Texture 0: Map #3
Texture 1: Map #2
Stacktrace:

  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi (intptr) <0x00004>
  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi (intptr) <0x00004>
  at LuaInterface.LuaDLL.lua_typenamestr (intptr,LuaInterface.LuaTypes) [0x00008] in /Volumes/client/Assets/Slua/Script/LuaDLL.cs:118
  at LuaInterface.LuaDLL.luaL_typename (intptr,int) [0x00000] in /Volumes/client/Assets/Slua/Script/LuaDLL.cs:122
  at SLua.LuaSvr.tick () [0x00031] in /Volumes/client/Assets/Slua/Script/LuaSvr.cs:101
  at SLua.LuaSvrGameObject.Update () [0x0000b] in /Volumes/client/Assets/Slua/Script/LuaSvrGameObject.cs:48
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0001c, 0x0008e>

Native stacktrace:

    0   libsystem_kernel.dylib              0x95ed269a __pthread_kill + 10
    1   libsystem_c.dylib                   0x97409eee abort + 156
    2   Unity                               0x016ba2c5 _Z17LaunchBugReporter13BugReportMode + 1157
    3   Unity                               0x009654a5 _Z12HandleSignaliP9__siginfoPv + 53
    4   libmono.0.dylib                     0x0488981a mono_chain_signal + 76
    5   libmono.0.dylib                     0x047d3ae2 mono_sigsegv_signal_handler + 234
    6   libsystem_platform.dylib            0x900e503b _sigtramp + 43
    7   ???                                 0xffffffff 0x0 + 4294967295
    8   libmono.0.dylib                     0x048ea72e ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi + 37
    9   ???                                 0x2e556574 0x0 + 777348468
    10  ???                                 0x2e556445 0x0 + 777348165
    11  ???                                 0x2e5563dd 0x0 + 777348061
    12  ???                                 0x38be38c5 0x0 + 951990469
    13  ???                                 0x38be37f6 0x0 + 951990262
    14  ???                                 0x17b72b4f 0x0 + 397880143
    15  libmono.0.dylib                     0x047d5a16 mono_get_runtime_build_info + 3344
    16  libmono.0.dylib                     0x049094b7 mono_runtime_invoke + 133
    17  Unity                               0x00730b0c _Z23scripting_method_invoke19ScriptingMethodMonoP10MonoObjectR18ScriptingArgumentsPP13MonoException + 60
    18  Unity                               0x0097aec1 _ZN25ScriptingInvocationNoArgs6InvokeEPP13MonoException + 145
    19  Unity                               0x0097ae1e _ZN25ScriptingInvocationNoArgs6InvokeEv + 30
    20  Unity                               0x0095f5fa _ZN13MonoBehaviour21CallMethodIfAvailableEi + 458
    21  Unity                               0x00959e7a _ZN13MonoBehaviour16CallUpdateMethodEi + 314
    22  Unity                               0x00959ea9 _ZN13MonoBehaviour6UpdateEv + 25
    23  Unity                               0x006fdfd0 _ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv + 448
    24  Unity                               0x00871367 _Z10PlayerLoopbbP10IHookEvent + 1639
    25  Unity                               0x014d4c19 _ZN11Application11UpdateSceneEb + 457
    26  Unity                               0x014d11c9 _ZN11Application19UpdateSceneIfNeededEv + 73
    27  Unity                               0x014d0209 _ZN11Application9TickTimerEv + 2057
    28  Unity                               0x016c2168 -[EditorApplication TickTimer] + 24
    29  Foundation                          0x99e2c6cf __NSFireTimer + 119
    30  CoreFoundation                      0x9b6ac006 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    31  CoreFoundation                      0x9b6abab4 __CFRunLoopDoTimer + 1316
    32  CoreFoundation                      0x9b72754f __CFRunLoopDoTimers + 351
    33  CoreFoundation                      0x9b663531 __CFRunLoopRun + 2081
    34  CoreFoundation                      0x9b662aa6 CFRunLoopRunSpecific + 390
    35  CoreFoundation                      0x9b66290b CFRunLoopRunInMode + 123
    36  HIToolbox                           0x9746f8f8 RunCurrentEventLoopInMode + 262
    37  HIToolbox                           0x9746f631 ReceiveNextEventCommon + 494
    38  HIToolbox                           0x9746f42c _BlockUntilNextEventMatchingListInModeWithFilter + 99
    39  AppKit                              0x90bd8721 _DPSNextEvent + 742
    40  AppKit                              0x90bd7dc5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 350
    41  AppKit                              0x90bcc77c -[NSApplication run] + 907
    42  AppKit                              0x90b41bc0 NSApplicationMain + 2082
    43  Unity                               0x016d78bb _Z10EditorMainiPPKc + 1339
    44  Unity                               0x016d7ff8 main + 24
    45  Unity                               0x00003435 start + 53

Debug info from gdb:

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Unity(54305,0xa0cba1d4) malloc: *** error for object 0x2a2e3000: Can't deallocate_pages region
Unity(54305,0xa0cba1d4) malloc: *** set a breakpoint in malloc_error_break to debug

I've no idea why revert this change https://github.com/pangweiwei/slua/commit/3f20fc7ed0527c13ed5f344153f6d27f05fde11f will fixed this crash.

By Find references in MonoDevelop, I find the reason.
None public:

public:

ld.call(0, error) in LuaDelegation changes from public object call(object a1,object a2) to bool call(int nArgs, int errfunc)

fixed

authors: pangweiwei yongkangchen

repo: pangweiwei/slua


text:
Actions I've taken before I'm here

[X] I've thoroughly read the documentations on this issue but still have no clue.
[X] I've searched the Github Issues but didn't find any duplicate issues that have been resolved.
[X] I've searched the internet for this issue but didn't find anything helpful.

What happened?
在linux系上，用户初始化gnet时，如果配置了socket相关配置，如：接受缓冲区长度，nodely, 关闭timewait等设置
在accept之后，是否应该对于新的文件描述服也要应用对应设置？
代码如下：
// 用户设置
err := gnet.Serve(gl.sEH, protoAddr, gnet.WithReuseAddr(true), gnet.WithTCPKeepAlive(0),
          gnet.WithTCPNoDelay(gnet.TCPNoDelay), gnet.WithSocketRecvBuffer(gl.socketBufferSize),
          gnet.WithSocketSendBuffer(gl.socketBufferSize),
)

accept 代码
func (svr *server) accept(fd int, _ netpoll.IOEvent) error {
	nfd, sa, err := unix.Accept(fd)
	if err != nil {
		if err == unix.EAGAIN || err == unix.ECONNABORTED {
			return nil
		}
		svr.opts.Logger.Errorf("Accept() fails due to error: %v", err)
		return errors.ErrAcceptSocket
	}
	if err = os.NewSyscallError("fcntl nonblock", unix.SetNonblock(nfd, true)); err != nil {
		return err
	}

	remoteAddr := socket.SockaddrToTCPOrUnixAddr(sa)
	if svr.opts.TCPKeepAlive > 0 && svr.ln.network == "tcp" {
		err = socket.SetKeepAlive(nfd, int(svr.opts.TCPKeepAlive/time.Second))
		logging.Error(err)
	}

	el := svr.lb.next(remoteAddr)
	c := newTCPConn(nfd, el, sa, svr.opts.Codec, el.ln.addr, remoteAddr)

	err = el.poller.UrgentTrigger(el.register, c)
	if err != nil {
		_ = unix.Close(nfd)
		c.releaseTCP()
	}
	return nil
}

Major version of gnet
v1
Specific version of gnet
v1.6.7
Operating system
Linux
Relevant log output
无

Code snippets (optional)
建议是否可以修改为这样，我认为用户的配置应该对于accept到的socket也要生效

func (svr *server) accept(fd int, _ netpoll.IOEvent) error {
	nfd, sa, err := unix.Accept(fd)
	if err != nil {
		if err == unix.EAGAIN || err == unix.ECONNABORTED {
			return nil
		}
		svr.opts.Logger.Errorf("Accept() fails due to error: %v", err)
		return errors.ErrAcceptSocket
	}
	if err = os.NewSyscallError("fcntl nonblock", unix.SetNonblock(nfd, true)); err != nil {
		return err
	}

	remoteAddr := socket.SockaddrToTCPOrUnixAddr(sa)
	if svr.opts.TCPKeepAlive > 0 && svr.ln.network == "tcp" {
		err = socket.SetKeepAlive(nfd, int(svr.opts.TCPKeepAlive/time.Second))
		logging.Error(err)
	}

	// Set RecvBufferSize
	if svr.opts.SocketRecvBuffer > 0 {
		err = socket.SetRecvBuffer(nfd, svr.opts.SocketRecvBuffer)
		logging.Error(err)
	}

	// SetSendBufferSize
	if svr.opts.SocketSendBuffer > 0 {
		err = socket.SetSendBuffer(nfd, svr.opts.SocketRecvBuffer)
		logging.Error(err)
	}

	// Disabling TIME_WAIT state
	l := unix.Linger{
		Onoff:  0,
		Linger: 0,
	}
	err = unix.SetsockoptLinger(nfd, unix.SOL_SOCKET, unix.SO_LINGER, &l)
	if err != nil {
		logging.Error(err)
	}

	el := svr.lb.next(remoteAddr)
	c := newTCPConn(nfd, el, sa, svr.opts.Codec, el.ln.addr, remoteAddr)

	err = el.poller.UrgentTrigger(el.register, c)
	if err != nil {
		_ = unix.Close(nfd)
		c.releaseTCP()
	}
	return nil
}

### How to Reproduce

Steps to reproduce the behavior:
1. Go to '....'
2. Click on '....'
3. Do '....'
4. See '....'

### Does this issue reproduce with the latest release?

It can reproduce with the latest release

根据 TCP 协议标准，通过 accept 返回的新 sockets 会从 listening socket 继承以下 socket options：

SO_DEBUG
SO_DONTROUTE
SO_KEEPALIVE
SO_LINGER
SO_OOBINLINE
SO_RCVBUF
SO_RCVLOWAT
SO_SNDBUF
SO_SNDLOWAT
TCP_MAXSEG
TCP_NODELAY

在 Linux 系统上，accpet 返回的 socket 不会继承 file flags 比如 O_NONBLOCK/O_ASYNC，而 BSD 系统则会连 file flags 也一起继承下来，所以并不需要再次显式设置。


text:
Attrribute methods not running

Posted this one to Slack, but haven't noticed activity there in a few months so reposting into an issue for brevity. Using latest tag 0.7.3, Ruby 2.6.6.
I've been beating my head against an issue all day long that I just can't figure out. I'm looking for some guidance or tips on how to debug this.
Panko is serializing json differently between different containers on both CircleCI and Heroku Production. I have three Serializers, one of them (ContactSerializer) is returning nil instead of the result of the method:
class CommentSerializer < Panko::Serializer
  has_one :user, serializer: UserSerializer, only: %i[id scoped_contact]
end

class UserSerializer < Panko::Serializer
  has_one :scoped_contact,
          serializer: ContactSerializer,
          name: :contact,
          only: %i[id photo_url full_name]
end

class ContactSerializer < Panko::Serializer
  attributes(*Contact.attribute_names.map(&:to_sym))
  attributes(:photo_url, :full_name)

  has_one :user, serializer: UserSerializer

  def photo_url
    ContactDecorator.new(object).photo_or_gravatar_url(88)
  end

  def full_name
    object.full_name
  end
end

In some containers, it is returning {:contact=>{:full_name=>nil, :id=>131, :photo_url=>nil} and in other containers, it returns valid values for full_name and photo_url. On the failing containers, I can comment out has_one :user, serializer: UserSerializer and it works fine, but why would this behavior be different on identical environments?
My best hunch right now is that there is a race condition when my gems are installed with bundle install --jobs=4, possible that Panko native extensions are conflicting with another library? Again, just need some direction on how to troubleshoot this. I have tried to reinstall gems without concurrent install with bundle install --force, but this does not resolve the issue on the failed containers. Any help would be much appreciated!

Hi @PhilCoggins ,
I don't think this can issue can be because of how gems are installed on your system.
Is there any difference between those containers - Are they are serving the same endpoint and sometimes returns different results?
Can you try and create minimal reproduction of your code using https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb  - schema, serializers and create an object that has bad serialization and I'll try to reproduce it as well?

Hi @yosiat thank you for the speedy response.
The containers are identical AFAICT, and the test case is the exact same and data is returned as expected, but somehow the attribute methods are not being called (though the standard attribute methods are). I've been working on a reliable reproduction, I will update this issue as soon as I get one.

@yosiat You are correct, this was not an issue with gem installation. My UserSerializer and ContactSerializer were a circular dependency, where ContactSerializer would attempt to load UserSerializer when it encountered the has_one :user relationship, which in turn would try to load ContactSerializer when it encountered the has_one :scoped_contact relationship.
To be honest, I have no idea how my autoloader (Zeitwerk) resolves this, but the reason this was intermittent is because the load order of the files was inconsistent between containers. If the ContactSerializer was loaded before the UserSerializer, I would get the error condition with full_name and photo_url being nil (presumably due to some method_missing logic?). If the UserSerializer got loaded first, then it would succeed. My best guess is that ContactSerializer simply stopped loading any code after it encountered the has_one :user relationship, possibly to resolve the circular dependency, and thus full_name and photo_url would never get defined. Or maybe they were defined, but UserSerializer is holding a reference to a version of ContactSerializer that has changed after UserSerializer was defined.
My "fix" was to move the has_one :user declaration below the full_name and photo_url methods, no more intermittent errors 🎉 .
I think this could be made more reliable. When you define relationships on an ActiveRecord model, they allow you to pass an argument class_name (like passing serializer in Panko) that is the constant name as a string, that is then lazily loaded. This is very useful as it will likely only be called after all files have been loaded.
Would you consider supporting a similar API that uses serializer: "UserSerializer", or alternatively I've seen something like serializer: -> { UserSerializer } in other libraries. IMO the current behavior should be deprecated - it seems that circular dependencies with these serializers would be fairly common. For example I might have a PostSerializer and CommentSerializer that refer to each other when they are serialized (If I want post JSON, then I would to include comments, and if I want comment JSON, then I would it to include the post). The nature of Rails' autoloading makes these types of issues very difficult to debug, I'd hate for your other users to to have to go through this.
I wrote a test script which helped me identify this issue, but it's not a true repro as these single-file test scrips don't load classes and files in the same manner as would happen in a Rails environment. If you need I'd be happy to push a sample Rails app to demo this issue.

@PhilCoggins  sorry for replying one year later!
I implemented your suggestion here - https://github.com/panko-serializer/panko_serializer/pull/108, I hope it will solve this issue with circular dependency you have.
If you can run you tests with this branch and let me know if it solves the issue it will be amazing.

authors: PhilCoggins yosiat


text:
Minor fix + Combined notification settings and friend lists

Turned each key of the object into another object, with one key containing the friend list and the other containing the user's notification setting.
Also fixed line 100 by using >= instead of >, as the sign was inconsistent with the returned error statement

We would need to create an eval to merge the two objects first.

Easy
/eval var file = JSON.parse(fs.readFileSync('config/friends.json'); for (var i in file) { var list = file[i]; file[i] = {}; file[i].notify = false; file[i].list = list; } fs.writeFileSync('config/friends.json', JSON.stringify(file));

We're going to worry about this later if the need arises I think.

authors: SilverTactic panpawn

repo: panpawn/Pokemon-Showdown


text:
Use the Laravel Numbers helper

If you use the Numbers helper you can potentially localize the output numbers.

The presenters layer is framework ignostic

ow yeah.. sorry ;)

But the requirements are: PHP 8.3+, and Laravel 11.0+.

authors: nunomaduro schmeits

repo: panphp/pan


text:
开箱获得运动币漏领很多

开箱获得运动币虽然可以自动领取，但是好友的漏领很多，能否跟蚂蚁森林一样时时刻刻领取运动币？

欢迎进QQ辅助群交流：323175670


text:
jade是不是不支持jdk8？

paoding-rose依赖spring的版本为3.2，我看到网上一篇文章说spring3.2是不支持jdk8的？下面是文章链接地址
http://blog.csdn.net/zl544434558/article/details/44758381
[Rose-null@Spring-3.2.4.RELEASE]:I/O failure during jade scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during jade scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
at net.paoding.rose.jade.context.spring.JadeComponentProvider.findCandidateComponents(JadeComponentProvider.java:205)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.findJadeDAODefinitions(JadeBeanFactoryPostProcessor.java:373)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.doPostProcessBeanFactory(JadeBeanFactoryPostProcessor.java:311)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.postProcessBeanFactory(JadeBeanFactoryPostProcessor.java:295)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:684)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at net.paoding.rose.RoseFilter.prepareRootApplicationContext(RoseFilter.java:426)
at net.paoding.rose.RoseFilter.initFilterBean(RoseFilter.java:268)
at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:424)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:56)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at net.paoding.rose.jade.context.spring.JadeComponentProvider.findCandidateComponents(JadeComponentProvider.java:175)
... 27 more
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:53)
... 30 more

提示信息里有这样一句话：
Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\
你用的是tomcat6 tomcat6 貌似不支持java 8吧，你升级一下tomcat到tomcat8或者8.5应该就支持了

repo: paoding-code/paoding-rose


text:
Fix how we save IP addresses of customers

Since we currently get very little info on the anonymous customers that interact with the chat widget, we save their IP addresses (so we can eventually do a location lookup)
At the moment, we use conn.remote_ip (https://github.com/papercups-io/papercups/blob/master/lib/chat_api_web/controllers/customer_controller.ex#L17), but this ~seems to only return private IP addresses.
Investigate this as a possible solution? https://www.cogini.com/blog/getting-the-client-public-ip-address-in-phoenix/

I'll take a stab at this if it's not taken yet!

yes please @henrymori! (and as an added bonus, if you know of any good APIs to get locations from IP addresses, let me know 😬)

yes please @henrymori! (and as an added bonus, if you know of any good APIs to get locations from IP addresses, let me know 😬)

Sounds good, thanks! I have some ideas on reverse geocoding I can kick around once we get the IP addresses accurately captured (at that point, we should probably start a separate GH issue for tracking IP -> geocoded information mapping).

for sure, will definitely want to track that in a separate ticket 👍

repo: papercups-io/papercups


text:
Should the next release with the Availability use case be 1.3.0 or 2.0.0?

Strictly: 2.0.0
Marketing: 1.3.0 @patricekrakow @globaltopmedia
...

Strictly speaking, we MUST change the planned release "1.3.0" into "2.0.0" as some modifications are not backward compatibles, e.g. we have removed the "PUT /customer-articles/{customerArticleId}" API endpoint, because we decided that once created a customer article MUST NOT be changed anymore but stay immutable.

repo: papinet/papiNet-API


text:
Fix redirect issue for PC browsers

Fixed in
05972d5


text:
Block builder

Describe the feature
Have the ability to take transactions from txpool, execute them against current plain state until block gas limit and calculate all headers roots
Additional context
No response

agree with what @onbjerg said. also, i think, this is blocked by #662

I think we are going in this direction: We are moving sidechain complexity from pipeline and db tables to Downloader and in memory structures. The reason why this is possible is that every blockchain (not just eth) has a finality.

Assigning to @rkrasiuk given he's taken point on Engine API.

Just a info here, executing the block and building the block are two different functions.
We have StateProvider trait that wraps database access.
The algorithm for building the block if I remember correctly is all about filling block gas to the max.
You have a list of transactions that you iterate on and then:
let block_remaining_gas = eip1559(gas_limit);
for tx in txs {
     if tx.gas_limit > block_remaining_gas {
             continue
      }
      ...
      let res revm::execute(tx) // with revm 3.0.0 if it is Return::Err this tx is invalid and needs to be skipped.
      commit(res)
      ....
      block_remaining_gas -= res.gas_used;
}
//calculate all roots( state root, receipt root,etc.)

changesets can probably be returned as they can be reused.

Unassigning given we'll go for the builder later and is not a blocker for full-sync.

For a project I'm working on, we will need something related to this: we have a separate sequencer for transactions, but we need to get the correct executed header. Given that we are using Rust, would like to use REVM, and Reth aims to be a framework for other EVMs, would rather contribute than do home cooking.
What we need: given the current DB state, take a set of PayloadAttributes, a list of transactions, and execute to return an ExecutionPayload.
I believe this can function as a part of this broader issue: while block building requires logic around picking the transactions, maximizing gas fees... you also need to execute to get header data.
If this is functionality the team agrees would be useful, the broader question is where it should be contributed to. My gut feeling is that this should be on the executor crate, but I haven't been directly working on the project just observing thus far. I’m envisioning a function defined as such:
pub fn gen_execution_payload<DB: StateProvider>(
    payloadAttrs: &PayloadAttributes,
    transactions: &[TransactionSignedEcRecovered],
    db: &mut SubState<DB>,
) -> Result<ExecutionPayload, Error>

I think this is also like related to https://github.com/paradigmxyz/reth/issues/1105 and https://github.com/paradigmxyz/reth/issues/1104 let me know if this is best directed there.

Yeah I think this is related to 1104. Your API seems to make sense, would try to not leak the SubState type like we do in the executor.
But yeah I would expose that as a method on the executor, and we can do the logic around which txs to pick separate. you should probably also return how much profit there is in that payload?

I believe this issue is now covered with
https://github.com/paradigmxyz/reth/pull/2161
and
https://github.com/paradigmxyz/reth/pull/2161
so vote to close

Agree, nice work. The out-of-process builder for MEV etc. is a separate topic.

authors: gakonst joroshiba mattsse rakita

repo: paradigmxyz/reth


text:
feat(parca): add GRPC ingress

I was toying with this, it would allow to use the GRPC protocol to communicate with the demo:
$ grpcurl demo.parca.dev:443 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

I saw this client failing with HTTP 415 (Unsupported Media Type), it's in Scaleway, but in another account I think (parca-load in Pyrra's account?):
51.15.51.214 - - [31/May/2023:19:55:34 +0000] "POST /parca.query.v1alpha1.QueryService/Query HTTP/2.0" 415 63 "-" "grpc-go-connect/1.1.0 (go1.18.10)" 98 0.001 [parca-parca-http] [] 100.64.2.183:7070 72 0.000 415 93c8ab7948a074a26b2435c8cb1808db

@metalmatze should it use GRPC-Web under /api/ like the UI does? Or could we switch it to regular GRPC?

diff
===== networking.k8s.io/Ingress parca/parca-grpc ======
diff --git a/tmp/argocd-diff2343086198/parca-grpc-live.yaml b/tmp/argocd-diff2343086198/parca-grpc
index e69de29..8c99a97 100644
--- a/tmp/argocd-diff2343086198/parca-grpc-live.yaml
+++ b/tmp/argocd-diff2343086198/parca-grpc
@@ -0,0 +1,72 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  annotations:
+    argocd.argoproj.io/tracking-id: scaleway-parca-demo-parca:networking.k8s.io/Ingress:parca/parca-grpc
+    kubernetes.io/ingress.class: nginx
+    nginx.ingress.kubernetes.io/backend-protocol: GRPC
+  labels:
+    app.kubernetes.io/component: observability
+    app.kubernetes.io/instance: parca
+    app.kubernetes.io/name: parca
+    app.kubernetes.io/version: v0.17.0
+  name: parca-grpc
+  namespace: parca
+spec:
+  rules:
+  - host: demo.parca.dev
+    http:
+      paths:
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /grpc.health.v1.Health
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /grpc.reflection.v1alpha.ServerReflection
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /parca.debuginfo.v1alpha1.DebuginfoService
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /parca.profilestore.v1alpha1.AgentsService
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /parca.profilestore.v1alpha1.ProfileStoreService
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /parca.query.v1alpha1.QueryService
+        pathType: Prefix
+      - backend:
+          service:
+            name: parca
+            port:
+              name: http
+        path: /parca.scrape.v1alpha1.ScrapeService
+        pathType: Prefix
+  tls:
+  - hosts:
+    - demo.parca.dev
+    secretName: demo-parca-dev-tls

@metalmatze Actually it would be nice to support both GRPC and GRPC-Web, but NGINX does not support that (kubernetes/ingress-nginx6297 (comment)).
I suggest we replace ingress-nginx by an Envoy-based ingress controller like Contour, it should have better support for GRPC: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_protocols/grpc.html
What do you think?

parca-load actually uses connect-go to speak gRPC with Parca:
https://github.com/parca-dev/parca-load/blob/c2c7a08ddb99c9ca40952895ef24907bd11e03b4/go.mod#L6
It would be indeed great to support gRPC, gRPC-web and connect-go I guess. If switching to something like Contour makes it easier, we can definitely try those. I know about them since forever but never actually used Envoy or Contour. Happy to try!

I know about them since forever but never actually used Envoy or Contour. Happy to try!

Same, I have been looking for a good excuse to try them

So I tried Contour, but nothing under /api works, we are blocked by this issue :disappointed::

Contour configures Envoy to automatically convert gRPC-Web HTTP/1 requests to gRPC over HTTP/2 RPC calls to an upstream service. This is a convenience addition to make usage of gRPC web application client libraries and the like easier.
Note that you still must provide configuration of the upstream protocol to have gRPC-Web requests converted to gRPC to the upstream app. If your upstream application does not in fact support gRPC, you may get a protocol error. In that case, please see this issue.

https://projectcontour.io/docs/1.25/guides/grpc/#grpc-web
A quick sum up of what works and what does not in each cases:

Ingress-NGINX
Ingress-NGINX (this PR)
Contour

gRPC on /
:negative_squared_cross_mark: (does not expect gRPC)
:heavy_check_mark:
:heavy_check_mark:

gRPC-Web on /
:heavy_check_mark:
:negative_squared_cross_mark: (expects gRPC)
:heavy_check_mark: (unnecessarily converted to gRPC)

gRPC-Web on /api
:heavy_check_mark:
:heavy_check_mark:
:negative_squared_cross_mark: (converted to gRPC)

Envoy still seems like a good solution, but Contour does not configure it in a way that would work for us at the moment.

I apologize for blaming these reserve proxies for an issue that was on our end :see_no_evil:, full gRPC and gRPC-Web support should be fixed once parca-dev/parca#3352 is released!

authors: maxbrunet metalmatze

repo: parca-dev/demo-deployments


text:
local-test: Add a Vagrantfile

Add Vagrantfile for ease of test
e.g https://github.com/aquasecurity/tracee/blob/41a0761776a5c735c3ae9a2c33a3812fc2e4a90a/Vagrantfile

I don't dislike the idea in principle but vagrant seems to be abandonware at this point. It's not well supported on Apple Silicon either. Perhaps we could provide a great developer experience with a more modern and maintained set of tools?

I don't dislike the idea in principle but vagrant seems to be abandonware at this point. It's not well supported on Apple Silicon either. Perhaps we could provide a great developer experience with a more modern and maintained set of tools?

💯 I couldn't agree more. I've other plans.

authors: javierhonduco kakkoyun

repo: parca-dev/parca-agent


text:
New action request: anantaramdas/ipfs-pinata-deploy-action

Action name
uses: anantaramdas/ipfs-pinata-deploy-action
Reasons
anantaramdas/ipfs-pinata-deploy-action

Intended usage
anantaramdas/ipfs-pinata-deploy-action

I have checked the internal marketplace for similar actions and couldn't find one that works for us.

[X] I have checked the internal marketplace first

:robot: Found these results:

Check
Results
Links

CodeQL on the forked repo
:white_check_mark:
CodeQL run

Security scan:

Check
Result

No Dependabot configuration found
⛔

No CodeQL Init found
⛔

No CodeQL Analyze found
⛔

:robot: Found these results:

Check
Results
Links

CodeQL on the forked repo
:white_check_mark:
CodeQL run

Security scan:

Check
Result

No Dependabot configuration found
⛔

No CodeQL Init found
⛔

No CodeQL Analyze found
⛔

:robot: Check completed with result: ⚠
Found 6 Dependabot security vulnerabilities:
3 where high and 3 where moderate.
Use this link to verify the alerts.


text:
Decoding Extrinsics

We need the ability to decode extrinsics.

Addressed by #49 and #75.

repo: paritytech/capi


text:
Update statemint branch deps

Needs more investigation. There is an error collating new parachain blocks.
2021-05-11 05:22:48 [Parachain] 🙌 Starting consensus session on top of parent 0xb4aa9c22c21454eb62e72078f46dfebfb735fff7e29803d9bc9ce5118c52b959
2021-05-11 05:22:48 [Parachain] panicked at 'validation function params are always injected into inherent data; qed', /home/user/.cargo/git/checkouts/cumulus-59522f43471fa161/da517f3/pallets/parachain-system/src/lib.rs:519:18
2021-05-11 05:22:48 [Parachain] Proposing failed. error=Application(Application(Execution(Wasmi(Trap(Trap { kind: Unreachable })))))

superseded by #60

repo: paritytech/statemint


text:
mark nomination-pool funds as deactivated

    As a follow-up, all funds locked in nomination pools also have to be marked as deactivated now.

The migration will be O(pool_count). Each pool would look at its bonded account ledger.total and mark that as deactivated.
Originally posted by @kianenigma in https://github.com/paritytech/substrate/issues/12813#issuecomment-1336405691

I took a stab at this, but given the low TVL of pools, if we manage to make pool funds usable for governance soon, it is not worth it.
diff --git a/frame/nomination-pools/src/lib.rs b/frame/nomination-pools/src/lib.rs
index 3cb8abedda..54891f22ee 100644
--- a/frame/nomination-pools/src/lib.rs
+++ b/frame/nomination-pools/src/lib.rs
@@ -900,9 +900,8 @@ impl<T: Config> BondedPool<T> {

 	/// Bond exactly `amount` from `who`'s funds into this pool.
 	///
-	/// If the bond type is `Create`, `Staking::bond` is called, and `who`
-	/// is allowed to be killed. Otherwise, `Staking::bond_extra` is called and `who`
-	/// cannot be killed.
+	/// If the bond type is `Create`, `Staking::bond` is called, and `who` is allowed to be killed.
+	/// Otherwise, `Staking::bond_extra` is called and `who` cannot be killed.
 	///
 	/// Returns `Ok(points_issues)`, `Err` otherwise.
 	fn try_bond_funds(
@@ -934,6 +933,9 @@ impl<T: Config> BondedPool<T> {
 			BondType::Later => T::Staking::bond_extra(&bonded_account, amount)?,
 		}

+		// the funds in nomination pools are not usable for governance, ergo marked as deactive
+		T::Currency::deactivate(amount);
+
 		Ok(points_issued)
 	}

@@ -1835,6 +1837,9 @@ pub mod pallet {
 			)
 			.defensive()?;

+			// re-activate the funds.
+			T::Currency::reactivate(balance_to_unbond);
+
 			Self::deposit_event(Event::<T>::Withdrawn {
 				member: member_account.clone(),
 				pool_id: member.pool_id,
@@ -2586,6 +2591,7 @@ impl<T: Config> OnStakerSlash<T::AccountId, BalanceOf<T>> for Pallet<T> {
 		// anything here.
 		slashed_bonded: BalanceOf<T>,
 		slashed_unlocking: &BTreeMap<EraIndex, BalanceOf<T>>,
+		total_slashed: BalanceOf<T>,
 	) {
 		if let Some(pool_id) = ReversePoolIdLookup::<T>::get(pool_account) {
 			let mut sub_pools = match SubPoolsStorage::<T>::get(pool_id).defensive() {
@@ -2606,5 +2612,9 @@ impl<T: Config> OnStakerSlash<T::AccountId, BalanceOf<T>> for Pallet<T> {
 			Self::deposit_event(Event::<T>::PoolSlashed { pool_id, balance: slashed_bonded });
 			SubPoolsStorage::<T>::insert(pool_id, sub_pools);
 		}
+
+		// this will simply subtract the amount that was slashed from `ActiveIssuance`, so that when
+		// we calculate `total_issuance - active_issuance`, it remains accurate.
+		T::Currency::reactivate(total_slashed);
 	}
 }
diff --git a/frame/nomination-pools/src/tests.rs b/frame/nomination-pools/src/tests.rs
index 7d5d418bbf..a347451396 100644
--- a/frame/nomination-pools/src/tests.rs
+++ b/frame/nomination-pools/src/tests.rs
@@ -48,6 +48,10 @@ fn test_setup_works() {
 		assert_eq!(PoolMembers::<Runtime>::count(), 1);
 		assert_eq!(StakingMock::bonding_duration(), 3);
 		assert!(Metadata::<T>::contains_key(1));
+		// all initial balances.
+		assert_eq!(Balances::total_issuance(), 50);
+		// the 10 units in pool.
+		assert_eq!(Balances::inactive_issuance(), 10);

 		let last_pool = LastPoolId::<Runtime>::get();
 		assert_eq!(
diff --git a/frame/root-offences/src/mock.rs b/frame/root-offences/src/mock.rs
index 273fbf6141..e0b2eb7480 100644
--- a/frame/root-offences/src/mock.rs
+++ b/frame/root-offences/src/mock.rs
@@ -145,17 +145,6 @@ impl onchain::Config for OnChainSeqPhragmen {
 	type TargetsBound = ConstU32<{ u32::MAX }>;
 }

-pub struct OnStakerSlashMock<T: Config>(core::marker::PhantomData<T>);
-impl<T: Config> sp_staking::OnStakerSlash<AccountId, Balance> for OnStakerSlashMock<T> {
-	fn on_slash(
-		_pool_account: &AccountId,
-		slashed_bonded: Balance,
-		slashed_chunks: &BTreeMap<EraIndex, Balance>,
-	) {
-		LedgerSlashPerEra::set((slashed_bonded, slashed_chunks.clone()));
-	}
-}
-
 parameter_types! {
 	pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
 	pub static Offset: BlockNumber = 0;
@@ -163,7 +152,6 @@ parameter_types! {
 	pub static SessionsPerEra: SessionIndex = 3;
 	pub static SlashDeferDuration: EraIndex = 0;
 	pub const BondingDuration: EraIndex = 3;
-	pub static LedgerSlashPerEra: (BalanceOf<Test>, BTreeMap<EraIndex, BalanceOf<Test>>) = (Zero::zero(), BTreeMap::new());
 	pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(75);
 }

@@ -192,7 +180,7 @@ impl pallet_staking::Config for Test {
 	type MaxUnlockingChunks = ConstU32<32>;
 	type HistoryDepth = ConstU32<84>;
 	type VoterList = pallet_staking::UseNominatorsAndValidatorsMap<Self>;
-	type OnStakerSlash = OnStakerSlashMock<Test>;
+	type OnStakerSlash = ();
 	type BenchmarkingConfig = pallet_staking::TestBenchmarkingConfig;
 	type WeightInfo = ();
 }
diff --git a/frame/staking/src/lib.rs b/frame/staking/src/lib.rs
index 3672056534..dfc97ad4a3 100644
--- a/frame/staking/src/lib.rs
+++ b/frame/staking/src/lib.rs
@@ -678,8 +678,9 @@ impl<T: Config> StakingLedger<T> {
 		// clean unlocking chunks that are set to zero.
 		self.unlocking.retain(|c| !c.value.is_zero());

-		T::OnStakerSlash::on_slash(&self.stash, self.active, &slashed_unlocking);
-		pre_slash_total.saturating_sub(self.total)
+		let total_slashed = pre_slash_total.saturating_sub(self.total);
+		T::OnStakerSlash::on_slash(&self.stash, self.active, &slashed_unlocking, total_slashed);
+		total_slashed
 	}
 }

diff --git a/primitives/staking/src/lib.rs b/primitives/staking/src/lib.rs
index 9eb4a4890c..ba36cf3cd7 100644
--- a/primitives/staking/src/lib.rs
+++ b/primitives/staking/src/lib.rs
@@ -42,15 +42,17 @@ pub trait OnStakerSlash<AccountId, Balance> {
 	/// * `slashed_active` - The new bonded balance of the staker after the slash was applied.
 	/// * `slashed_unlocking` - A map of slashed eras, and the balance of that unlocking chunk after
 	///   the slash is applied. Any era not present in the map is not affected at all.
+	/// * `total_slashed` - The total amount that was slashed.
 	fn on_slash(
 		stash: &AccountId,
 		slashed_active: Balance,
 		slashed_unlocking: &BTreeMap<EraIndex, Balance>,
+		total_slashed: Balance,
 	);
 }

 impl<AccountId, Balance> OnStakerSlash<AccountId, Balance> for () {
-	fn on_slash(_: &AccountId, _: Balance, _: &BTreeMap<EraIndex, Balance>) {
+	fn on_slash(_: &AccountId, _: Balance, _: &BTreeMap<EraIndex, Balance>, _: Balance) {
 		// Nothing to do here
 	}
 }

I want to still pursue this as a PR to track TVL of Pools.

repo: paritytech/substrate


text:
revert should work even for finalised blocks

Doesn't seem to want to revert the correct chain.
➜  substrate git:(a456f8f1) ✗ ~/Desktop/substrate.master --name "Not So Fast"
2019-01-09 14:51:03 Substrate Node
2019-01-09 14:51:04   version 0.9.1-5fc4ef6a-x86_64-macos
2019-01-09 14:51:04   by Parity Technologies, 2017, 2018
2019-01-09 14:51:04 Chain specification: Charred Cherry
2019-01-09 14:51:04 Node name: Not So Fast
2019-01-09 14:51:04 Roles: FULL
2019-01-09 14:51:04 Best block: #164712
2019-01-09 14:51:04 Local node address is: /ip4/0.0.0.0/tcp/30333/p2p/QmZQiepeArd1U1JvuW51jGN96tcLR2FoTREkFXsipsQVqn
2019-01-09 14:51:04 Idle (0 peers), best: #164712 (0x371a…4058)
^C
➜  substrate git:(a456f8f1) ✗ ~/Desktop/substrate.master revert --chain cherry 1
2019-01-09 14:51:07 Reverted 0 blocks. Best: #0 (0x7e22…f3c3)
➜  substrate git:(a456f8f1) ✗ ~/Desktop/substrate.master revert 1
2019-01-09 14:51:12 Reverted 0 blocks. Best: #0 (0x7e22…f3c3)

I'm trying this at latest Polkadot v0.9.22
./polkadot revert --chain kusama --base-path data/polkadot 325000
2022-05-21 08:58:25 Essential task `txpool-background` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `transaction-pool-task-1` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `transaction-pool-task-0` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `basic-block-import-worker` failed. Shutting down service.
2022-05-21 08:58:25 There aren't any non-finalized blocks to revert.

it not revert finalized blocks, does the behavior changed?

Okey  am not an expert on consensus but a the meaning of finalization is irreversible

I'm trying this at latest Polkadot v0.9.22
./polkadot revert --chain kusama --base-path data/polkadot 325000
2022-05-21 08:58:25 Essential task `txpool-background` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `transaction-pool-task-1` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `transaction-pool-task-0` failed. Shutting down service.
2022-05-21 08:58:25 Essential task `basic-block-import-worker` failed. Shutting down service.
2022-05-21 08:58:25 There aren't any non-finalized blocks to revert.

it not revert finalized blocks, does the behavior changed?
UPDATE:
after run revert, the db seems corrupted
2022-05-21 22:18:34 [Relaychain] ⚙  Syncing  0.0 bps, target=#12786636 (11 peers), best: #12778495 (0x2999…9b1f), finalized #12778495 (0x2999…9b1f), ⬇ 44.6kiB/s ⬆ 14.3kiB/s
2022-05-21 22:18:34 [Parachain] 💤 Idle (25 peers), best: #1651718 (0xa80c…b26c), finalized #1648352 (0x228e…848f), ⬇ 8.9kiB/s ⬆ 3.2kiB/s
2022-05-21 22:18:35 [Relaychain] 💔 Error importing block 0xd12a7b1fc2f28b0152797c143d6164ec15ace445047233b64616da9bd92bf181: consensus error: Import failed: Parent block of 0xd12a…f181 has no associated weight
2022-05-21 22:18:37 [Relaychain] 💔 Error importing block 0xd12a7b1fc2f28b0152797c143d6164ec15ace445047233b64616da9bd92bf181: consensus error: Import failed: Parent block of 0xd12a…f181 has no associated weight

It can no longer sync new block

Addressed by https://github.com/paritytech/substrate/pull/11500

authors: MrishoLukamba davxy gavofyork jasl


text:
Cache runtime code

Currently code is hashed with blake2 on every call to runtime, which happens multiple times for each block import/production. Profiling shows it takes a bulk of execution time. Code and version should be cached and cache should be persistent across block states and only updated when code change event is detected.

I think we can close this?

Right, state cache also caches storage value hashes.

authors: arkpar bkchr


text:
Fix typo

Caught a typo in the docs: Transcation -> Transaction

/cla run-cla-check

bot merge

authors: bkchr sacha-l


text:
derive Serialize/Deserialize for BeefyAuthoritySet

Related to: https://github.com/paritytech/parity-bridges-common/issues/1574
We are working on implementing BEEFY finality in the bridges project and as part of this we'll need to have the initial BeefyAuthoritySet in the GenesisConfig structure. In order to do this we need BeefyAuthoritySet to implement serde serialize/deserialize.

bot merge

bot merge

bot rebase

authors: acatangiu bkchr serban300


text:
More Extensible Multiaddress Format

This PR introduces a more extensible MultiAddress format for Substrate that can be used to wrap multiple different address identifiers for an underlying AccountId:

Index
Raw Bytes (like an encoded string)
20 bytes (ETH)
32 bytes (like a 256 bit hash)

Ultimately this replaces and deprecates the less extensible and custom encoding format provided by the Indices pallet.
This now allows for a chain to have multiple different address formats for a single AccountId, specifically in conjunction with the StaticLookup trait that can be used to convert from one address format to the underlying AccountId.
This is relevant for things like a name service pallet, or even could make runtime integration with the EVM pallet more simple.
This also updated the Substrate Node Template to use the MultiAddress format by default, allowing it to easily upgrade to alternative lookups in the future if it wants and to keep the types the same between the Node Template and the Node!
This is a breaking change for any front-end to runtime communication using the old indices format since the encoding format of these multiaddresses have now changed.
cc @jacogr @gavofyork

This is super useful for evm integration.
Should have a way to provide multiple lookup sources. So we can do
impl frame_system::Trait for Runtime {
	type Lookup = (Indices, Evm, NameService);

@xlc do you know if there is a better way to do this?
https://github.com/paritytech/substrate/pull/7197/commits/20d1a706c9ba3670c09f8ea0e773face9a5734a9
/// Perform a StaticLookup where there are two lookup sources of the same type.
pub struct TwoStaticLookup<A, B>(PhantomData<(A, B)>);
impl<A, B> StaticLookup for TwoStaticLookup<A, B>
where
	A: StaticLookup,
	B: StaticLookup<Source = A::Source, Target = A::Target>,
{
	type Source = A::Source;
	type Target = A::Target;

	fn lookup(x: Self::Source) -> Result<Self::Target, LookupError> {
		let a = A::lookup(x.clone());
		if a.is_ok() {
			return a
		} else {
			B::lookup(x)
		}
	}
	fn unlookup(x: Self::Target) -> Self::Source {
		A::unlookup(x)
	}
}

Can't figure out how to get impl_for_tuples working but this is my take
impl<A, B> StaticLookup for (A, B)
where
	A: StaticLookup,
	B: StaticLookup<Source = A::Source, Target = A::Target>,
{
	type Source = A::Source;
	type Target = A::Target;

	fn lookup(x: Self::Source) -> Result<Self::Target, LookupError> {
		A::lookup(x.clone()).or_else(|_| B::lookup(x))
	}
	fn unlookup(x: Self::Target) -> Self::Source {
		A::unlookup(x)
	}
}

and type Lookup = (Indices, (NameService, NameService));

bot merge

Hi all,
Is this a backwards breaking change in relation to transaction serialization?

Hi all,
Is this a backwards breaking change in relation to transaction serialization?

=> Yes it is . Clearer communication around breaking changes is super important for developers working on wallet implementations - there should be a preceeding documentation specifying serialization and a change description, not just a code change that introduces breaking changes. Crucial to support and incentivice independent development.

authors: Felix0301 shawntabrizi xlc


text:
Relax std constraint of sp-runtime::testing

Hand picks conditional serde or std features and frees everything else for core usage.

Can you explain why you need this?

@bkchr It was about using TestXt in a no_std context.
At the end of the day, I simply copied and pasted the source code to create a new bare-bones TestXt without hard serde dependency so now this PR isn't necessary anymore.
Thanks for you time


text:
Import lci legacy data

Script to import legacy data from LCI
Various model changes to accommodate the data
to actually import the data run the command:
./manage.py runscript legacy.LCI.import_legacy_data

This change is

Reviewed 44 of 44 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.

Comments from Reviewable

repo: parksandwildlife/biosys


text:
Added detail view to ITSystemResource, updated ITSystemHardware model.

This change is

Coverage increased (+0.2%) to 48.856% when pulling 50940bc5be3e0ed197fa14c1d0f5839774821d7a on ropable:master into 64d2e8f27279bf418d5995b4bb79ee449849a225 on parksandwildlife:master.

authors: coveralls ropable

repo: parksandwildlife/oim-cms


text:
Combobox items cannot be modified

After being appended there's no way to remove an item from a combobox. EditableCombobox has this issue as well.

API is missing on libui. I posted an issue there.

authors: PaulBGD parro-it

repo: parro-it/libui-node


text:
Ios Scan Networks

I just came across this IOS git project:  https://github.com/mongizaidi/LAN-Scan
Does that have the logic to get the startScan, scanNetwork and listNetworks methods working?

Thanks for sharing, I hope this will lead to an IOS scan inside WifiWizard :)

Thanks for sharing. I'm going to look into the project a bit more, but as far as I know there is no public IOS API that allows wifi scanning.
There are private API's that do what you are looking for but use of private API's prevents an app from being distributed from the app store.

I wasn't aware of those limitations. Thank you @hoerresb for explaining them. BTW WifiWizard is the most advanced Cordova plugin in the wifi domain so we have some more expectations ;)

Closing for now, as there is no public IOS API that allows wifi scanning.

authors: Solido hoerresb zenmanenergy

repo: parsonsmatt/WifiWizard


text:
[WIP] 리팩토링

구조 리팩토링
기본 클래스

[x] Tweak
[x] TweakSetting
[x] TweakPatch
[x] TweakFunction

Tweak

기본적인 기능 클래스
1개의 TweakSetting 포함 가능
1개 이상의 패치 클래스 포함 가능

TweakSetting

각 Tweak에 사용되는 설정값을 모아놓은 클래스
Tweak당 최대 1개의 Setting을 가질 수 있음
[Draw], [Label] Attribute를 통해 간단히 GUI를 표시 가능
OnGUI에서 설정 화면에 표시될 사항 설정 가능
this.Draw();로 간단한 GUI를 표시 가능

TweakPatch

HarmonyPatch 대신하는 패치 클래스
고유의 ID를 가지며 ID로 패치 가능
버전에 따른 조건부 패치 가능

TweakFunction

Tweak에 포함되는 키맵 기능
TweakSetting의 KeyMap에 연동하여 사용 가능
타일의 선택 여부 (선택 X, 타일 1개, 다중 타일) 설정 가능

Tweak 목록

[x] MoveEventAltArrow
[x] MoreEditorSettings
[x] RemoveEditorLimits
[x] RotateSmallerDeg
[x] ShowDegree
[x] RotateScreen
[x] HighlightTargetedTiles
[x] PreserveTileIndex
[x] AllowMP3
[x] AutoArtistURL
[x] BetterArtistCheck
[x] ChangeAngleByDragging
[x] GraveToSee15Degs
[x] DetectBpmOffsetOnLoadSong
[ ] EventBundle

이벤트번들: 임시 중단

repo: patrick-choe/EditorHelper


text:
Feature/python node interface

What is the purpose of this PR?
The code in this PR allows our node code to communicate with the python process so that it can obtain a transcript of the audio extracted from the provided video file.
What was changed in this PR?
The code in app.py was changed so that it runs as a socket server on the Flask server (rather than a regular API on the Flask server). transcriptionHandler.ts was modified to call and obtain the transcription. socketServer.py was initally used for a spike of the socket, then was used for debugging the socket as it was run externally from the application. I'm thinking it should probably be deleted as it isn't actually being used and its functionality is almost entirely covered by app.py but thought I'd check first.
Other notes/questions
I'm not sure if/how automated tests can be written for this... if you have any suggestions or ideas (or if you think it's ok to not have tests written for it) please let me know!

Got it working and it's really cool to see it all together! I tested the transcription with a pitch I did for another unit, the transcription it came up with is pretty funny at times 😅

To be fair though, this was a poorly recorded Zoom audio and I was speaking quite fast, so for slower speech recorded with a proper mic it will probably be more accurate

authors: kateahyde patrickbrett

repo: patrickbrett/mlvet


text:
Pass ClassName through to equalizer div

I've made this modification so an additional div will not be needed to apply a class to the equalizer group

Looks good mate.
One suggestion can you fix this up so it uses the spread operator so it will be generic and handle other props like styles etc... see https://facebook.github.io/react/docs/transferring-props.html.
Something like this:
updateChildrenHeights() {
    const { property, byRow, enabled, nodes, ...other } = this.props
    const node = ReactDOM.findDOMNode(this)

    if (!enabled(this, node)) {
      return
    }

    if (node !== undefined) {
      const children = nodes(this, node)
      const heights  = this.constructor.getHeights(children, byRow)

      for (let row = 0; row < heights.length; row++) {
        const max = heights[row][heights[row].length-1]

        for (let i = 0; i < (heights[row].length - 1); i++) {
          heights[row][i][0].style[property] = max + 'px'
        }
      }
    }
  }

  render() {
    return (
      <div {...other}>
        {this.props.children}
      </div>
    )
  }

authors: markv patrickgalbraith

repo: patrickgalbraith/react-equalizer


text:
[TopBottomShader] with negative values splits the line color into two

How to reproduce
Use LineSpec with
shader = TopBottomShader(
topShader = DynamicShader.color(MaterialTheme.colorScheme.primary),
bottomShader = DynamicShader.color(MaterialTheme.customColors.negative)
)

and have postive, negative and zero values in ySeries
Observed behavior
Zero,Positive & Negative

Zero & Negative

Zero & Positive

Expected behavior
Zero values should be treated as positive and be drawn using topShader.
Vico version(s)
2.0.0-alpha.21
Android version(s)
Any
Additional information
No response

Hello! Thanks for the report. We’ll look into it.

Vico 2.0.0 Alpha 26 resolves this. Cheers!

I’m reopening this issue because, as reported here, the problem now occurs under different circumstances—when the split’s y value is equal or very close to the LineCartesianLayer’s minimum y value. We overlooked this edge case while developing the fix, for which we apologize. We’ll look into it.

Vico 2.0.0 Alpha 27 addresses the aforementioned oversight. Thanks again!

Still experiencing same issue on Vico 2.0.0 Alpha 27.

OLD ISSUE: Line colors are split.
NEW ISSUE: Default marker mixes the colors of both fill colors:
fill = LineCartesianLayer.LineFill.double(
                            topFill = fill(MaterialTheme.colorScheme.primary),
                            bottomFill = fill(MaterialTheme.customColors.negative)
                        )

Data for this view:
xSeries = [19936, 19937, 19938, 19939, 19940, 19941, 19942]
ySeries = [500.00, -5, -5, -5, -5, -25, -25]

Hi @mak1nt0sh, it’s related, but it’s not the same problem. The split position is now calculated correctly, but there seems to be an issue with color extraction, probably due to antialiasing. Please open a new issue that can be a copy of your last comment, or just a link to the comment.

authors: Gowsky mak1nt0sh patrickmichalik

repo: patrykandpatrick/vico


text:
Second instance's camera and web portal randomly crashing

Hi Paul. First thankyou for this script. Really awesome!
So I used your script to setup two instances yesterday. Both are Creality Ender 3 printers but different models. I also added one camera to each of them. Both cameras however are the exact same model with the same serial number (which is actually just the model name). When I added the second camera to the second instance, I was warned that because that serial number is the same as a previously added webcam, there can be instability.
The above being said, I setup both instances are they're working fine, cameras too. The issue however are two things:

After about 30 - 90 seconds of streaming, the second instance's camera starts blanking out or stuttering randomly. If I refresh the stream webpage, it starts playing again. If I play the stream in VLC, I notice the same thing that it's sometimes stuttering/pausing.
The second instance's webpage portal also crashes after a few minutes. By crash, I mean the page would stop syncing and I see the 'Aw, snap' error in Chrome (error code: STATUS_BREAKPOINT). Tried another browser and same thing. But if I refresh the page, it reloads fine.

Both above issues don't mess with anything that's printing, which continues fine. I just have to keep refreshing which is annoying. Also both issues only happen with the second instance. Neither has happened to the first instance even once.
Any ideas what could be the issue ?

It is hard to know for sure, but my first guess for the stuttering camera is simply that you are running out of wifi network bandwidth. Decrease the resolution and FPS for the cameras and see if that improves things.
For the webpage stopping, I would open browser console and see what message you get when that happens. I suspect possibly a plugin, though it may also be that the socket is timing out because the device cannot keep up with network traffic due to the cameras.

authors: ahmad-najeeb paukstelis


text:
Add BepInEx as a dependency in manifest

While for modpacks its not noticeable, if the mod is installed alone a lot of people will just think its broken when it doesnt load with no error message

fixed

authors: KlutzyBubbles paul-merkamp

repo: paul-merkamp/LCBetterSaves


text:
Unable to write characteristic

Writing a characteristic with a write method is impossible even while trying on example. The same task is possible while trying it with nRF Connect app. On every try this exception occurs:

E/flutter (15693): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(write_characteristic_error, writeCharacteristic failed, null)
E/flutter (15693): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (15693): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (15693):
E/flutter (15693): #2      BluetoothCharacteristic.write (package:flutter_blue/src/bluetooth_characteristic.dart:123:10)
E/flutter (15693): #3      DeviceScreen._buildServiceTiles... (package:flutter_joystick/main.dart:179:37)
E/flutter (15693): #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter (15693): #5      _InkResponseState.build. (package:flutter/src/material/ink_well.dart:789:36)
E/flutter (15693): #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (15693): #7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter (15693): #8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter (15693): #9      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7)
E/flutter (15693): #10     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (15693): #11     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter (15693): #12     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (15693): #13     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (15693): #14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (15693): #15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (15693): #16     _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter (15693): #17     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (15693): #18     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter (15693): #19     _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter (15693): #20     _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)

Can you supply me with the service, characteristic, and descriptors?

I've done that in following manner:
    void writeChar() async {       List<BluetoothService> services = await device.discoverServices();       services.forEach((service) {         service.characteristics.forEach((character) {           if (character.uuid.toString() == WRITECHARACTERISTIC_UUID) {             character.write([0x01]);           }         });       });     }
And variable which contains characteristic:
  static const String WRITECHARACTERISTIC_UUID =       "013dc1df-9b8c-4b5c-949b-262543eba78a";

What properties does the characteristic have enabled?  Does it have any descriptors?

我也遇到了此问题，我是快速写入时会遇到。

hi ,I also encountered this problem, which I encountered when writing quickly.
E/flutter (26820): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(write_characteristic_error, writeCharacteristic failed, null)
E/flutter (26820): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (26820): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (26820):
E/flutter (26820): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (26820): #3      BluetoothCharacteristic.write (package:flutter_blue/src/bluetooth_characteristic.dart:121:10)
E/flutter (26820): #4      BlueHelp._send (package:HolderWallet/blue/BlueHelp.dart:383:28)

I bought device from other manufacturer (ESP32) and tested the same characteristic and code base and it worked like a charm. So I suppose that this is not a problem of a flutter blue plugin. And also I can say that nRF Connect was writing characteristic in server mode which is totally different.  I'm sorry for creating this issue.

I bought device from other manufacturer (ESP32) and tested the same characteristic and code base and it worked like a charm. So I suppose that this is not a problem of a flutter blue plugin. And also I can say that nRF Connect was writing characteristic in server mode which is totally different.  I'm sorry for creating this issue.

You can close issue


text:
Remove all package.scala

Breaking changes I liked having all implicits directly inside the package object but it started to create problems.
When generating the documentation, which depends on all projects, we had runtime errors while all tests were green, but they are ran on one project at a time. Also, it means all implicits where always present on the scope which might not be the best option. I had a lot of feedback about IDE lost when working with jwt-scala.
So the idea is to move them from the package object to the JwtXXX object. For example, for Play Json:
// Before
// JwtJson.scala.
package pdi.jwt

object JwtJson extends JwtJsonCommon[JsObject] {
  // stuff...
}

// package.scala
package pdi

package object jwt extends JwtJsonImplicits {}

// --------------------------------------------------------
// After
// JwtJson.scala.
package pdi.jwt

object JwtJson extends JwtJsonCommon[JsObject] with JwtJsonImplicits {
  // stuff...
}

For your code, it means that importing pdi.jwt._ will no longer be enough. You will need to import the matching JwtXXX object. For example, for Play Json, it will be pdi.jwt.JwtJson._.
I will wait a bit to have feedback from users before merging and releasing.

I quite prefer this approach as it prevents the importing of clashing implicits. Besides, on user code, in most of the cases the user won't need to change their code as the use site of the actual implicits is in the JwtJson, JwtCirce, JwtUpickle, etc. objects... unless there is something I'm missing with the Play integration...
Anyway, the change itself, even if it's source compatible, it will force re-compile of downstream dependencies.

authors: alonsodomin pauldijou

repo: pauldijou/jwt-scala


text:
Added Travis CI build matrix to test different versions of Qt/.NET.

These combinations should suffice:
Linux

.NET Core 2.1/Qt 5.11
.NET Core 2.1/Qt 5.10
.NET Core 2.1/Qt 5.9
.NET Core 2.1/Qt 5.8
.NET Core 2.1/Qt 5.7
.NET Core 2.1/Qt 5.6
.NET Core 2.1/Qt 5.5
Mono/Qt 5.11

Mac

.NET Core 2.1/Qt 5.11
Mono/Qt 5.11

Maybe 5.5 is too old to support. If it isn't easy, remove it. I think at least 5.9 should be supported.


text:
Setting tabIndex for jexcel_textarea field

Hi,
Please set the tabIndex attribute value "-1" for the "jexcel_textarea" field, so that on pressing "tab" key focus will not go to that field.
Example: obj.textarea.tabIndex="-1";

It has been done. It will be in the repo in the next few hours.

authors: Ilayaraja-n paulhodel

repo: paulhodel/jexcel


text:
Formula shows #ERROR

I have a cell name B6 which is a date and B7 which is a number, i am using this formula in my sheet and it works fine but in your spreadsheet example it shows #ERROR
=IF((67-(YEAR(NOW())-YEAR(B6)))>=30;-ROUND(FV(-0,023;30;B7*12*0,4;0;1);-4);-ROUND(FV(-0,023;(67-(YEAR(NOW())-YEAR(B6)));B7*0,4*12;-PV(0,023;30-(67-(YEAR(NOW())-YEAR(B6)));B7*0,65*0,4*12;0;0);1);-4))

Your formula has erros.
In numbers decimal should: '.' you are using: ','
The formula arguments should: ',' you are using ';'
I have not checked any further problems. From what I have seem on FV implementation, it seems require 3 arguments.
https://exceljet.net/excel-functions/excel-fv-function
Good luck with your implementation. Next time, be polite and don't insult people we are all developers trying to do our work the best we can.
Regards,

i already tried and nothing works, maybe next time you help your potential customers rather than pushing ur subscription down their throat.

authors: CodeCurosity paulhodel


text:
Main Thread Checker Warning

Hi Paul,
I am getting this warning in SNfilter init() saying - " UI API called on a background thread: -[UIImageView initWithFrame:]". Any suggestions? Thanks in advance.

Hi @Sonali2009,
Indeed, SNFilter must be created in the main thread. The call to the initializer must be wrapped into a DispatchQueue.main.async {} block.
I will look at it soon to update the source code. Thank you!

repo: pauljeannot/SnapSliderFilters


text:
unable to add accessory failed with osstatus code -6700

Successfully installed the DS01C firmware on my switch.  Added to wifi successfully.  Now when adding to Homekit, I see it fine but after entering the Homekit code, I get this error:   "unable to add accessory failed with OSStatus code -6700"
*Update: turns out I have a DS01.  I updated to the DS02S firmware (gz version), and now the switch works perfectly.

Interesting, I don’t think I’ve run into the DS01, but glad the DS02S did it for you!  Is the DS01 a three way dimmer? I’d be happy to document it if I had some more details about the device!

Actually, that update probably failed and then the reboot, and subsequent attempt to pair succeeded. If you look at the device details in the home app, what does it say the model number is?

The model is the DS01, but I think there's also a newer DS01C.  When I tried that firmware it produced the error.  And I misspoke earlier - I didn't use the gz file, but rather just the DS02S bin file.  And of course that works great now.  The DS01 is a touch dimmer switch that's identical to the DS01C as far as I can tell.

Okay, that makes more sense!  I’ll update the docs to reflect that, and make another release binary (so the model number is accurately reflected in the Home app). Thanks!!

Hey, so sorry it's taken so long, but looking at the code now, and there's no difference between the DS02S and DS01C code (other than how it reports the model number in the Home app).  I was expecting to see a different serial baud rate since Treatlife has been updating that on newer devices, but in this case it's the same.  Perhaps there was something wrong with the initial attempt?  Closing the issue for now, but please re-open if you think I missed something!


text:
Mac: Add event on non-existing file never fires if the path contains symlinked directories

Describe the bug
On macOS: While watching a non-existing file when the parent directory exists and the parent directory path contains symlinks the add event is not fired when the file is created.
This works fine on Linux. It also works fine if the parent directory path contains no symlinks.
Versions (please complete the following information):

Chokidar version 3.5.3
Node version v16.16.0
OS version: macOS 12.5.1 arm64

To Reproduce:
Run sample program:
import { mkdir, symlink, writeFile } from 'fs/promises';
import * as chokidar from 'chokidar';
await mkdir("root");
await mkdir("root/watched");
await symlink("root", "link");
let watcher = chokidar.watch("link/watched/file").once('add', () => {
    console.log("watcher: file created");
    void watcher.close();
});
await new Promise(f => setTimeout(f, 1000));
await writeFile("link/watched/file", "sample content");
console.log('file written.');

Expected behavior
watcher: file created should be printed.

I suspect this is also an issue on Windows. I'm using @nuxt/content which uses unstorage, which in turn uses this for file access, and it can't see symlinked files/dirs either. See the issue here: https://github.com/nuxt/content/issues/2026

authors: hkratz shawnwildermuth

repo: paulmillr/chokidar